diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/border_patrol/point.rb b/lib/border_patrol/point.rb
index abc1234..def5678 100644
--- a/lib/border_patrol/point.rb
+++ b/lib/border_patrol/point.rb
@@ -11,5 +11,21 @@ alias :lng= :x=
alias :lon :x
alias :lon= :x=
+
+ # Lots of Map APIs want the coordinates in lat-lng order
+ def latlng
+ [lat, lon]
+ end
+ alias :coords :latlng
+
+ def inspect
+ self.class.inspect_string % self.latlng
+ end
+
+ protected
+ # IE: #<BorderPatrol::Point(lat, lng) = (-25.363882, 131.044922)>
+ def self.inspect_string
+ @inspect_string ||= "#<#{self.name}(lat, lng) = (%p, %p)>"
+ end
end
end
|
Add a friendly inspect output
|
diff --git a/lib/rubycritic/smell_adapters/flog.rb b/lib/rubycritic/smell_adapters/flog.rb
index abc1234..def5678 100644
--- a/lib/rubycritic/smell_adapters/flog.rb
+++ b/lib/rubycritic/smell_adapters/flog.rb
@@ -23,12 +23,12 @@ private
def create_smell(context, score)
- location = smell_location(context)
- message = "has a flog score of #{score}"
- type = type(score)
+ locations = smell_locations(context)
+ message = "has a flog score of #{score}"
+ type = type(score)
Smell.new(
- :locations => [location],
+ :locations => locations,
:context => context,
:message => message,
:score => score,
@@ -36,10 +36,10 @@ )
end
- def smell_location(context)
+ def smell_locations(context)
line = @flog.method_locations[context]
file_path, file_line = line.split(":")
- Location.new(file_path, file_line)
+ [Location.new(file_path, file_line)]
end
def type(score)
|
Rename `smell_location` method to `smell_locations`
|
diff --git a/app/models/channels/facebook_page_channel.rb b/app/models/channels/facebook_page_channel.rb
index abc1234..def5678 100644
--- a/app/models/channels/facebook_page_channel.rb
+++ b/app/models/channels/facebook_page_channel.rb
@@ -27,6 +27,7 @@ end
log_refresh
end
+ handle_asynchronously :refresh_items
private
|
Handle facebook channel update asynchronously
|
diff --git a/lib/docs/scrapers/redis.rb b/lib/docs/scrapers/redis.rb
index abc1234..def5678 100644
--- a/lib/docs/scrapers/redis.rb
+++ b/lib/docs/scrapers/redis.rb
@@ -1,7 +1,7 @@ module Docs
class Redis < UrlScraper
self.type = 'redis'
- self.release = 'up to 3.2.2'
+ self.release = 'up to 3.2.4'
self.base_url = 'http://redis.io/commands'
self.links = {
home: 'http://redis.io/',
|
Update Redis documentation (up to 3.2.4)
|
diff --git a/app/models/ability.rb b/app/models/ability.rb
index abc1234..def5678 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -2,9 +2,11 @@ include CanCan::Ability
def initialize(user)
+ # Stuff everyone can do
+ can [:read, :open], Document.shared
+
if user
# Document
- can [:read, :open], Document.shared
can [:index, :list, :create, :new, :all], Document
can [:show, :edit, :update, :destroy, :save, :open], Document do |doc|
doc.owner == user
|
Allow everyone to read shared documents
|
diff --git a/app/models/ability.rb b/app/models/ability.rb
index abc1234..def5678 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -11,11 +11,13 @@ can :manage, Authentication, user_id: user.id
if user.is_admin? && defined? RailsAdmin
+ # Allow everything
+ an :manage, :all
+
# RailsAdmin
# https://github.com/sferik/rails_admin/wiki/CanCan
-
- can :access, :rails_admin
- can :dashboard
+ # can :access, :rails_admin
+ # can :dashboard
# RailsAdmin checks for `collection` scoped actions:
# can :index, Model # included in :read
@@ -30,9 +32,6 @@ # can :destroy, Model, object # for Delete
# can :history, Model, object # for HistoryShow
# can :show_in_app, Model, object
-
- # Allow everything
- # can :manage, :all
end
end
end
|
Allow admit to manage everything
|
diff --git a/app/models/comment.rb b/app/models/comment.rb
index abc1234..def5678 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -2,4 +2,6 @@ belongs_to :user
belongs_to :commentable, polymorphic: true
has_many :votes, as: :votable
+
+ validates :content, :user_id, :commentable_id, presence: true
end
|
Add validations to Comment class
|
diff --git a/sql_tagger.gemspec b/sql_tagger.gemspec
index abc1234..def5678 100644
--- a/sql_tagger.gemspec
+++ b/sql_tagger.gemspec
@@ -9,6 +9,7 @@
s.add_development_dependency('rspec', '~> 3.4')
+ s.add_development_dependency('appraisal', '~> 2.1.0')
s.add_development_dependency('mysql')
s.add_development_dependency('mysql2')
s.add_development_dependency('pg')
|
Add appraisal gem as a development dependency
|
diff --git a/lib/hem/setup.rb b/lib/hem/setup.rb
index abc1234..def5678 100644
--- a/lib/hem/setup.rb
+++ b/lib/hem/setup.rb
@@ -7,6 +7,7 @@ require_relative 'version'
require_relative 'plugins'
-$:.push File.expand_path(File.join("..", ".."), __FILE__)
+gem 'hem', Hem::VERSION unless ENV['HEM_OMNIBUS']
+
require 'bundler'
require 'hem'
|
Enforce Hem's spec constraints on hem in gem mode
This is so that it requiring it's dependencies respects its own constraints on them
|
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -1,23 +1,32 @@ # coding: utf-8
class Admin::UsersController < ApplicationController
ssl_required :oauth, :api_key, :regenerate_api_key
- before_filter :login_required
+
+ before_filter :login_required, :check_permissions
before_filter :get_user, only: [:show, :update, :destroy]
def show
- not_authorized unless current_user.organization.present? && current_user.organization_owner
end
def create
- not_authorized unless current_user.organization.present? && current_user.organization_owner
+ @user = User.new
+ @user.set_fields(params[:user], [:username, :email, :password])
+ @user.organization = current_user.organization
+ @user.save
+ respond_with @user
end
def update
- not_authorized unless current_user.organization.present? && current_user.organization_owner
+ @user.set_fields(params[:user], [:quota_in_bytes, :email])
+ if attributes[:password].present?
+ @user.password = attributes[:password]
+ end
+
+ @user.save
+ respond_with @user
end
def destroy
- not_authorized unless current_user.organization.present? && current_user.organization_owner
@user.destroy
end
@@ -27,4 +36,8 @@ @user = current_user.organization.users_dataset.where(username: params[:id]).first
raise RecordNotFound unless @user
end
+
+ def check_permissions
+ not_authorized unless current_user.organization.present? && current_user.organization_owner
+ end
end
|
Implement create and update on organization users controller
|
diff --git a/lib/publify_core/engine.rb b/lib/publify_core/engine.rb
index abc1234..def5678 100644
--- a/lib/publify_core/engine.rb
+++ b/lib/publify_core/engine.rb
@@ -3,6 +3,10 @@ config.generators do |generators|
generators.test_framework :rspec, fixture: false
generators.fixture_replacement :factory_girl, dir: 'spec/factories'
+ end
+
+ config.to_prepare do
+ DeviseController.layout 'accounts'
end
initializer 'publify_core.assets.precompile' do |app|
|
Use correct layout for Devise in publify_core
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -3,9 +3,23 @@ # For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :mobile_filter_header
+ before_action :set_locale
def mobile_filter_header
@mobile = true
end
+ def mobile_filter_header
+ @mobile = true
+ end
+
+ def set_locale
+ I18n.locale = extract_locale_from_accept_language_header
+ end
+
+ private
+ def extract_locale_from_accept_language_header
+ request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first
+ end
+
end
|
Set website locale from Accept-Language header
This is a good option because the header is usually set by the user's
browser language preferences.
Code from http://guides.rubyonrails.org/i18n.html
|
diff --git a/lib/remix/stash/cluster.rb b/lib/remix/stash/cluster.rb
index abc1234..def5678 100644
--- a/lib/remix/stash/cluster.rb
+++ b/lib/remix/stash/cluster.rb
@@ -2,6 +2,7 @@ require 'digest/md5'
class Stash::Cluster
+ include Socket::Constants
@@connections = {}
@@ -39,8 +40,18 @@
private
+ def conntect(host, port)
+ address = Socket.getaddrinfo(host, nil).first
+ socket = Socket.new(Socket.get_const(address[0]), SOCK_STREAM, 0)
+ timeout = [2,0].pack('l_2') # 2 seconds
+ socket.setopt(SOL_SOCKET, SO_SNDTIMEO, timeout)
+ socket.setopt(SOL_SOCKET, SO_RCVTIMEO, timeout)
+ socket.connect(Socket.pack_sockaddr_in(port, address[0][3]))
+ socket
+ end
+
def host_to_io(key, host, port)
- @@connections[key] ||= TCPSocket.new(host, port)
+ @@connections[key] ||= connect(host, port)
end
end
|
Add low level socket timeout for reads and writes.
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,4 +2,8 @@ # Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
+
+ if ENV['AUTH_USERNAME'] && ENV['AUTH_PASSWORD']
+ http_basic_authenticate_with name: ENV['AUTH_USERNAME'], password: ENV['AUTH_PASSWORD']
+ end
end
|
Enable basic authentication to be configured
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,8 +1,10 @@ class ApplicationController < ActionController::Base
+
protect_from_forgery with: :exception
include SessionsHelper
def login_required
- redirect_to root_path if !logged_in?
+ redirect_to root_path unless logged_in?
end
+
end
|
ApplicationController: Replace negative logic with unless.
|
diff --git a/app/controllers/github_hook_controller.rb b/app/controllers/github_hook_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/github_hook_controller.rb
+++ b/app/controllers/github_hook_controller.rb
@@ -17,7 +17,7 @@ raise TypeError, "Repository for project '#{identifier}' is not a Git repository" unless repository.is_a?(Repository::Git)
# Get updates from the Github repository
- command = "cd '#{repository.url}' && cd .. && git pull"
+ command = "cd '#{repository.url}' && cd .. && git pull --rebase"
exec(command)
# Fetch the new changesets into Redmine
|
Use rebase to bring in changes from the remote repository to avoid merge-commit-messages in your Redmine changesets
|
diff --git a/ts_assets.gemspec b/ts_assets.gemspec
index abc1234..def5678 100644
--- a/ts_assets.gemspec
+++ b/ts_assets.gemspec
@@ -15,7 +15,7 @@ spec.license = "Apache-2.0"
spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
+ f.match(%r{^(test|spec|features|__tests__)/})
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
Reduce gem package size by ignoring `__tests__` directory
|
diff --git a/app/helpers/case_workers/travel_helper.rb b/app/helpers/case_workers/travel_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/case_workers/travel_helper.rb
+++ b/app/helpers/case_workers/travel_helper.rb
@@ -6,9 +6,13 @@ origin = options.delete(:origin)
destination = options.delete(:destination)
travelmode = options.delete(:travelmode) || 'driving'
- if origin.present? && destination.present?
- url = "https://www.google.co.uk/maps/dir/?api=1&origin=#{origin}&destination=#{destination}&travelmode=#{travelmode}"
- link_to(body, url, options)
- end
+
+ link_to(body, google_map_url(origin, destination, travelmode), options) if origin.present? && destination.present?
+ end
+
+ private
+
+ def google_map_url(origin, destination, travelmode)
+ "https://www.google.co.uk/maps/dir/?api=1&origin=#{origin}&destination=#{destination}&travelmode=#{travelmode}"
end
end
|
Fix view helper rubocop violations
|
diff --git a/lib/usesthis/renderable.rb b/lib/usesthis/renderable.rb
index abc1234..def5678 100644
--- a/lib/usesthis/renderable.rb
+++ b/lib/usesthis/renderable.rb
@@ -7,7 +7,7 @@ def render(params = {}, body = '')
params['site'] ||= Site.instance
- output = Erubis::Eruby.new(@contents).result(params) {
+ output = Erubis::Eruby.new(@contents).evaluate(params) {
body
}
|
Switch to evaluate(), so we can use instance variables.
|
diff --git a/Segundo.podspec b/Segundo.podspec
index abc1234..def5678 100644
--- a/Segundo.podspec
+++ b/Segundo.podspec
@@ -18,7 +18,7 @@ s.dependency 'castaway'
s.dependency 'KVOController'
s.dependency 'ObjectiveMixin'
- s.dependency 'PromiseKit/CorePromise', '~> 2.0'
+ s.dependency 'PromiseKit/CorePromise'
s.dependency 'AFNetworking'
s.dependency 'DynamicInvoker'
s.dependency 'KVOController'
|
Remove promisekit version dependency while PK is in flux with versioning
|
diff --git a/app/models/request.rb b/app/models/request.rb
index abc1234..def5678 100644
--- a/app/models/request.rb
+++ b/app/models/request.rb
@@ -25,7 +25,10 @@ end
def is_party_to?(user)
- [requester.id, responder.id].include?(user.id)
+ requester_id = requester.id
+ responder_id = has_neighbor? ? responder.id : nil
+
+ [requester_id, responder_id].include?(user.id)
end
def pretty_date
@@ -36,6 +39,10 @@ is_party_to?(user) && Vote.find_by(candidate_id: user.id, request_id: id) == nil && is_fulfilled
end
+ def has_neighbor?
+ !!responder
+ end
+
private
def defaultly_unfulfilled
|
Fix bug in the is_party_to method.
This method would have thrown an error if the request had no neighbors.
This (mis)behavior has been fixed.
|
diff --git a/spec/controllers/miq_report_controller/dashboards_spec.rb b/spec/controllers/miq_report_controller/dashboards_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/miq_report_controller/dashboards_spec.rb
+++ b/spec/controllers/miq_report_controller/dashboards_spec.rb
@@ -1,6 +1,6 @@ describe ReportController do
context "::Dashboards" do
- before :each do
+ before do
login_as user
@db = FactoryGirl.create(:miq_widget_set,
:owner => user.current_group,
|
Remove :each in dashboard specs as it's default value
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -32,17 +32,3 @@ "includes" => [ "${shared.config.dir}/WicketSampleApp.xml" ]
}
-default[:wlp][:servers][:Test1] = {
- "enabled" => true,
- "servername" => "Test1",
- "description" => "Test Server 1",
- "httpEndpoints" => [
- {
- "id" => "defaultHttpEndpoint",
- "host" => "*",
- "httpPort" => "9080"
- }
- ],
- "applicationsxml" => "applications.xml"
-}
-
|
Remove attribute for Test1 as its nolonger required with the latest application_wlp code
|
diff --git a/attributes/scripts.rb b/attributes/scripts.rb
index abc1234..def5678 100644
--- a/attributes/scripts.rb
+++ b/attributes/scripts.rb
@@ -1,2 +1,2 @@ default['et_upload']['api_url'] = 'https://api.evertrue.com'
-default['et_upload']['support_email'] = 'jenna@evertrue.com'
+default['et_upload']['support_email'] = 'onboarding@evertrue.com'
|
Send support emails to onboarding instead of Jenna
|
diff --git a/ext/tiny_tds/extconsts.rb b/ext/tiny_tds/extconsts.rb
index abc1234..def5678 100644
--- a/ext/tiny_tds/extconsts.rb
+++ b/ext/tiny_tds/extconsts.rb
@@ -9,6 +9,6 @@ FREETDS_VERSION_INFO = Hash.new { |h,k|
h[k] = {files: "ftp://ftp.freetds.org/pub/freetds/stable/freetds-#{k}.tar.bz2"}
}
-FREETDS_VERSION_INFO['0.99'] = {files: 'ftp://ftp.freetds.org/pub/freetds/current/freetds-dev.0.99.479.tar.bz2'}
+FREETDS_VERSION_INFO['0.99'] = {files: 'ftp://ftp.freetds.org/pub/freetds/current/freetds-dev.0.99.536.tar.bz2'}
FREETDS_VERSION_INFO['current'] = {files: 'https://github.com/FreeTDS/freetds/archive/master.zip'}
FREETDS_SOURCE_URI = FREETDS_VERSION_INFO[FREETDS_VERSION][:files]
|
Update FreeTDS v0.99 current version.
|
diff --git a/lib/validates.rb b/lib/validates.rb
index abc1234..def5678 100644
--- a/lib/validates.rb
+++ b/lib/validates.rb
@@ -1,6 +1,9 @@-[:email, :association_length, :inn, :money, :slug, :url].each do |name|
- autoload :"#{name.classify}Validator", "#{name}_validator"
-end
+autoload :InnValidator, "inn_validator"
+autoload :UrlValidator, "url_validator"
+autoload :SlugValidator, "slug_validator"
+autoload :EmailValidator, "email_validator"
+autoload :MoneyValidator, "money_validator"
+autoload :AssociationLengthValidator, "association_length_validator"
require 'active_model' # why i need do it?
|
Fix adding AssociationLength to autoload
|
diff --git a/lunartic.gemspec b/lunartic.gemspec
index abc1234..def5678 100644
--- a/lunartic.gemspec
+++ b/lunartic.gemspec
@@ -19,4 +19,5 @@ gem.require_paths = ['lib']
gem.add_development_dependency 'rspec', '~> 3.0.0'
+ gem.add_development_dependency 'rake'
end
|
Add rake as a dependency
|
diff --git a/test/controllers/coronavirus_local_restrictions_controller_test.rb b/test/controllers/coronavirus_local_restrictions_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/coronavirus_local_restrictions_controller_test.rb
+++ b/test/controllers/coronavirus_local_restrictions_controller_test.rb
@@ -0,0 +1,12 @@+require "test_helper"
+
+describe CoronavirusLocalRestrictionsController do
+ describe "GET show" do
+ it "correctly renders the local restrictions page" do
+ get :show
+
+ assert_response :success
+ assert_template :show
+ end
+ end
+end
|
Add a controller test for displaying the lookup
Co-authored-by: Leena Gupte <95ff60c7d7e33c5bbd817e4643a0ea35251cc1c8@digital.cabinet-office.gov.uk>
|
diff --git a/matchete.gemspec b/matchete.gemspec
index abc1234..def5678 100644
--- a/matchete.gemspec
+++ b/matchete.gemspec
@@ -3,7 +3,7 @@
Gem::Specification.new do |s|
s.name = 'matchete'
- s.version = '0.0.1'
+ s.version = '0.2.0'
s.platform = Gem::Platform::RUBY
s.authors = ["Alexander Ivanov"]
s.email = ["alehander42@gmail.com"]
@@ -12,10 +12,10 @@ s.description = %q{A DSL for method overloading for Ruby based on pattern matching}
s.add_development_dependency 'rspec', '~> 0'
-
+
s.license = 'MIT'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
-end+end
|
Change gemspec for new version
|
diff --git a/src/backprints/pageno.rb b/src/backprints/pageno.rb
index abc1234..def5678 100644
--- a/src/backprints/pageno.rb
+++ b/src/backprints/pageno.rb
@@ -15,8 +15,8 @@ raise "sett() was not called" unless not @text.nil?
fs_mm = @h_mm / 1.8
w_mm = ( @text.length + 4 ) * FONT_WH_RATIO * fs_mm
- @img.rectangle( @x_mm - w_mm / 2, @y_mm - @h_mm, w_mm, @h_mm, @line_style.merge( { 'fill' => 'black' } ) )
- @img.text( @x_mm, @y_mm - 0.6 * fs_mm, @text, @text_style.merge( { 'font-size' => fs_mm, 'fill' => 'white' } ) )
+ @img.rectangle( @x_mm - w_mm / 2, @y_mm - @h_mm, w_mm, @h_mm, fs_mm / 2, @line_style.merge( { 'fill' => 'none', 'stroke-width' => @line_style['stroke-width'] * 2 } ) )
+ @img.text( @x_mm, @y_mm - 0.6 * fs_mm, @text, @text_style.merge( { 'font-size' => fs_mm, 'fill' => 'black' } ) )
end
end # PageNoBackprint
|
Make page numbers rounded and awesome.
|
diff --git a/config.rb b/config.rb
index abc1234..def5678 100644
--- a/config.rb
+++ b/config.rb
@@ -25,5 +25,5 @@
# Deploy-specific configuration
activate :gh_pages do |gh_pages|
- gh_pages.remote = 'https://github.com/partialconf/partialconf.github.io'
+ gh_pages.remote = 'https://github.com/partialconf/2017.partialconf.com'
end
|
Deploy with the new origin
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -1 +1,18 @@-run Rack::Directory.new('.')+require 'sprockets'
+environment = Sprockets::Environment.new
+environment.append_path('javascripts')
+environment.append_path('stylesheets')
+environment.append_path('images')
+map '/assets' do
+ run environment
+end
+map '/' do
+ run Proc.new {
+ [
+ 200,
+ {},
+ ['ok']
+ ]
+ }
+end
+# run Rack::Directory.new('.')
|
Add serving of assets and index
|
diff --git a/tinkey.rb b/tinkey.rb
index abc1234..def5678 100644
--- a/tinkey.rb
+++ b/tinkey.rb
@@ -6,8 +6,8 @@ class Tinkey < Formula
desc "A command line tool to generate and manipulate keysets for the Tink cryptography library"
homepage "https://github.com/google/tink/tree/master/tools/tinkey"
- url "https://storage.googleapis.com/tinkey/tinkey-1.6.1.tar.gz"
- sha256 "156e902e212f55b6747a55f92da69a7e10bcbd00f8942bc1568c0e7caefff3e1"
+ url "https://storage.googleapis.com/tinkey/tinkey-1.7.0.tar.gz"
+ sha256 "2c9e69e5bc7561ce37918cecd3eeabb4571e01c915c4397bce25796ff04d92a3"
def install
bin.install "tinkey"
|
Update Tinkey URL and SHA-256 hash for Tink 1.7.0.
PiperOrigin-RevId: 467283778
|
diff --git a/spec/recipes/centos/default_spec.rb b/spec/recipes/centos/default_spec.rb
index abc1234..def5678 100644
--- a/spec/recipes/centos/default_spec.rb
+++ b/spec/recipes/centos/default_spec.rb
@@ -7,7 +7,7 @@ end
let(:expected_packages) do
- %w( libtool autoconf unzip rsync make gcc gcc-c++ xz-lzma-compat )
+ %w( libtool autoconf unzip rsync make gcc xz-lzma-compat )
end
it "installs core packages" do
|
Fix to the spec -- no longer expect gcc-c++
|
diff --git a/plugins/kegbot/kegbot-metrics.rb b/plugins/kegbot/kegbot-metrics.rb
index abc1234..def5678 100644
--- a/plugins/kegbot/kegbot-metrics.rb
+++ b/plugins/kegbot/kegbot-metrics.rb
@@ -0,0 +1,67 @@+#! /usr/bin/env ruby
+#
+# kegbot-metrics
+#
+# DESCRIPTION:
+# Output kegerator metrics from Kegbot
+#
+# OUTPUT:
+# metric-data
+#
+# PLATFORMS:
+# Linux
+#
+# DEPENDENCIES:
+# gem: sensu-plugin
+# gem: rest-client
+#
+# USAGE:
+# kegbot-metrics.rb --url <KEGBOT_API_URL>
+#
+# NOTES:
+#
+# LICENSE:
+# Copyright 2015 Eric Heydrick <eheydrick@gmail.com>
+# Released under the same terms as Sensu (the MIT license); see LICENSE
+# for details.
+#
+
+require 'sensu-plugin/metric/cli'
+require 'rest-client'
+
+#
+# Collect Kegbot metrics
+#
+class KegbotMetrics < Sensu::Plugin::Metric::CLI::Graphite
+ option :url,
+ description: 'Kegbot API URL',
+ short: '-u URL',
+ long: '--url URL',
+ required: true
+
+ option :scheme,
+ description: 'Metric naming scheme, text to prepend to metric',
+ short: '-s SCHEME',
+ long: '--scheme SCHEME',
+ default: 'kegbot'
+
+ def run
+ begin
+ response = RestClient.get("#{config[:url]}/taps")
+ taps = JSON.parse(response.body)['objects']
+ rescue Errno::ECONNREFUSED
+ critical 'Kegbot connection refused'
+ rescue RestClient::RequestTimeout
+ critical 'Kegbot connection timed out'
+ rescue => e
+ critical "Kegbot API call failed: #{e.message}"
+ end
+
+ taps.each do |tap|
+ tap_name = tap['name'].gsub(' ', '_')
+ output "#{config[:scheme]}.#{tap_name}.percent_full", tap['current_keg']['percent_full']
+ output "#{config[:scheme]}.#{tap_name}.volume_ml_remain", tap['current_keg']['volume_ml_remain']
+ end
+ ok
+ end
+end
|
Add metrics plugin for kegbot
|
diff --git a/test/models/user_test.rb b/test/models/user_test.rb
index abc1234..def5678 100644
--- a/test/models/user_test.rb
+++ b/test/models/user_test.rb
@@ -1,6 +1,7 @@ # Encoding: utf-8
require 'test_helper'
+# Test user model
class UserTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
|
Add header to user model test
|
diff --git a/Casks/firefox-cn.rb b/Casks/firefox-cn.rb
index abc1234..def5678 100644
--- a/Casks/firefox-cn.rb
+++ b/Casks/firefox-cn.rb
@@ -1,6 +1,6 @@ cask :v1 => 'firefox-cn' do
- version '41.0.2'
- sha256 '0d763d1d7841396a5c3e8d29d7ec8b387e7a8f942b32002d427e236ab8d9e676'
+ version '42.0'
+ sha256 'ccd21fd90e1f6d36f02cf3ecda61af97180ae06bccb58697d6d82ebfee59757b'
url "https://download.mozilla.org/?product=firefox-#{version}-SSL&os=osx&lang=zh-CN"
name 'Firefox'
|
Update Firefox CN to version 42.0
|
diff --git a/Casks/opera-beta.rb b/Casks/opera-beta.rb
index abc1234..def5678 100644
--- a/Casks/opera-beta.rb
+++ b/Casks/opera-beta.rb
@@ -1,6 +1,6 @@ cask :v1 => 'opera-beta' do
- version '27.0.1689.44'
- sha256 'a07580830e9b772ef6644d34c84b260fb17ea592f50b6d4a36fa3ffa6bdc4b0b'
+ version '28.0.1750.36'
+ sha256 'cab81fd4bee7b73ab8b377db3e73305f8dde64c2a495f4aa1acfd742e0ba248b'
url "http://get.geo.opera.com/pub/opera-beta/#{version}/mac/Opera_beta_#{version}_Setup.dmg"
homepage 'http://www.opera.com/computer/beta'
|
Upgrade Opera Beta.app to 28.0.1750.36
|
diff --git a/recipes/package.rb b/recipes/package.rb
index abc1234..def5678 100644
--- a/recipes/package.rb
+++ b/recipes/package.rb
@@ -31,7 +31,7 @@
resolvconf "custom" do
nameserver "127.0.0.1"
- search node["pdns"]["server"]["searchdomains"]
+ search node["pdns"]["authoritative"]["searchdomains"]
head "# Don't touch this configuration file!"
base "# Will be added after nameserver, search, options config items"
tail "# This goes to the end of the file."
|
Use the pdns/authoritative attribute namespace
|
diff --git a/puppet/lib/puppet/util/puppetdb/blacklist.rb b/puppet/lib/puppet/util/puppetdb/blacklist.rb
index abc1234..def5678 100644
--- a/puppet/lib/puppet/util/puppetdb/blacklist.rb
+++ b/puppet/lib/puppet/util/puppetdb/blacklist.rb
@@ -16,7 +16,7 @@ BlacklistedEvent.new("Schedule", "monthly", "skipped", nil)]
def initialize(events)
- @events = events.reduce({}) do |m, e|
+ @events = events.inject({}) do |m, e|
m[e.resource_type] ||= {}
m[e.resource_type][e.resource_title] ||= {}
m[e.resource_type][e.resource_title][e.status] ||= {}
|
Change from reduce to inject for ruby 1.8.5 compat
|
diff --git a/colossus.gemspec b/colossus.gemspec
index abc1234..def5678 100644
--- a/colossus.gemspec
+++ b/colossus.gemspec
@@ -5,6 +5,7 @@
Gem::Specification.new do |s|
s.name = "colossus"
+ s.license = "MIT"
s.version = Colossus::VERSION
s.authors = ["antoinelyset"]
s.email = ["antoinelyset+github@gmail.com"]
|
Add a License to gemspec
|
diff --git a/app/controllers/mail_conversations_controller.rb b/app/controllers/mail_conversations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/mail_conversations_controller.rb
+++ b/app/controllers/mail_conversations_controller.rb
@@ -2,6 +2,15 @@
def index
@mailbox_conversations = current_user.mailbox.conversations
+ end
+
+ def inbox
+ end
+
+ def outbox
+ end
+
+ def trashcan
end
def new
|
Create inbox,outbox, and trashcan routes.
|
diff --git a/rugged_adapter.gemspec b/rugged_adapter.gemspec
index abc1234..def5678 100644
--- a/rugged_adapter.gemspec
+++ b/rugged_adapter.gemspec
@@ -13,7 +13,7 @@ s.description = %q{Adapter for Gollum to use Rugged (libgit2) at the backend.}
s.license = "MIT"
- s.add_runtime_dependency 'rugged', '~> 0.21', '>=0.21.3'
+ s.add_runtime_dependency 'rugged', '~> 0.21.3', '>=0.21.3'
s.add_development_dependency "rspec", "2.13.0"
s.files = Dir['lib/**/*.rb'] + ["README.md", "Gemfile"]
|
Make rugged dependency more strict.
|
diff --git a/popularity_contest.gemspec b/popularity_contest.gemspec
index abc1234..def5678 100644
--- a/popularity_contest.gemspec
+++ b/popularity_contest.gemspec
@@ -4,7 +4,7 @@
Gem::Specification.new do |spec|
spec.name = "popularity_contest"
- spec.version = "0.0.5"
+ spec.version = "0.0.7"
spec.authors = ["Kasper Grubbe"]
spec.email = ["kawsper@gmail.com"]
spec.description = "A Rack application to count and sort popular content on our websites"
|
Bump gem version to 0.0.7
|
diff --git a/bashcov.gemspec b/bashcov.gemspec
index abc1234..def5678 100644
--- a/bashcov.gemspec
+++ b/bashcov.gemspec
@@ -18,7 +18,7 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
- gem.add_dependency 'simplecov'
+ gem.add_dependency 'simplecov', '~> 0.7.1'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
|
Set required version of SimpleCov
|
diff --git a/Casks/keepassx0.rb b/Casks/keepassx0.rb
index abc1234..def5678 100644
--- a/Casks/keepassx0.rb
+++ b/Casks/keepassx0.rb
@@ -2,8 +2,9 @@ version '0.4.3'
sha256 '15ce2e950ab78ccb6956de985c1fcbf11d27df6a58ab7bf19e106f0a1dc2fedd'
- url "http://downloads.sourceforge.net/keepassx/KeePassX-#{version}.dmg"
- homepage 'http://www.keepassx.org/'
+ url "https://www.keepassx.org/releases/KeePassX-#{version}.dmg"
+ name "KeePassX"
+ homepage 'https://www.keepassx.org/'
license :oss
app 'KeePassX.app'
|
KeePassX: Add name and update URL & homepage
|
diff --git a/test/ignore_test.rb b/test/ignore_test.rb
index abc1234..def5678 100644
--- a/test/ignore_test.rb
+++ b/test/ignore_test.rb
@@ -20,8 +20,8 @@
test "ignore in package" do
get '/main.js'
- assert body.size > 0
- assert !body.include?("BUMBLEBEE")
+ assert last_response.body.size > 0
+ assert !last_response.body.include?("BUMBLEBEE")
end
test "package files" do
|
Fix test for jruby support
|
diff --git a/Fingertips.podspec b/Fingertips.podspec
index abc1234..def5678 100644
--- a/Fingertips.podspec
+++ b/Fingertips.podspec
@@ -5,7 +5,7 @@
f.summary = 'Touch indicators on external displays for iOS applications.'
f.description = 'A UIWindow subclass that gives you automatic presentation mode in your iOS app.'
- f.homepage = 'http://github.com/mapbox/Fingertips'
+ f.homepage = 'https://github.com/mapbox/Fingertips'
f.license = 'BSD'
f.author = { 'Mapbox' => 'mobile@mapbox.com' }
|
Change homepage to https instead of http
|
diff --git a/Formula/kdelibs.rb b/Formula/kdelibs.rb
index abc1234..def5678 100644
--- a/Formula/kdelibs.rb
+++ b/Formula/kdelibs.rb
@@ -25,4 +25,17 @@ system "cmake .. #{std_cmake_parameters} -DCMAKE_PREFIX_PATH=#{gettext.prefix} -DBUNDLE_INSTALL_DIR=#{bin}"
system "make install"
end
+
+ def caveats
+ <<-END_CAVEATS
+ WARNING: this doesn't actually work for running KDE applications yet!
+
+ Please don't just add the Macports patches and expect them to be pulled.
+ I'm avoiding adding patches that haven't been committed to KDE upstream
+ (which I have commit access to). Instead of requesting I add these,
+ consider writing and testing an upstream-suitable patch.
+
+ Thanks for your patience!
+ END_CAVEATS
+ end
end
|
Add KDELibs caveat so people don't expect it to fully work yet.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,8 +6,7 @@ faceting_for :nobelists, :citizens # NB must be BEFORE any resources!
match ':controller(/:action(/:id(.:format)))'
-
- match "/", :to => redirect("/nobelists")
- end
+ end
+ root :to => 'nobelists#index'
end
|
Tweak to make root route work in presence of a prefix path.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,13 @@ ActionController::Routing::Routes.draw do |map|
- map.connect 'everything/graph',:controller=>'account',:action=>'graph',:account=>'everything'
- map.connect 'everything/report',:controller=>'account',:action=>'report',:account=>'everything'
+ map.connect 'everything/graph',:controller=>'account',:action=>'graph',:everything=>true
+ map.connect 'everything/report',:controller=>'account',:action=>'report',:everything=>true
map.connect ':account/report',:controller=>'account',:action=>'report'
map.connect ':account/graph',:controller=>'account',:action=>'graph'
- map.root :controller=>'account',:project=>'SC',:issue=>'47',:action=>'graph'
+ map.connect 'category/*allpath/graph', :controller=>'account',:action=>'graph'
+ map.connect 'category/*allpath/report', :controller=>'account',:action=>'report'
+ map.connect 'textual/*textpath/graph', :controller=>'account',:action=>'graph'
+ map.connect 'textual/*textpath/report', :controller=>'account',:action=>'report'
+ map.connect 'issue/:project/:issue/graph', :controller=>'account',:action=>'graph'
+ map.connect 'issue/:project/:issue/report', :controller=>'account',:action=>'report'
+ map.root :controller=>'account',:allpath=>%w{transport car generic ghgp us},:action=>'graph'
end
|
Add category paths to routing
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -5,7 +5,7 @@ # login (sessions) routes with named helpers
get '/login' => 'sessions#new', as: 'login_form'
post '/login' => 'sessions#create', as: 'login'
- destroy '/logout' => 'sessions#destroy', as: 'logout'
+ delete '/logout' => 'sessions#destroy', as: 'logout'
# user routes with named helpers (just #new and #create actions)
get '/users/new' => 'users#new', as: 'signup_form'
|
Change incorrect route mapper from 'destroy' to 'delete.'
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,11 +1,11 @@ ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
+require "codeclimate-test-reporter"
+CodeClimate::TestReporter.start
+
require "rails/test_help"
require "shoulda-context"
-require "codeclimate-test-reporter"
-
-CodeClimate::TestReporter.start
Rails.backtrace_cleaner.remove_silencers!
|
Test reporter must be added before, to correctly send test coverage
|
diff --git a/paperclip-deflater.gemspec b/paperclip-deflater.gemspec
index abc1234..def5678 100644
--- a/paperclip-deflater.gemspec
+++ b/paperclip-deflater.gemspec
@@ -10,6 +10,7 @@ gem.summary = "Deflate Processor for Paperclip"
gem.description = "Deflate Processor for Paperclip"
gem.license = "MIT"
+ gem.required_ruby_version = '~> 2.1'
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
Add minimum ruby version in gemspec
|
diff --git a/app/models/situation.rb b/app/models/situation.rb
index abc1234..def5678 100644
--- a/app/models/situation.rb
+++ b/app/models/situation.rb
@@ -1,4 +1,22 @@+# class ChoicesSetUnlessEnding < ActiveModel::Validator
+# def validate(record)
+# unless record.name.starts_with? 'X'
+# record.errors[:name] << 'Need a name starting with X please!'
+# end
+# end
+# end
+
class Situation < ActiveRecord::Base
validates :title, presence: true
validates :sit_rep, presence: true
+ # validates_with ChoicesSetUnlessEnding
+
+ validates :choice_1, presence: true,
+ unless: Proc.new { |a| a.ending? }
+ validates :choice_2, presence: true,
+ unless: Proc.new { |a| a.ending? }
+ validates :choice_1_label, presence: true,
+ unless: Proc.new { |a| a.ending? }
+ validates :choice_2_label, presence: true,
+ unless: Proc.new { |a| a.ending? }
end
|
Validate presence of choices unless ending.
|
diff --git a/core/app/models/spree/product_property.rb b/core/app/models/spree/product_property.rb
index abc1234..def5678 100644
--- a/core/app/models/spree/product_property.rb
+++ b/core/app/models/spree/product_property.rb
@@ -19,9 +19,7 @@ def property_name=(name)
if name.present?
# don't use `find_by :name` to workaround globalize/globalize#423 bug
- property = Property.where(name: name).first ||
- Property.create(name: name, presentation: name)
- self.property = property
+ self.property = Property.where(name: name).first_or_create(presentation: name)
end
end
end
|
Refactor creation of property by using first_or_create instead of condition based creation
|
diff --git a/Casks/google-japanese-ime-dev.rb b/Casks/google-japanese-ime-dev.rb
index abc1234..def5678 100644
--- a/Casks/google-japanese-ime-dev.rb
+++ b/Casks/google-japanese-ime-dev.rb
@@ -1,6 +1,6 @@ cask :v1 => 'google-japanese-ime-dev' do
- version 'dev'
- sha256 'd3f786d3462e0294f29bc1f8998163489f812a1ae650661e9a26a92b731c2ef8'
+ version :latest
+ sha256 :no_check
url 'https://dl.google.com/japanese-ime/dev/GoogleJapaneseInput.dmg'
homepage 'https://www.google.co.jp/ime/'
|
Fix checksum in Google Japanese IME Dev build
|
diff --git a/pgbundle.gemspec b/pgbundle.gemspec
index abc1234..def5678 100644
--- a/pgbundle.gemspec
+++ b/pgbundle.gemspec
@@ -26,5 +26,5 @@ spec.add_dependency 'pg', '> 0.17'
spec.add_development_dependency 'rspec', '~> 2.14.0'
spec.add_development_dependency "bundler", ">= 1.5.0"
- spec.add_development_dependency "rake"
+ spec.add_development_dependency "rake", "<= 11.0.0"
end
|
Set rake version to lower than 11.0
This is due to incompatibility of a newer rack with rspec
|
diff --git a/spec/actions_specs/clean_cocoapods_cache_spec.rb b/spec/actions_specs/clean_cocoapods_cache_spec.rb
index abc1234..def5678 100644
--- a/spec/actions_specs/clean_cocoapods_cache_spec.rb
+++ b/spec/actions_specs/clean_cocoapods_cache_spec.rb
@@ -0,0 +1,33 @@+describe Fastlane do
+ describe Fastlane::FastFile do
+ describe "Clean Cocoapods Cache Integration" do
+ it "default use case" do
+ result = Fastlane::FastFile.new.parse("lane :test do
+ clean_cocoapods_cache
+ end").runner.execute(:test)
+
+ expect(result).to eq("pod cache clean --all")
+ end
+
+ it "adds pod name to command" do
+ result = Fastlane::FastFile.new.parse("lane :test do
+ clean_cocoapods_cache(
+ name: 'Name'
+ )
+ end").runner.execute(:test)
+
+ expect(result).to eq("pod cache clean Name --all")
+ end
+
+ it "raise an exception if name is empty" do
+ expect {
+ Fastlane::FastFile.new.parse("lane :test do
+ clean_cocoapods_cache(
+ name: ''
+ )
+ end").runner.execute(:test)
+ }.to raise_error(RuntimeError)
+ end
+ end
+ end
+end
|
Add unit tests for clean_cocoapods_cache action.
|
diff --git a/spec/correios_sigep/builders/xml/request_spec.rb b/spec/correios_sigep/builders/xml/request_spec.rb
index abc1234..def5678 100644
--- a/spec/correios_sigep/builders/xml/request_spec.rb
+++ b/spec/correios_sigep/builders/xml/request_spec.rb
@@ -0,0 +1,46 @@+require 'spec_helper'
+require 'pry'
+
+module CorreiosSigep
+ module Builders
+ module XML
+ describe Request do
+ describe '.build_xml' do
+ let(:request) { double(:request, to_xml: '<root><test></root>') }
+ context 'when do not override anything' do
+ it 'builds a Authentication XML with Configuration parameters' do
+ expected_response = [
+ '<cartao>0057018901</cartao>',
+ '<codigo_servico>41076</codigo_servico>',
+ '<contrato>9912208555</contrato>',
+ '<codAdministrativo>08082650</codAdministrativo>',
+ '<senha>8o8otn</senha>',
+ '<usuario>60618043</usuario><test/>'
+ ].join + "\n"
+ expect(described_class.build_xml request).to eq expected_response
+ end
+ end
+
+ context 'when override the administrative fields' do
+ it 'builds a Authentication XML with the override parameter' do
+ administrative_fields = Models::AdministrativeFields.new(administrative_code: 'adm123',
+ card: 'card123',
+ contract: 'cont123',
+ service_code: 'ser123')
+ expected_response = [
+ '<cartao>card123</cartao>',
+ '<codigo_servico>ser123</codigo_servico>',
+ '<contrato>cont123</contrato>',
+ '<codAdministrativo>adm123</codAdministrativo>',
+ '<senha>8o8otn</senha>',
+ '<usuario>60618043</usuario><test/>'
+ ].join + "\n"
+ expect(described_class.build_xml request, administrative: administrative_fields).to eq expected_response
+ end
+ end
+
+ end
+ end
+ end
+ end
+end
|
Create the test when receive an override parameter
|
diff --git a/spec/helpers/specialist_documents_helper_spec.rb b/spec/helpers/specialist_documents_helper_spec.rb
index abc1234..def5678 100644
--- a/spec/helpers/specialist_documents_helper_spec.rb
+++ b/spec/helpers/specialist_documents_helper_spec.rb
@@ -4,7 +4,7 @@ describe '#nice_date_format' do
before :all do
- @time = Time.now.getutc.to_s
+ @time = Time.new(2013, 03, 11, 2, 2, 2, "+00:00").to_s
end
it 'should return a string with <time> tags' do
@@ -13,8 +13,7 @@ end
it 'should return <time> tag that includes a datetime attribute which is the ISO8601 timestamp for the time provided' do
- time = Time.now
- html = helper.nice_date_format(time.to_s)
+ html = helper.nice_date_format(@time)
datetime = /<time[^>]+datetime=['"](.*?)['"]>/.match(html)[1]
datetime.should == time.iso8601
end
|
Remove variable time in tests
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -17,7 +17,7 @@ database: ":memory:"
)
-unless ActiveRecord::Base.connection.tables.include? "dogs"
+unless ActiveRecord::Base.connection.data_sources.include? "dogs"
ActiveRecord::Schema.define do
create_table :dogs do |table|
table.column :created_at, :datetime
|
Use data_sources instead of tables
Fixes deprecation warning
|
diff --git a/app/tasks/fetch_feed.rb b/app/tasks/fetch_feed.rb
index abc1234..def5678 100644
--- a/app/tasks/fetch_feed.rb
+++ b/app/tasks/fetch_feed.rb
@@ -23,8 +23,9 @@ end
FeedRepository.update_last_fetched(@feed, raw_feed.last_modified)
- FeedRepository.set_status(:green, @feed)
end
+
+ FeedRepository.set_status(:green, @feed)
rescue Exception => ex
FeedRepository.set_status(:red, @feed)
|
Set feed status to green when parsing feeds returns 304
|
diff --git a/lib/troo/api/request.rb b/lib/troo/api/request.rb
index abc1234..def5678 100644
--- a/lib/troo/api/request.rb
+++ b/lib/troo/api/request.rb
@@ -2,16 +2,8 @@ module API
class Request
class << self
- def get(urn, query = {})
- new(:get, urn, query).response
- end
-
- def post(urn, query = {})
- new(:post, urn, query).response
- end
-
- def put(urn, query = {})
- new(:put, urn, query).response
+ def make(verb, urn, query = {})
+ new(verb, urn, query).response
end
end
|
Remove .get, .put, .post methods in favour of .make.
|
diff --git a/spec/bundler/installer/gem_installer_spec.rb b/spec/bundler/installer/gem_installer_spec.rb
index abc1234..def5678 100644
--- a/spec/bundler/installer/gem_installer_spec.rb
+++ b/spec/bundler/installer/gem_installer_spec.rb
@@ -0,0 +1,27 @@+# frozen_string_literal: true
+require "spec_helper"
+require "bundler/installer/gem_installer"
+
+RSpec.describe Bundler::GemInstaller do
+ let(:installer) { instance_double("Installer") }
+ let(:spec_source) { instance_double("SpecSource") }
+ let(:spec) { instance_double("Specification", :name => "dummy", :version => "0.0.1", :loaded_from => "dummy", :source => spec_source) }
+
+ subject { described_class.new(spec, installer) }
+
+ context "spec_settings is nil" do
+ it "invokes install method with empty build_args" do
+ allow(spec_source).to receive(:install).with(spec, :force => false, :ensure_builtin_gems_cached => false, :build_args => [])
+ subject.install_from_spec
+ end
+ end
+
+ context "spec_settings is build option" do
+ it "invokes install method with build_args" do
+ allow(Bundler.settings).to receive(:[]).with(:bin)
+ allow(Bundler.settings).to receive(:[]).with("build.dummy").and_return("--with-dummy-config=dummy")
+ allow(spec_source).to receive(:install).with(spec, :force => false, :ensure_builtin_gems_cached => false, :build_args => ["--with-dummy-config=dummy"])
+ subject.install_from_spec
+ end
+ end
+end
|
Add unit test for previous commit
|
diff --git a/app/decorators/manageiq/providers/ansible_tower/automation_manager/job_decorator.rb b/app/decorators/manageiq/providers/ansible_tower/automation_manager/job_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/manageiq/providers/ansible_tower/automation_manager/job_decorator.rb
+++ b/app/decorators/manageiq/providers/ansible_tower/automation_manager/job_decorator.rb
@@ -3,5 +3,11 @@ def self.fonticon
'ff ff-stack'
end
+
+ def single_quad
+ {
+ :fonticon => fonticon
+ }
+ end
end
end
|
Add single_quad definition for ansible tower jobs
|
diff --git a/bin/cab_locator_test.rb b/bin/cab_locator_test.rb
index abc1234..def5678 100644
--- a/bin/cab_locator_test.rb
+++ b/bin/cab_locator_test.rb
@@ -16,7 +16,7 @@
page = mech.get("#{domain}/locations")
-if page.body =~ /Find a face-to-face appointment location/
+if page.body =~ /Find an appointment location near you/
puts '> Renders location finder'
else
raise 'Should render location finder'
|
Update tests with new location header
|
diff --git a/db/migrate/20170413112512_fix_change_note_data_for_the_highway_code.rb b/db/migrate/20170413112512_fix_change_note_data_for_the_highway_code.rb
index abc1234..def5678 100644
--- a/db/migrate/20170413112512_fix_change_note_data_for_the_highway_code.rb
+++ b/db/migrate/20170413112512_fix_change_note_data_for_the_highway_code.rb
@@ -0,0 +1,62 @@+class FixChangeNoteDataForTheHighwayCode < Mongoid::Migration
+ def self.reset_change_note(section_slug, created_at)
+ SectionEdition.where(
+ slug: 'guidance/the-highway-code/' + section_slug,
+ created_at: created_at
+ ).each do |section_edition|
+ section_edition.update_attributes!(change_note: nil, minor_update: true)
+ edition_attributes = [
+ section_edition.id,
+ section_edition.title,
+ section_edition.created_at
+ ]
+ puts "Updated SectionEdition with attributes: #{edition_attributes.join(', ')}"
+ end
+ end
+
+ def self.up
+ created_at_0925 = Time.parse('2017-03-01 09:25:48')
+ created_at_1102 = Time.parse('2017-03-01 11:02:33')
+
+ reset_change_note 'road-users-requiring-extra-care-204-to-225',
+ created_at_0925
+ reset_change_note 'road-users-requiring-extra-care-204-to-225',
+ created_at_1102
+
+ reset_change_note 'signals-to-other-road-users',
+ created_at_0925
+ reset_change_note 'signals-to-other-road-users',
+ created_at_1102
+
+ reset_change_note 'signals-by-authorised-persons',
+ created_at_0925
+ reset_change_note 'signals-by-authorised-persons',
+ created_at_1102
+
+ reset_change_note 'road-markings',
+ created_at_0925
+ reset_change_note 'road-markings',
+ created_at_1102
+
+ reset_change_note 'vehicle-markings',
+ created_at_0925
+ reset_change_note 'vehicle-markings',
+ created_at_1102
+
+ reset_change_note 'annex-8-safety-code-for-new-drivers',
+ created_at_0925
+ reset_change_note 'annex-8-safety-code-for-new-drivers',
+ created_at_1102
+
+ # The annex-5-penalties don't have a SectionEdition created at 09:25.
+ # See https://github.com/alphagov/manuals-publisher/issues/861 for
+ # further information
+ reset_change_note 'annex-5-penalties',
+ created_at_1102
+ end
+
+ def self.down
+ # We've intentionally left this blank.
+ # While feasible to reconstruct the data we've decided against it given the time it'll take and that it's already bad data.
+ end
+end
|
Add migration to fix Highway Code change note data
This is the first part of the fix for the problem described in issue
#861.
There are unexpected updates listed for The Highway
Code[1] against 1 March 2017.
We expect to see "Annex 5 Penalties" with a single change described as
"Updated the penalty table to increase penalty points for using a
hand-held mobile phone when driving from 3 to 6.".
We're also seeing:
* Road users requiring extra care (204 to 225)
* Updated Rule 209 to add an image of the school bus road sign.
* Signals to other road users
* New section added.
* Signals by authorised persons
* New section added.
* Road markings
* New section added.
* Vehicle markings
* New section added.
* Annex 8. Safety code for new drivers
* Updated the Pass Plus email address to passplus@dvsa.gov.uk
For all the updates on 1 March 2017 we're seeing two identical change
notes, one with a timestamp of 2017-03-01T09:49:18Z and the other with a
timestamp of 2017-03-01T11:03:18Z.
The problem is due to duplicate "major update" `SectionEdition`s and
their change notes. The presence of these SectionEditions result in
"duplicate" `PublicationLog`s which are sent to the Publishing API as
change notes.
This migration updates the affected `SectionEdition`s to make them minor
changes and removes their changes notes.
We still need to rebuild the `PublicationLog`s and update the content in
the Publishing API but they will happen separately.
[1]: https://www.gov.uk/guidance/the-highway-code/updates
|
diff --git a/spec/balance_tags_c_extn_spec.rb b/spec/balance_tags_c_extn_spec.rb
index abc1234..def5678 100644
--- a/spec/balance_tags_c_extn_spec.rb
+++ b/spec/balance_tags_c_extn_spec.rb
@@ -1,4 +1,5 @@-require "spec_helper"
+$:.unshift File.dirname(__FILE__) # required, for some reason.
+require 'spec_helper'
$:.unshift File.dirname(__FILE__) + "/../ext/balance_tags_c"
require "balance_tags_c.so"
|
Add to so that require'ing spec_helper works
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -21,6 +21,8 @@ # specified here.
config.sequel.after_connect = proc do
+ Sequel::Model.db.extension :connection_validator
+ Sequel::Model.db.pool.connection_validation_timeout = -1
Sequel::Model.plugin :timestamps, update_on_create: true
Sequel::Model.plugin :validation_helpers
end
|
Use connection validation for pooled connections
This will address issues seen in production with RDS
closing connections to the database after a time (reasonably) and the
local application not correctly restoring them before use.
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -19,5 +19,8 @@ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
+ config.action_dispatch.default_headers = {
+ 'X-Frame-Options' => 'ALLOWALL'
+ }
end
-end
+end
|
Enable iframe support on Heroku rails
|
diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb
index abc1234..def5678 100644
--- a/spec/support/database_cleaner.rb
+++ b/spec/support/database_cleaner.rb
@@ -1,16 +1,6 @@ RSpec.configure do |config|
- config.before(:suite) do
+ config.before(:each) do
DatabaseCleaner.clean_with(:truncation)
Rails.application.load_seed
end
-
- config.before(:each) do |example|
- DatabaseCleaner.strategy = (example.metadata[:js] == true) ? :truncation : :transaction
- DatabaseCleaner.start
- end
-
- config.after(:each) do |example|
- DatabaseCleaner.clean
- Rails.application.load_seed if example.metadata[:js] == true
- end
end
|
Fix the Travis failures in rspec
|
diff --git a/test/apps/zoo/_init.rb b/test/apps/zoo/_init.rb
index abc1234..def5678 100644
--- a/test/apps/zoo/_init.rb
+++ b/test/apps/zoo/_init.rb
@@ -1,7 +1,6 @@ module Zoo
@description = ""
@version = 0.1
- @path = File.dirname(__FILE__)
include Spider::App
def self.test_setup
@@ -14,7 +13,4 @@
end
-require 'apps/zoo/models/animal'
-Zoo.models.each do |mod|
- mod.use_storage 'test'
-end+require 'apps/zoo/models/animal'
|
Use test storage for Zoo models
|
diff --git a/lib/cb/utils/validator.rb b/lib/cb/utils/validator.rb
index abc1234..def5678 100644
--- a/lib/cb/utils/validator.rb
+++ b/lib/cb/utils/validator.rb
@@ -1,52 +1,55 @@ require 'json'
-require 'xmlsimple'
+require 'nori'
module Cb
module ResponseValidator
+
+ class << self
+ def validate(response)
+ if response.nil? || response.response.body.nil?
+ return get_empty_json_hash
+ end
- def self.validate(response)
- if response.blank? || response.response.body.blank?
- return self.get_empty_json_hash
+ if response.code != 200
+ # we only handle json or xml responses - html means something bad happened
+ is_html = response.response.body.include?('<!DOCTYPE html')
+ return get_empty_json_hash if is_html
+ end
+
+ return get_empty_json_hash if response.response.body.nil?
+
+ # Try to parse response as JSON. Otherwise, return HTTParty-parsed XML
+ begin
+ json = JSON.parse(response.response.body)
+ json.keys.any? ? json : get_empty_json_hash
+ rescue JSON::ParserError
+ handle_parser_error(response.response.body)
+ end
end
- if response.code != 200
- # we only handle json or xml responses - html means something bad happened
- is_html = response.response.body.include?('<!DOCTYPE html')
- return self.get_empty_json_hash if is_html
+ def handle_parser_error(response_body)
+ begin
+ response_hash = XmlSimple.xml_in(response_body)
+ # Unless there was an error, return a hash from the xml
+ if response_hash.respond_to?(:has_key?) && response_hash.has_key?('Errors')
+ return get_empty_json_hash
+ else
+ return response_hash
+ end
+ rescue ArgumentError, REXML::ParseException
+ get_empty_json_hash
+ end
end
- begin
- json = JSON.parse(response.response.body)
- json.keys.any? ? json : self.get_empty_json_hash
- rescue JSON::ParserError
- self.handle_parser_error(response.response.body)
+ def get_empty_json_hash
+ Hash.new
+ end
+
+ def nori
+ @nori ||= Nori.new
end
end
-
- def self.handle_parser_error(response)
- # if it's not JSON, try XML
- begin
- xml = XmlSimple.xml_in(response)
- rescue ArgumentError, REXML::ParseException
- xml = nil
- end
-
- if xml.nil?
- # if i wasn't xml either, give up and return an empty json hash
- return self.get_empty_json_hash
- else
- # if it was, return a hash from the xml UNLESS it was a generic
- xml_hash = XmlSimple.xml_in(response)
- if xml_hash.has_key?('Errors')
- return self.get_empty_json_hash
- else
- return xml_hash
- end
- end
- end
-
- def self.get_empty_json_hash
- Hash.new
- end
+
+ # private_class_method :handle_parser_error, :get_empty_json_hash
end
end
|
Remove Nokogiri usage from validated response
|
diff --git a/lib/usaidwat/service.rb b/lib/usaidwat/service.rb
index abc1234..def5678 100644
--- a/lib/usaidwat/service.rb
+++ b/lib/usaidwat/service.rb
@@ -4,16 +4,17 @@ module Service
class RedditService
def user(username)
- data = {}
- %w{about comments submitted}.each do |page|
- url = "https://www.reddit.com/user/#{username}/#{page}.json"
- url += '?limit=100' if ['comments', 'submitted'].include?(page)
- data[page.to_sym] = get(url)
- end
+ data = %w{about comments submitted}.reduce({}) { |memo, obj| memo.update(obj.to_sym => get_page(username, obj)) }
USaidWat::Thing::User.new(username, data[:about], data[:comments], data[:submitted])
end
private
+
+ def get_page(username, page)
+ url = "https://www.reddit.com/user/#{username}/#{page}.json"
+ url += '?limit=100' if ['comments', 'submitted'].include?(page)
+ get(url)
+ end
def get(uri)
hdrs = {'User-Agent' => "usaidwat v#{USaidWat::VERSION}"}
|
Simplify hash-building code using reduce
|
diff --git a/lib/spot.rb b/lib/spot.rb
index abc1234..def5678 100644
--- a/lib/spot.rb
+++ b/lib/spot.rb
@@ -1,4 +1,4 @@-require 'pry'
+# require 'pry'
class Spot
attr_reader :possible
|
Comment out pry, for now...
|
diff --git a/lib/gitlab/ldap/person.rb b/lib/gitlab/ldap/person.rb
index abc1234..def5678 100644
--- a/lib/gitlab/ldap/person.rb
+++ b/lib/gitlab/ldap/person.rb
@@ -1,7 +1,7 @@ module Gitlab
module LDAP
class Person
- AD_USER_DISABLED = Net::LDAP::Filter.ex("userAccountControl:1.2.840.113556.1.4.803", 2)
+ AD_USER_DISABLED = Net::LDAP::Filter.ex("userAccountControl:1.2.840.113556.1.4.803", "2")
def self.find_by_uid(uid, adapter=nil)
adapter ||= Gitlab::LDAP::Adapter.new
|
Fix syntax error in AD disabled user filter
|
diff --git a/lib/hiraoyogi/database.rb b/lib/hiraoyogi/database.rb
index abc1234..def5678 100644
--- a/lib/hiraoyogi/database.rb
+++ b/lib/hiraoyogi/database.rb
@@ -16,7 +16,7 @@ private
def body_text(doc)
- doc.css("body").text.gsub(/\s/, "")
+ doc.css("body").text.gsub(/\n|\t/, "")
end
end
end
|
Remove \n and \t only instead of all whitespace characters
|
diff --git a/db/migrate/20160610190445_add_search_to_service_version.rb b/db/migrate/20160610190445_add_search_to_service_version.rb
index abc1234..def5678 100644
--- a/db/migrate/20160610190445_add_search_to_service_version.rb
+++ b/db/migrate/20160610190445_add_search_to_service_version.rb
@@ -2,7 +2,7 @@
def up
execute <<-SQL
- CREATE EXTENSION unaccent;
+ CREATE EXTENSION IF NOT EXISTS unaccent;
CREATE TEXT SEARCH CONFIGURATION es ( COPY = spanish );
ALTER TEXT SEARCH CONFIGURATION es ALTER MAPPING FOR hword, hword_part, word WITH unaccent, spanish_stem;
ALTER TABLE service_versions ADD COLUMN tsv tsvector;
|
Make migration add_search_to_service_version a bit more resilient
On production the extension might have been pre-installed, so we only install it
if it doesn't exist
|
diff --git a/lib/capybara_screenshot_idobata/dsl.rb b/lib/capybara_screenshot_idobata/dsl.rb
index abc1234..def5678 100644
--- a/lib/capybara_screenshot_idobata/dsl.rb
+++ b/lib/capybara_screenshot_idobata/dsl.rb
@@ -8,7 +8,7 @@
options = detect_default_option(Capybara.current_driver).merge(options)
- save_screenshot filename, options
+ screenshot_path = save_screenshot(filename, options)
absolute_filepath, line = caller[0].split(':')
@@ -16,7 +16,7 @@
source = CapybaraScreenshotIdobata.message_formatter.call(filepath, line, self)
- File.open(filename, 'rb') do |file|
+ File.open(screenshot_path, 'rb') do |file|
RestClient.post(CapybaraScreenshotIdobata.hook_url,
{
source: source,
|
Fix screenshot path using return value of `save_screenshot`
Since this commit (https://github.com/jnicklas/capybara/commit/75084c59),
`Capybara::Session#save_screenshot` depends on `Capybara.save_path` when
filename is a relative path.
Before:
`Pathname(Dir.pwd).join(filename)`
After:
`Pathname(Capybara.save_path).join(filename)`
If we call `save_screenshot_and_post_to_idobata` with a relative path (or
no arguments), `File.open(filename)` is failed to find a screenshot.
|
diff --git a/lib/pairwise/test_pair.rb b/lib/pairwise/test_pair.rb
index abc1234..def5678 100644
--- a/lib/pairwise/test_pair.rb
+++ b/lib/pairwise/test_pair.rb
@@ -1,25 +1,23 @@-#TODO: Array gives us too much extract specific behaviour required
+require 'forwardable'
+
module Pairwise
- class TestPair < Array
- attr_reader :p1_position
- attr_reader :p2_position
+ class TestPair
+ extend Forwardable
+
+ attr_reader :p1_position, :p2_position
+ attr_reader :p1, :p2
+
+ def_delegators :@pair, :+, :inspect, :==
def initialize(p1_position, p2_position, p1, p2)
+ @p1, @p2 = p1, p2
@p1_position, @p2_position = p1_position, p2_position
- super([p1, p2])
+ @pair = [@p1, @p2]
end
- def p1
- self[0]
- end
-
- def p2
- self[1]
- end
-
- def covered_by?(pair_2)
- pair_2[@p1_position] == self[0] &&
- pair_2[@p2_position] == self[1]
+ def covered_by?(test_pair)
+ test_pair[@p1_position] == @p1 &&
+ test_pair[@p2_position] == @p2
end
end
|
Replace array subclass with forwardable for just the methods we want
|
diff --git a/lib/prospector/railtie.rb b/lib/prospector/railtie.rb
index abc1234..def5678 100644
--- a/lib/prospector/railtie.rb
+++ b/lib/prospector/railtie.rb
@@ -3,5 +3,9 @@ config.after_initialize do
Background.enqueue unless Object.const_defined?('Rake')
end
+
+ rake_tasks do
+ require File.expand_path('../tasks', __FILE__)
+ end
end
end
|
Include rake tasks automatically in Rails
|
diff --git a/spec/space2dot_spec.rb b/spec/space2dot_spec.rb
index abc1234..def5678 100644
--- a/spec/space2dot_spec.rb
+++ b/spec/space2dot_spec.rb
@@ -5,4 +5,9 @@ expect(Space2dot.convert(['fuga hoge foo'])).to include('.') # String case
expect(Space2dot.convert(%w(fuga hoge foo))).to include('.') # Array case
end
+
+ it 'returns dot included in string in beginning of line' do
+ expect(Space2dot.convert(['fuga hoge foo'])[0]).to eq('.')
+ expect(Space2dot.convert(%w(fuga hoge foo))[0]).to eq('.')
+ end
end
|
Modify config for use in tmuxinator
|
diff --git a/lib/guard/notifiers/git_auto_commit.rb b/lib/guard/notifiers/git_auto_commit.rb
index abc1234..def5678 100644
--- a/lib/guard/notifiers/git_auto_commit.rb
+++ b/lib/guard/notifiers/git_auto_commit.rb
@@ -29,8 +29,8 @@ def notify(type, title, message, image, options = { })
commit_message = [type, title, message].join(' ').gsub(/\r|\n/, '')
commit_message << "\n\n"
+ system("git add -u")
commit_message << `git diff --cached`
- system("git add -u")
File.popen("git commit -F -", "r+") do |fd|
fd.write commit_message
fd.close
|
Create commit message diff after staging changes
|
diff --git a/lib/konacha-chai-matchers/collector.rb b/lib/konacha-chai-matchers/collector.rb
index abc1234..def5678 100644
--- a/lib/konacha-chai-matchers/collector.rb
+++ b/lib/konacha-chai-matchers/collector.rb
@@ -30,10 +30,14 @@ @libs ||= urls.each_with_index.map do |url, i|
name = paths[i]
`cd ./#{name} && git fetch && cd ..`
+ `cd ./#{name} && git fetch --tags && cd ..`
latest_tag = `cd ./#{name} && git describe --tags --abbrev=0 && cd ..`.split.first
- library_tag = locked_versions[name] || latest_tag
+ library_tag = latest_tag
+ library_tag = locked_versions[name] if locked_versions.key? name
latest_commit = `cd ./#{name} && git rev-parse #{library_tag || 'HEAD'} && cd ..`.split.first
+
+ $stdout.puts "*** #{name} tag: #{latest_tag.inspect}, using: #{library_tag.inspect} commit: #{latest_commit}"
Library.new url: url, name: name, tag: library_tag, commit: latest_commit
end
|
Add output for versions to use
|
diff --git a/lib/omniauth/strategies/remote_user.rb b/lib/omniauth/strategies/remote_user.rb
index abc1234..def5678 100644
--- a/lib/omniauth/strategies/remote_user.rb
+++ b/lib/omniauth/strategies/remote_user.rb
@@ -12,6 +12,7 @@ end
def request_phase
+ @user_data = {}
@uid = validate_remote_user
return fail!(:no_remote_user) unless @uid
@@ -27,7 +28,7 @@
uid { @uid['EMAIL'] }
info{ @user_data }
-
+
end
end
end
|
Initialize @user_data like a hash
|
diff --git a/lib/spree_i18n/railtie.rb b/lib/spree_i18n/railtie.rb
index abc1234..def5678 100644
--- a/lib/spree_i18n/railtie.rb
+++ b/lib/spree_i18n/railtie.rb
@@ -5,7 +5,7 @@ pattern = pattern_from app.config.i18n.available_locales
add("config/locales/#{pattern}/*.{rb,yml}")
- add("config/locales/*.{rb,yml}")
+ add("config/locales/#{pattern}.{rb,yml}")
end
end
|
Change to load necessary locale files
|
diff --git a/lib/tasks/refresh_wysiwyg_content.rake b/lib/tasks/refresh_wysiwyg_content.rake
index abc1234..def5678 100644
--- a/lib/tasks/refresh_wysiwyg_content.rake
+++ b/lib/tasks/refresh_wysiwyg_content.rake
@@ -31,9 +31,13 @@ )
end
+ template = File.read('lib/assets/privacy_policy_page.json')
Page.where(uri: 'privacy-policy').where.not(site_id: nil).each do |page|
- template = File.read('lib/assets/privacy_policy_page.json')
page.update(content: template)
+ end
+
+ PageTemplate.joins(:pages_site_templates).where(uri: 'privacy-policy').each do |page_template|
+ page_template.update(content: template)
end
end
end
|
Fix privacy policy page for new sites
|
diff --git a/lib/tasks/curriculum.rake b/lib/tasks/curriculum.rake
index abc1234..def5678 100644
--- a/lib/tasks/curriculum.rake
+++ b/lib/tasks/curriculum.rake
@@ -8,14 +8,12 @@ namespace :content do
desc 'Import all lessons content from GitHub'
task import: :environment do
- Rails.logger.info 'Importing lesson content...'
+ progressbar = ProgressBar.create total: Lesson.count, format: '%t: |%w%i| Completed: %c %a %e'
- Lesson.all.each_with_index do |lesson, i|
- Rails.logger.info "Importing #{i + 1}/#{Lesson.count}: #{lesson.title}"
+ Lesson.all.each do |lesson|
lesson.import_content_from_github
+ progressbar.increment
end
-
- Rails.logger.info 'Lesson content import complete.'
end
desc 'Verify that all lessons have content'
|
Chore: Add Progress Bar to Curriculum Import Task
Because:
* It provides a nicer visual representation of the import progress.
|
diff --git a/lib/tasks/javascript.rake b/lib/tasks/javascript.rake
index abc1234..def5678 100644
--- a/lib/tasks/javascript.rake
+++ b/lib/tasks/javascript.rake
@@ -14,4 +14,16 @@ system "yarn test"
end
end
+
+ if ENV["REMOVE_JS_BUILD_YARN_INSTALL"] == "true"
+ Rake::Task["javascript:build"].clear
+
+ desc "Build your JavaScript bundle"
+ task :build do # rubocop:disable Rails/RakeEnvironment
+ unless system("yarn build")
+ raise "jsbundling-rails: Command build failed, " \
+ "ensure yarn is installed and `yarn build` runs without errors"
+ end
+ end
+ end
end
|
Add option to remove yarn install from the JavaScript build task.
When deploying with a Node.js buildpack, the dependencies will already be
installed making this call redundant. The ability to remove it will speed up
deployments.
|
diff --git a/lib/tasks/submodules.rake b/lib/tasks/submodules.rake
index abc1234..def5678 100644
--- a/lib/tasks/submodules.rake
+++ b/lib/tasks/submodules.rake
@@ -7,17 +7,17 @@ sha, repo, branch = commit_info.split(' ')
case sha[0,1]
when '+'
- $stderr.puts "Warning: Currently checked out submodule commit for #{repo}"
+ $stderr.puts "Error: Currently checked out submodule commit for #{repo}"
$stderr.puts "does not match the commit expected by this version of Alaveteli."
$stderr.puts "You can update it with 'git submodule update'."
exit(1)
when '-'
- $stderr.puts "Warning: Submodule #{repo} needs to be initialized."
+ $stderr.puts "Error: Submodule #{repo} needs to be initialized."
$stderr.puts "You can do this by running 'git submodule update --init'."
exit(1)
when 'U'
- $stderr.puts "Warning: Submodule #{repo} has merge conflicts."
- $stderr.puts "You'll probably need to resolve these to run Alaveteli."
+ $stderr.puts "Error: Submodule #{repo} has merge conflicts."
+ $stderr.puts "You'll need to resolve these to run Alaveteli."
exit(1)
else
exit(0)
|
Call it an error, not a warning.
|
diff --git a/lib/time_for_a_boolean.rb b/lib/time_for_a_boolean.rb
index abc1234..def5678 100644
--- a/lib/time_for_a_boolean.rb
+++ b/lib/time_for_a_boolean.rb
@@ -5,15 +5,15 @@ require "time_for_a_boolean/railtie"
module TimeForABoolean
- def time_for_a_boolean(attribute, field="#{attribute}_at")
+ def time_for_a_boolean(attribute, field=:"#{attribute}_at")
define_method(attribute) do
!send(field).nil? && send(field) <= -> { Time.current }.()
end
- alias_method "#{attribute}?", attribute
+ alias_method :"#{attribute}?", attribute
- setter_attribute = "#{field}="
- define_method("#{attribute}=") do |value|
+ setter_attribute = :"#{field}="
+ define_method(:"#{attribute}=") do |value|
if ActiveModel::Type::Boolean::FALSE_VALUES.include?(value)
send(setter_attribute, nil)
else
@@ -21,8 +21,8 @@ end
end
- define_method("#{attribute}!") do
- send(setter_attribute, -> { Time.current }.())
+ define_method(:"#{attribute}!") do
+ send(:"#{attribute}=", true)
end
end
end
|
Use attribute = true instead of duplicating that
|
diff --git a/test/rb/core/test_backwards_compatability.rb b/test/rb/core/test_backwards_compatability.rb
index abc1234..def5678 100644
--- a/test/rb/core/test_backwards_compatability.rb
+++ b/test/rb/core/test_backwards_compatability.rb
@@ -5,28 +5,8 @@ class TestTException < Test::Unit::TestCase
def test_has_accessible_message
msg = "hi there thrift"
- assert_equal msg, TException.new(msg).message
+ assert_equal msg, Thrift::Exception.new(msg).message
end
end
-class TestConstRemapping < Test::Unit::TestCase
- def test_remappings
- maps = {
- TException => Thrift::Exception,
- TApplicationException => Thrift::ApplicationException,
- TType => Thrift::Types,
- TMessageType => Thrift::MessageTypes,
- TProcessor => Thrift::Processor,
- ThriftClient => Thrift::Client,
- ThriftStruct => Thrift::Struct,
- TProtocol => Thrift::Protocol,
- TProtocolException => Thrift::ProtocolException
- }
-
- maps.each do |k, v|
- assert_equal k, v
- end
- end
-end
-
|
Remove test_remappings because it isn't comprehensive and it's triggering undesired warnings. This should be re-created as a spec.
git-svn-id: 8d8e29b1fb681c884914062b88f3633e3a187774@668936 13f79535-47bb-0310-9956-ffa450edef68
|
diff --git a/windowstate.gemspec b/windowstate.gemspec
index abc1234..def5678 100644
--- a/windowstate.gemspec
+++ b/windowstate.gemspec
@@ -21,5 +21,6 @@ ]
s.add_dependency "windows-pr", "~> 1.2"
+ s.add_dependency "trollop", "~> 1"
s.add_development_dependency "ocra", "~> 1.3"
end
|
Fix trollop dependency in gemspec
|
diff --git a/repo.rb b/repo.rb
index abc1234..def5678 100644
--- a/repo.rb
+++ b/repo.rb
@@ -15,6 +15,15 @@ end
end
-100_000.times do |i|
+str = []
+
+1000.times do
+ str << Array.new(10_000, "a").map { |i| "b" }.join * 10
+ str.pop
+end
+
+5000.times do |i|
+ str << Array.new(10_000, "a").map { |i| "b" }.join * 10
+ str.pop
File.open("tmp/#{i}.txt") { |f| puts "Opened tmp/#{i}.txt: #{f.read}" }
end
|
Add more work to increase the chance of triggering GC
|
diff --git a/rack-zip.gemspec b/rack-zip.gemspec
index abc1234..def5678 100644
--- a/rack-zip.gemspec
+++ b/rack-zip.gemspec
@@ -9,4 +9,7 @@
spec.add_runtime_dependency 'rack'
spec.add_runtime_dependency 'zipruby'
+
+ spec.add_development_dependency 'test-unit'
+ spec.add_development_dependency 'test-unit-notify'
end
|
Add testing frameworks to dependencies
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -9,8 +9,6 @@ get "/:email/:order_numbers" do
content_type "application/json"
- response["Access-Control-Allow-Origin"] = "*"
-
{ orders: orders }.to_json
end
|
Remove ACAO; we are accessing from the same server
|
diff --git a/sample/lib/spree_sample.rb b/sample/lib/spree_sample.rb
index abc1234..def5678 100644
--- a/sample/lib/spree_sample.rb
+++ b/sample/lib/spree_sample.rb
@@ -24,7 +24,6 @@ Spree::Sample.load_sample("assets")
Spree::Sample.load_sample("orders")
- Spree::Sample.load_sample("line_items")
Spree::Sample.load_sample("adjustments")
Spree::Sample.load_sample("payments")
end
|
[sample] Remove line items loading, as that's now done with the order creation
|
diff --git a/Casks/keyspan-usa-19hs.rb b/Casks/keyspan-usa-19hs.rb
index abc1234..def5678 100644
--- a/Casks/keyspan-usa-19hs.rb
+++ b/Casks/keyspan-usa-19hs.rb
@@ -0,0 +1,18 @@+cask 'keyspan-usa-19hs' do
+ version '4'
+ sha256 '9a07a07d10c3cee5ea1cf3e67b091c30b26a7e24959602b258ae8060a7bf6ce3'
+
+ url "http://www.tripplite.com/shared/software/Driver/USA-19HS-Driver-v#{version}-Mac-OS-X-10.9-10.11.zip"
+ name 'Keyspan USA-19HS High-Speed USB-to-Serial Adapter Driver'
+ homepage 'http://www.tripplite.com/keyspan-high-speed-usb-to-serial-adapter~USA19HS/'
+
+ depends_on macos: '>= :mavericks'
+
+ pkg "USA-19HSdrvr_10.9_10.10_10.11_v#{version}_signed.pkg"
+
+ uninstall kext: 'com.keyspan.iokit.usb.KeyspanUSAdriver',
+ pkgutil: [
+ 'com.keyspan.iokit.keyspanusadrvr',
+ 'com.keyspan.iokit.usb.KeyspanUSAdriver',
+ ]
+end
|
Add Keyspan USA-19HS v4 Drivers
|
diff --git a/test/extra/checking/checks/test_html.rb b/test/extra/checking/checks/test_html.rb
index abc1234..def5678 100644
--- a/test/extra/checking/checks/test_html.rb
+++ b/test/extra/checking/checks/test_html.rb
@@ -6,7 +6,7 @@ with_site do |site|
# Create files
FileUtils.mkdir_p('output')
- File.open('output/blah.html', 'w') { |io| io.write('<!DOCTYPE html><html><head><title>Hello</title></head><body><h1>Hi!</h1></body>') }
+ File.open('output/blah.html', 'w') { |io| io.write('<!DOCTYPE html><html><head><meta charset="utf-8"><title>Hello</title></head><body><h1>Hi!</h1></body>') }
File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
# Run check
|
Add necessary charset to HTML check test
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.