diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/features/support/paths.rb b/features/support/paths.rb index abc1234..def5678 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -27,7 +27,9 @@ when /^a member's page$/ @member = @organisation.members.active.last member_path(@member) - + when /^the members page$/ + members_path + # Add more mappings here. # Here is an example that pulls values out of the Regexp: #
Add a new cucumber path 'the members page' => members_path.
diff --git a/business.gemspec b/business.gemspec index abc1234..def5678 100644 --- a/business.gemspec +++ b/business.gemspec @@ -23,5 +23,5 @@ spec.add_development_dependency "gc_ruboconfig", "~> 2.25.0" spec.add_development_dependency "rspec", "~> 3.1" spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1" - spec.add_development_dependency "rubocop", "~> 1.18.0" + spec.add_development_dependency "rubocop", "~> 1.19.1" end
Update rubocop requirement from ~> 1.18.0 to ~> 1.19.1 Updates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.18.0...v1.19.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development ... Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@github.com>
diff --git a/business.gemspec b/business.gemspec index abc1234..def5678 100644 --- a/business.gemspec +++ b/business.gemspec @@ -19,7 +19,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_development_dependency "gc_ruboconfig", "~> 3.2.0" + spec.add_development_dependency "gc_ruboconfig", "~> 3.3.0" spec.add_development_dependency "rspec", "~> 3.1" spec.add_development_dependency "rspec_junit_formatter", "~> 0.5.1" spec.add_development_dependency "rubocop", "~> 1.30.0"
Update gc_ruboconfig requirement from ~> 3.2.0 to ~> 3.3.0 Updates the requirements on [gc_ruboconfig](https://github.com/gocardless/ruboconfig) to permit the latest version. - [Release notes](https://github.com/gocardless/ruboconfig/releases) - [Changelog](https://github.com/gocardless/gc_ruboconfig/blob/master/CHANGELOG.md) - [Commits](https://github.com/gocardless/ruboconfig/commits/v3.3.0) --- updated-dependencies: - dependency-name: gc_ruboconfig dependency-type: direct:development ... Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@github.com>
diff --git a/spec/command_parser_spec.rb b/spec/command_parser_spec.rb index abc1234..def5678 100644 --- a/spec/command_parser_spec.rb +++ b/spec/command_parser_spec.rb @@ -41,7 +41,7 @@ end end - describe '#fize' do + describe '#fire' do it 'fires a bullet' do command_parser.fire
Fix a typo in the spec
diff --git a/spec/multibuildpack_spec.rb b/spec/multibuildpack_spec.rb index abc1234..def5678 100644 --- a/spec/multibuildpack_spec.rb +++ b/spec/multibuildpack_spec.rb @@ -4,7 +4,7 @@ it "works with node" do Hatchet::Runner.new("node_multi", buildpack_url: "https://github.com/ddollar/heroku-buildpack-multi.git").deploy do |app| puts app.output - expect(app.output).to match("Node Version in Ruby buildpack is: v0.10.3") + expect(app.output).to match("Node Version in Ruby buildpack is: v4.1.2") end end end
Use non default node version for tests Previously we were checking for a custom version that coincidentally matched the default version of node that the ruby buildpack was using. This was a mistake and not noticed when the default version was rev-d. The fixture has been updated to use 4.1.2.
diff --git a/spec/routing/broker_spec.rb b/spec/routing/broker_spec.rb index abc1234..def5678 100644 --- a/spec/routing/broker_spec.rb +++ b/spec/routing/broker_spec.rb @@ -1,10 +1,65 @@ require 'spec_helper' describe 'routing to the broker dashboard' do - it 'routes /broker/dashboard to broker/dashboard#index' do + it 'routes /broker/dashboard to broker/dashboard#show' do expect(get: '/broker/dashboard').to route_to( controller: 'broker/dashboards', action: 'show' ) end end + +describe 'routing to the broker provider management' do + it 'routes /broker/providers to broker/providers#index' do + expect(get: '/broker/providers').to route_to( + controller: 'broker/providers', + action: 'index' + ) + end + + it 'routes /broker/providers/new to broker/providers#new' do + expect(get: '/broker/providers/new').to route_to( + controller: 'broker/providers', + action: 'new' + ) + end + + it 'routes posting to /broker/providers to broker/providers#create' do + expect(post: '/broker/providers').to route_to( + controller: 'broker/providers', + action: 'create' + ) + end + + it 'routes /broker/providers/12 to broker/providers#show' do + expect(get: '/broker/providers/12').to route_to( + controller: 'broker/providers', + action: 'show', + id: '12' + ) + end + + it 'routes /broker/providers/12/edit to broker/providers#edit' do + expect(get: '/broker/providers/12/edit').to route_to( + controller: 'broker/providers', + action: 'edit', + id: '12' + ) + end + + it 'routes patching to /broker/providers/12 to broker/providers#update' do + expect(patch: '/broker/providers/12').to route_to( + controller: 'broker/providers', + action: 'update', + id: '12' + ) + end + + it 'routes deleting to /broker/providers/12 to broker/providers#destroy' do + expect(delete: '/broker/providers/12').to route_to( + controller: 'broker/providers', + action: 'destroy', + id: '12' + ) + end +end
Add broker provider routing spec.
diff --git a/ext/mecaby/extconf.rb b/ext/mecaby/extconf.rb index abc1234..def5678 100644 --- a/ext/mecaby/extconf.rb +++ b/ext/mecaby/extconf.rb @@ -7,4 +7,4 @@ have_func('mecab_model_new', %[mecab.h]) -create_makefile('mecaby') +create_makefile('mecaby/mecaby')
Fix the path of extension library file
diff --git a/lib/days/app.rb b/lib/days/app.rb index abc1234..def5678 100644 --- a/lib/days/app.rb +++ b/lib/days/app.rb @@ -21,14 +21,45 @@ }) set(:config, nil) + set :method_override, true + + configure :production, :development do + enable :sessions + end + + helpers do + def logged_in? + !!session[:user_id] + end + end + + set :admin_only do |_| + condition do + unless logged_in? + halt 401 + end + end + end class << self alias environment_orig= environment= def environment=(x) - environment_orig = x + self.environment_orig = x Config.namespace x.to_s + x + end + + alias config_orig= config= + def config=(x) + self.config_orig = x + self.set :session_secret, config['session_secret'] || 'jjiw-jewn-n2i9-nc1e_binding.pry-is-good' x end end end end + +Dir["#{File.dirname(__FILE__)}/app/**/*.rb"].each do |f| + require f +end +
Enable session and condition for admin_only
diff --git a/command_line/dash_upper_c_spec.rb b/command_line/dash_upper_c_spec.rb index abc1234..def5678 100644 --- a/command_line/dash_upper_c_spec.rb +++ b/command_line/dash_upper_c_spec.rb @@ -3,7 +3,7 @@ describe 'The -C command line option' do before :all do @script = fixture(__FILE__, 'dash_upper_c_script.rb') - @tempdir = File.dirname(@script) + @tempdir = File.realpath(File.dirname(@script)) end it 'changes the PWD when using a file' do
Resolve realpath to fixture directory in -C spec * Fixes #84.
diff --git a/examples/sprinkle/sprinkle.rb b/examples/sprinkle/sprinkle.rb index abc1234..def5678 100644 --- a/examples/sprinkle/sprinkle.rb +++ b/examples/sprinkle/sprinkle.rb @@ -9,7 +9,7 @@ package :sprinkle do description 'Sprinkle Provisioning Tool' - gem 'sprinkle' do + gem 'crafterm-sprinkle' do source 'http://gems.github.com' # use alternate gem server #repository '/opt/local/gems' # specify an alternate local gem repository end
Update gem name since example uses the github gem server
diff --git a/config/initializers/urlhelpers.rb b/config/initializers/urlhelpers.rb index abc1234..def5678 100644 --- a/config/initializers/urlhelpers.rb +++ b/config/initializers/urlhelpers.rb @@ -1,7 +1,6 @@ module Oauth2Provider module ApplicationHelper def method_missing method, *args, &block - puts "LOOKING FOR ROUTES #{method}" if method.to_s.end_with?('_path') or method.to_s.end_with?('_url') if main_app.respond_to?(method) main_app.send(method, *args) @@ -25,4 +24,4 @@ end end end -end+end
Remove call to 'puts' left behind.
diff --git a/lib/work_dir.rb b/lib/work_dir.rb index abc1234..def5678 100644 --- a/lib/work_dir.rb +++ b/lib/work_dir.rb @@ -2,6 +2,7 @@ require 'work_dir/base' require 'work_dir/repo' require 'work_dir/website' +require 'work_dir/phantom' # Top-level module for work dir module WorkDir @@ -36,5 +37,9 @@ def website(*args) Website.new(*args) end + + def phantom(*args) + Phantom.new(*args) + end end end
Add phantom to work dir
diff --git a/lib/engineyard-serverside-adapter/version.rb b/lib/engineyard-serverside-adapter/version.rb index abc1234..def5678 100644 --- a/lib/engineyard-serverside-adapter/version.rb +++ b/lib/engineyard-serverside-adapter/version.rb @@ -1,7 +1,7 @@ module EY module Serverside class Adapter - VERSION = "2.2.1" + VERSION = "2.2.2.pre" end end end
Add .pre for next release
diff --git a/lib/rubaidh/authentication/users_controller_mixin.rb b/lib/rubaidh/authentication/users_controller_mixin.rb index abc1234..def5678 100644 --- a/lib/rubaidh/authentication/users_controller_mixin.rb +++ b/lib/rubaidh/authentication/users_controller_mixin.rb @@ -4,7 +4,7 @@ def self.included(controller) controller.send(:include, InstanceMethods) controller.class_eval do - skip_before_filter :login_required, :only => [:show, :new, :create] + skip_before_filter :login_required, :only => [:show, :new, :create, :activate] end end @@ -34,6 +34,25 @@ end end end + + def activate + @user = User.find_by_activation_code(params[:activation_code]) + respond_to do |format| + if @user.present? && @user.activate + self.current_user = @user + format.html do + flash[:notice] = "Account successfully activated, thank you" + redirect_to(root_url) + end + else + format.html do + flash[:error] = "There was an error activating your account." + redirect_to(new_session_url) + end + end + end + end + end end end
Add activate method to the users controller mixin
diff --git a/money.rb b/money.rb index abc1234..def5678 100644 --- a/money.rb +++ b/money.rb @@ -1,5 +1,9 @@+require './exchange' + class Money attr_accessor :value, :currency + + @exchange = Exchange.new def initialize(value, currency) @value, @currency = value, currency @@ -14,6 +18,8 @@ end class << self + attr_accessor :exchange + %w(usd eur gbp).each do |currency| define_method("from_#{ currency }") do |value| new(value, currency.upcase)
Create exchange object in Money class
diff --git a/SwiftyChardet.podspec b/SwiftyChardet.podspec index abc1234..def5678 100644 --- a/SwiftyChardet.podspec +++ b/SwiftyChardet.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| - s.platform = :ios s.ios.deployment_target = "8.0" + s.osx.deployment_target = "10.10" s.name = "SwiftyChardet" - s.version = "1.0.0" + s.version = "1.0.1" s.summary = "SwiftyChardet try to detect the correct encoding from an NSData instance." s.homepage = "https://github.com/agilewalker/SwiftyChardet" s.license = { :type => "GPL", :file => "LICENSE" } s.author = { "agilewalker" => "wuhuiyuan@gmail.com" } - s.source = { :git => "https://github.com/agilewalker/SwiftyChardet.git", :tag => "1.0.0" } + s.source = { :git => "https://github.com/agilewalker/SwiftyChardet.git", :tag => "1.0.1" } s.source_files = "SwiftyChardet/**/*.{swift}" end
Update deployment target for OSX
diff --git a/db/migrate/20171108153515_add_info_about_last_transfer_request_on_balance.rb b/db/migrate/20171108153515_add_info_about_last_transfer_request_on_balance.rb index abc1234..def5678 100644 --- a/db/migrate/20171108153515_add_info_about_last_transfer_request_on_balance.rb +++ b/db/migrate/20171108153515_add_info_about_last_transfer_request_on_balance.rb @@ -0,0 +1,50 @@+class AddInfoAboutLastTransferRequestOnBalance < ActiveRecord::Migration + def up + execute %Q{ +CREATE OR REPLACE VIEW "1".balances as + select + id as user_id, + balance.amount as amount, + last_transfer.amount as last_transfer_amount, + last_transfer.created_at as last_transfer_created_at, + last_transfer.in_period_yet + from public.users u + left join lateral ( + SELECT sum(bt.amount) AS amount + FROM balance_transactions bt + WHERE bt.user_id = u.id + ) as balance on true + left join lateral ( + select + (bt.amount * -1) as amount, + bt.created_at, + (to_char(bt.created_at, 'MM/YYY') = to_char(now(), 'MM/YYY')) as in_period_yet + from balance_transactions bt + where bt.user_id = u.id + and bt.event_name in ('balance_transfer_request', 'balance_transfer_project') + and not exists ( + select true + from balance_transactions bt2 + where bt2.user_id = u.id + and bt2.created_at > bt.created_at + and bt2.event_name = 'balance_transfer_error' + ) + order by bt.created_at desc + limit 1 + ) as last_transfer on true + where is_owner_or_admin(u.id); +} + end + + def down + execute %Q{ +drop view "1".balances; +CREATE OR REPLACE VIEW "1"."balances" AS + SELECT bt.user_id, + sum(bt.amount) AS amount + FROM balance_transactions bt + WHERE is_owner_or_admin(bt.user_id) + GROUP BY bt.user_id; +} + end +end
Change balances to use last last transaction request
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -2,4 +2,4 @@ require 'bundler/setup' Bundler.require(:default) -run Rack::Jekyll.new(:destination => '_site') +run Rack::Jekyll.new
Remove needless destination option in Jekyll.new
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index abc1234..def5678 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -5,7 +5,7 @@ class HomeController < ApplicationController def index - transport = Thrift::FramedTransport.new(Thrift::Socket.new('localhost', 9090)) + transport = Thrift::FramedTransport.new(Thrift::Socket.new('127.0.0.1', 9090)) protocol = Thrift::BinaryProtocol.new(transport) client = Recommender::Client.new(protocol)
Use 127.0.0.1 instead of localhost to appease Mac OS For some unknown reason, this works perfectly with 127.0.0.1 but doesn't work with localhost. Eh?
diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index abc1234..def5678 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -7,6 +7,6 @@ @events = Event.find(:all, :conditions => { :project_id => @projects }, :order => "created_at DESC") - @meetings = Meeting.find(:all, :conditions => ["start_time > ? and project_id in (?)", Time.now, @projects]) + @meetings = Meeting.find(:all, :conditions => ["start_time > ? and project_id in (?)", Time.now, @projects], :order => 'start_time') end end
Order the meeting in dashboard
diff --git a/rack-zippy.gemspec b/rack-zippy.gemspec index abc1234..def5678 100644 --- a/rack-zippy.gemspec +++ b/rack-zippy.gemspec @@ -14,7 +14,7 @@ gem.license = 'MIT' gem.files = `git ls-files`.split($/) - gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + gem.executables = [] gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] end
Configure gem to have no executables
diff --git a/github-pages.gemspec b/github-pages.gemspec index abc1234..def5678 100644 --- a/github-pages.gemspec +++ b/github-pages.gemspec @@ -4,9 +4,9 @@ s.name = "github-pages" s.version = "0.0.1" - s.summary = "GitHub Pages" - s.description = "Bootstrap the GitHub Pages Jekyll environment locally" s.authors = "GitHub" + s.summary = "Track GitHub Pages dependencies." + s.description = "Bootstrap the GitHub Pages Jekyll environment locally." s.email = "support@github.com" s.homepage = "http://pages.github.com" s.license = "MIT"
Use complete sentences for summary and description
diff --git a/recipes/drivers.rb b/recipes/drivers.rb index abc1234..def5678 100644 --- a/recipes/drivers.rb +++ b/recipes/drivers.rb @@ -11,9 +11,13 @@ node['drivers'].each do |pkg| windev_install_driver pkg["name"] do - source pkg["source"] + if pkg["save_as"] + source pkg["source"] + cache "depot"=>node["software_depot"],"save_as"=>pkg["save_as"] + else + source "#{node['software_depot']}/#{pkg["source"]}" + end version pkg["version"] - cache "depot"=>node["software_depot"],"save_as"=>pkg["save_as"] certificate pkg["certificate"] end end
Allow use of depot-ed driver packages (fixes #6)
diff --git a/recipes/initial.rb b/recipes/initial.rb index abc1234..def5678 100644 --- a/recipes/initial.rb +++ b/recipes/initial.rb @@ -13,6 +13,12 @@ mode 0777 end +# Remove ruby 1.8.7 installation +if platform?("ubuntu", "debian") + package 'ruby1.8' do + action :purge + end +end # 1. Packages / Dependencies include_recipe "apt" if platform?("ubuntu", "debian")
Purge old ruby version before starting.
diff --git a/sunlight-congress.gemspec b/sunlight-congress.gemspec index abc1234..def5678 100644 --- a/sunlight-congress.gemspec +++ b/sunlight-congress.gemspec @@ -19,6 +19,7 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.3" + spec.add_development_dependency "minitest" spec.add_development_dependency "rake" spec.add_development_dependency "webmock" end
Add minitest as a development dependency for 1.8 compat
diff --git a/lib/chunky_png/canvas/data_url_importing.rb b/lib/chunky_png/canvas/data_url_importing.rb index abc1234..def5678 100644 --- a/lib/chunky_png/canvas/data_url_importing.rb +++ b/lib/chunky_png/canvas/data_url_importing.rb @@ -10,7 +10,7 @@ # @raise ChunkyPNG::SignatureMismatch if the provides string is not a properly # formatted PNG data URL (i.e. it should start with "data:image/png;base64,") def from_data_url(string) - if string =~ %r[^data:image/png;base64,((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=))$] + if string =~ %r[^data:image/png;base64,((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?)$] from_blob($1.unpack('m').first) else raise SignatureMismatch, "The string was not a properly formatted data URL for a PNG image."
Allow importing base64 strings without "=" padding.
diff --git a/lib/generators/comment/templates/comment.rb b/lib/generators/comment/templates/comment.rb index abc1234..def5678 100644 --- a/lib/generators/comment/templates/comment.rb +++ b/lib/generators/comment/templates/comment.rb @@ -12,4 +12,7 @@ # NOTE: Comments belong to a user belongs_to :user + + # NOTE: For Mass Assignment Security + attr_accessible :title, :comment end
Fix for Mass Assigment Security
diff --git a/lib/generators/spree/site/site_generator.rb b/lib/generators/spree/site/site_generator.rb index abc1234..def5678 100644 --- a/lib/generators/spree/site/site_generator.rb +++ b/lib/generators/spree/site/site_generator.rb @@ -5,16 +5,14 @@ class SiteGenerator < Rails::Generators::Base class_option :auto_accept, :type => :boolean, :default => false, :aliases => '-A', :desc => "Answer yes to all prompts" - def deprecated - puts ActiveSupport::Deprecation.warn "rails g spree:site is deprecated and may be removed from future releases, use rails g spree:install instead." - end - def run_install_generator if options[:auto_accept] Spree::InstallGenerator.start ["--auto-accept"] else Spree::InstallGenerator.start end + + puts ActiveSupport::Deprecation.warn "rails g spree:site has been deprecated and will be removed in the future, use rails g spree:install instead." end end end
Use highline for spree:install prompts
diff --git a/qbwc_requests.gemspec b/qbwc_requests.gemspec index abc1234..def5678 100644 --- a/qbwc_requests.gemspec +++ b/qbwc_requests.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "qbxml", "~> 0.3.0" + spec.add_runtime_dependency "qbxml", "~> 0.4.0" spec.add_runtime_dependency "activemodel", ">= 4" spec.add_development_dependency "colorize", "~> 0.7.7" spec.add_development_dependency "bundler", "~> 1.3"
Update qbxml to version 0.4.0
diff --git a/research/interface.rb b/research/interface.rb index abc1234..def5678 100644 --- a/research/interface.rb +++ b/research/interface.rb @@ -0,0 +1,7 @@+links.each do |link| + link.page_source.to_nokogiri.css(selector).xpath(selector).each do |url| + url.css(s1).xpath(s2).each do |image_link| + image_link.to_s.download to: 'images' + end + end +end
Add idea that helped shape the gem UI
diff --git a/app/models/coursewareable/asset.rb b/app/models/coursewareable/asset.rb index abc1234..def5678 100644 --- a/app/models/coursewareable/asset.rb +++ b/app/models/coursewareable/asset.rb @@ -12,9 +12,6 @@ # Validations validates_presence_of :user, :classroom, :assetable validates_attachment_presence :attachment - validates_attachment_size :attachment, :less_than => Proc.new{ |file| - file.user.plan.left_space - } # Callbacks @@ -27,5 +24,11 @@ before_destroy do user.plan.decrement!(:used_space, attachment_file_size) end + + # Check for left space + before_save do + attachment_file_size < user.plan.left_space ? true : false + end + end end
Refactor file upload limits due to latest gem updates.
diff --git a/app/services/fetch_atom_service.rb b/app/services/fetch_atom_service.rb index abc1234..def5678 100644 --- a/app/services/fetch_atom_service.rb +++ b/app/services/fetch_atom_service.rb @@ -29,7 +29,7 @@ def process_headers(url, response) Rails.logger.debug "Processing link header" - link_header = LinkHeader.parse(response['Link']) + link_header = LinkHeader.parse(response['Link'].is_a?(Array) ? response['Link'].first : response['Link']) alternate_link = link_header.find_link(['rel', 'alternate'], ['type', 'application/atom+xml']) return process_html(fetch(url)) if alternate_link.nil?
Fix handling of multiple Link headers (that should not be a thing though)
diff --git a/test/models/api_key_test.rb b/test/models/api_key_test.rb index abc1234..def5678 100644 --- a/test/models/api_key_test.rb +++ b/test/models/api_key_test.rb @@ -17,9 +17,27 @@ should belong_to(:user) - test "creating a new Api Key should generate an access token" do + test "creating a new api key should generate an access token" do api_key = ApiKey.create!(name: "MyApiKey") assert_not_nil api_key.access_token end + test "updating an existing api key should not modify its access token" do + api_key = ApiKey.create!(name: "MyApiKey") + access_token = api_key.access_token + api_key.name = "ChangedApiKeyName" + api_key.save! + assert_equal access_token, api_key.access_token + end + + test "expired should be false" do + api_key = ApiKey.create!(name: "MyApiKey") + assert (api_key.expired? == false), "ApiKey#expired? should be false when date_expired is not present" + end + + test "expired should be true" do + api_key = ApiKey.create!(name: "MyApiKey", date_expired: 1.month.ago) + assert (api_key.expired? == true), "ApiKey#expired? should be true when date_expired is present" + end + end
Add assertations for the expired? method on the ApiKey model
diff --git a/spec/support/ems_refresh_helper.rb b/spec/support/ems_refresh_helper.rb index abc1234..def5678 100644 --- a/spec/support/ems_refresh_helper.rb +++ b/spec/support/ems_refresh_helper.rb @@ -0,0 +1,45 @@+module Spec + module Support + module EmsRefreshHelper + def serialize_inventory + # These models don't have tables behind them + skip_models = [MiqRegionRemote, VmdbDatabaseConnection, VmdbDatabaseLock, VmdbDatabaseSetting] + models = ApplicationRecord.subclasses - skip_models + + # Skip attributes that always change between refreshes + skip_attrs_global = ["created_on", "updated_on"] + skip_attrs_by_model = { + "ExtManagementSystem" => ["last_refresh_date", "last_inventory_date"], + } + + models.each_with_object({}) do |model, inventory| + inventory[model.name] = model.all.map do |rec| + skip_attrs = skip_attrs_global + skip_attrs_by_model[model.name].to_a + rec.attributes.except(*skip_attrs) + end + end + end + + def assert_inventory_not_changed(before, after) + expect(before.keys).to match_array(after.keys) + + before.each_key do |model| + expect(before[model].count).to eq(after[model].count), <<~SPEC_FAILURE + #{model} count doesn't match + expected: #{before[model].count} + got: #{after[model].count} + SPEC_FAILURE + + before[model].each do |item_before| + item_after = after[model].detect { |i| i["id"] == item_before["id"] } + expect(item_before).to eq(item_after), <<~SPEC_FAILURE + #{model} ID [#{item_before["id"]}] + expected: #{item_before} + got: #{item_after} + SPEC_FAILURE + end + end + end + end + end +end
Move EmsRefresh spec helper methods to core Move these helper methods of of the vmware repo to core. VMware and Azure have similar methods and every provider with graph and classic refresh can benefit from these methods.
diff --git a/lib/github_api/client/repos/merging.rb b/lib/github_api/client/repos/merging.rb index abc1234..def5678 100644 --- a/lib/github_api/client/repos/merging.rb +++ b/lib/github_api/client/repos/merging.rb @@ -16,26 +16,30 @@ # Perform a merge # - # = Inputs - # * <tt>:base</tt> - Required String - The name of the base branch that the head will be merged into. - # * <tt>:head</tt> - Required String - The head to merge. This can be a branch name or a commit SHA1. - # * <tt>:commit_message</tt> - Optional String - Commit message to use for the merge commit. If omitted, a default message will be used. + # @param [Hash] params + # @input params [String] :base + # Required. The name of the base branch that the head will be merged into. + # @input params [String] :head + # Required. The head to merge. This can be a branch name or a commit SHA1. + # @input params [String] :commit_message + # Commit message to use for the merge commit. + # If omitted, a default message will be used. # - # = Examples - # github = Github.new - # github.repos.merging.merge 'user', 'repo', - # "base": "master", - # "head": "cool_feature", - # "commit_message": "Shipped cool_feature!" + # @example + # github = Github.new + # github.repos.merging.merge 'user', 'repo', + # base: "master", + # head: "cool_feature", + # commit_message: "Shipped cool_feature!" # + # @api public def merge(*args) - arguments(args, :required => [:user, :repo]) do - sift VALID_MERGE_PARAM_NAMES + arguments(args, required: [:user, :repo]) do + permit VALID_MERGE_PARAM_NAMES assert_required REQUIRED_MERGE_PARAMS end - params = arguments.params - post_request("/repos/#{user}/#{repo}/merges", params) + post_request("/repos/#{arguments.user}/#{arguments.repo}/merges", arguments.params) end end # Client::Repos::Merging end # Github
Change repository mergin api to use new parser. Update docs.
diff --git a/lib/spree/chimpy/controller_filters.rb b/lib/spree/chimpy/controller_filters.rb index abc1234..def5678 100644 --- a/lib/spree/chimpy/controller_filters.rb +++ b/lib/spree/chimpy/controller_filters.rb @@ -11,7 +11,7 @@ def find_mail_chimp_params mc_eid = params[:mc_eid] || session[:mc_eid] mc_cid = params[:mc_cid] || session[:mc_cid] - if (mc_eid || mc_cid) && session[:order_id] + if (mc_eid || mc_cid) && (session[:order_id] || params[:record_mc_details]) attributes = {campaign_id: mc_cid, email_id: mc_eid} if current_order(create_order_if_necessary: true).source
Save order source also if record_ms_details params is present This way, we do not need to set session[:order_id]
diff --git a/config/initializers/carrier_wave.rb b/config/initializers/carrier_wave.rb index abc1234..def5678 100644 --- a/config/initializers/carrier_wave.rb +++ b/config/initializers/carrier_wave.rb @@ -3,9 +3,7 @@ config.fog_credentials = { provider: 'AWS', aws_access_key_id: ENV['S3_ACCESS_KEY'], - aws_secret_access_key: ENV['S3_SECRET_KEY'], - region: 'ap-northeast-1', - endpoint: 'https://leehana.s3-website-ap-northeast-1.amazonaws.com' + aws_secret_access_key: ENV['S3_SECRET_KEY'] } config.fog_directory = ENV['S3_BUCKET']
Update AWS s3 information - 2
diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb index abc1234..def5678 100644 --- a/config/initializers/fast_gettext.rb +++ b/config/initializers/fast_gettext.rb @@ -6,7 +6,7 @@ # temporarily force it off while we load stuff. Vmdb::FastGettextHelper.register_locales gettext_options = %w(--sort-by-msgid --location --no-wrap) - Rails.application.config.gettext_i18n_rails.msgmerge = gettext_options + Rails.application.config.gettext_i18n_rails.msgmerge = gettext_options + ["--no-fuzzy-matching"] Rails.application.config.gettext_i18n_rails.xgettext = gettext_options + ["--add-comments=TRANSLATORS"] if !Rails.env.test? && Settings.ui.mark_translated_strings
Disable fuzzy matching for rmsgmerge
diff --git a/app/views/user/api_details.builder b/app/views/user/api_details.builder index abc1234..def5678 100644 --- a/app/views/user/api_details.builder +++ b/app/views/user/api_details.builder @@ -6,6 +6,9 @@ if @user.description xml.tag! "description", @user.description end + xml.tag! "contributor-terms", + :agreed => !!@user.terms_agreed, + :pd => !!@user.consider_pd if @user.home_lat and @user.home_lon xml.tag! "home", :lat => @user.home_lat, :lon => @user.home_lon,
Add new <contributor-terms> element to user details
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -19,7 +19,7 @@ desc "Commit modified files on server to source control, in case anyone has edited them directly" task :commit_edits do - run "cd #{current_path}; svn commit -m 'Manual updates'" + # Can't commit from Rails root without side-stepping log symlink, so just do local for now run "cd #{current_path}/local; svn commit -m 'Manual updates'" end
Disable remote commits that don't work
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -13,12 +13,6 @@ server "172.16.58.128", :app, :web, :db, :primary => true -namespace :deploy do - task :restart, :roles => :app, :except => { :no_release => true } do - run "touch #{File.join(current_path,'tmp','restart.txt')}" - end -end - after 'deploy:update_code' do { "mom.yml" => "config/mom.yml" }. each do |from, to| @@ -27,3 +21,7 @@ end after "deploy", "deploy:cleanup" + +after "deploy" do + run "touch #{File.join(current_path,'tmp','restart.txt')}" +end
Fix restart in capistrano script
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -11,6 +11,8 @@ # TODO: Is there a nicer way of including `nvm`? 'PATH' => "$HOME/.nvm/v0.10.23/bin:$PATH" } + +set :branch, fetch(:branch, "master") set :node_user, "combee" set :deploy_to, "/home/combee/apps/pokebattle-sim"
Capistrano: Deploy can use a branch.
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,11 +13,11 @@ match 'favicon/:feed' => 'icon#get' resource :members, only: :create - match 'signup' => 'members#new', as: :sign_up + get 'signup' => 'members#new', as: :sign_up resource :session, only: :create - match 'login' => 'sessions#new', as: :login - match 'logout' => 'sessions#destroy', as: :logout + get 'login' => 'sessions#new', as: :login + get 'logout' => 'sessions#destroy', as: :logout root to: 'reader#welcome'
Use specific method name instead of `match` refs: https://github.com/fastladder/fastladder/pull/24#issuecomment-15001229
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index abc1234..def5678 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,7 +1,7 @@ # Be sure to restart your server when you modify this file. #Avalon::Application.config.session_store :cookie_store, :key => '_avalon_session' -Avalon::Application.config.session_store :active_record_store, secure: Rails.env.production?, httponly: true +Avalon::Application.config.session_store :active_record_store, secure: Settings.domain.protocol == "https" && Rails.env.production?, httponly: true # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information
Fix authentication bug in non-SSL production mode
diff --git a/lib/flipper/adapters/dual_write.rb b/lib/flipper/adapters/dual_write.rb index abc1234..def5678 100644 --- a/lib/flipper/adapters/dual_write.rb +++ b/lib/flipper/adapters/dual_write.rb @@ -4,7 +4,7 @@ include ::Flipper::Adapter # Public: The name of the adapter. - attr_reader :name + attr_reader :name, :local, :remote # Public: Build a new sync instance. #
Add methods for local and remote
diff --git a/core/app/models/spree/option_type.rb b/core/app/models/spree/option_type.rb index abc1234..def5678 100644 --- a/core/app/models/spree/option_type.rb +++ b/core/app/models/spree/option_type.rb @@ -9,7 +9,7 @@ has_many :option_type_prototypes, class_name: 'Spree::OptionTypePrototype' has_many :prototypes, through: :option_type_prototypes, class_name: 'Spree::Prototype' - validates :name, presence: true, uniqueness: true + validates :name, presence: true, uniqueness: { allow_blank: true } validates :presentation, presence: true default_scope { order(:position) }
Add allow_blank to uniqueness validation of option type name
diff --git a/app/models/link_relationship.rb b/app/models/link_relationship.rb index abc1234..def5678 100644 --- a/app/models/link_relationship.rb +++ b/app/models/link_relationship.rb @@ -21,4 +21,6 @@ belongs_to :linkable, polymorphic: true, touch: true + + # TODO: Find way how to touch categories through repos where link is displayed end
Add todo for caching links issue
diff --git a/app/models/local_restriction.rb b/app/models/local_restriction.rb index abc1234..def5678 100644 --- a/app/models/local_restriction.rb +++ b/app/models/local_restriction.rb @@ -3,6 +3,7 @@ def initialize(gss_code) @gss_code = gss_code + @time_zone = Time.find_zone("London") end def all_restrictions @@ -32,7 +33,7 @@ def current restrictions = restriction["restrictions"] current_restrictions = restrictions.select do |rest| - start_date = Time.zone.parse("#{rest['start_date']} #{rest['start_time']}") + start_date = @time_zone.parse("#{rest['start_date']} #{rest['start_time']}") start_date.past? end @@ -42,7 +43,7 @@ def future restrictions = restriction["restrictions"] future_restrictions = restrictions.select do |rest| - start_date = Time.zone.parse("#{rest['start_date']} #{rest['start_time']}") + start_date = @time_zone.parse("#{rest['start_date']} #{rest['start_time']}") start_date.future? end
Set time zone to London Borrowed from: https://github.com/alphagov/content-publisher/commit/4ae1c4ed683bf0b24eb11d135aebd3cdd1a8ffa6 We need to make sure the alert level changes go out at the correct time. The time zone on the server is incorrect, which means that when we're using dates and times to set the level they're an hour out of date during daylight saving time. This sets the Local restrictions time zone to 'London'. We tried doing this at the app level, but it broke a lot of unrelated tests.
diff --git a/cookbooks/groove/recipes/default.rb b/cookbooks/groove/recipes/default.rb index abc1234..def5678 100644 --- a/cookbooks/groove/recipes/default.rb +++ b/cookbooks/groove/recipes/default.rb @@ -8,8 +8,9 @@ # stamp = `date +%s` +groove_working = "/Users/fire/groove" -git "/tmp/groove-#{stamp}" do +git "#{groove_working}" do repository "https://github.com/andrewrk/libgroove" reference "master" end @@ -17,6 +18,14 @@ include_recipe "homebrew" package 'cmake' do + action :install +end + +package 'ninja' do + action :install +end + +package 'sdl2' do action :install end @@ -28,3 +37,12 @@ action :install end +directory "#{groove_working}/Build" do +end + +execute 'build' do + cwd "#{groove_working}/Build" + command "cmake -G Ninja ../" + command "ninja " +end +
Build groove with ninja in home directory.
diff --git a/app/lib/notifier.rb b/app/lib/notifier.rb index abc1234..def5678 100644 --- a/app/lib/notifier.rb +++ b/app/lib/notifier.rb @@ -6,43 +6,43 @@ def call return unless appointment.previous_changes - notify_customer(appointment) - notify_guiders(appointment) + notify_customer + notify_guiders end private - def notify_guiders(appointment) - guiders_to_notify(appointment).each do |guider_id| + def notify_guiders + guiders_to_notify.each do |guider_id| PusherNotificationJob.perform_later(guider_id, appointment) end end - def guiders_to_notify(appointment) + def guiders_to_notify Array(appointment.previous_changes.fetch('guider_id', appointment.guider_id)) end - def notify_customer(appointment) - if appointment_details_changed?(appointment) + def notify_customer + if appointment_details_changed? CustomerUpdateJob.perform_later(appointment, CustomerUpdateActivity::UPDATED_MESSAGE) - elsif appointment_cancelled?(appointment) + elsif appointment_cancelled? CustomerUpdateJob.perform_later(appointment, CustomerUpdateActivity::CANCELLED_MESSAGE) - elsif appointment_missed?(appointment) + elsif appointment_missed? CustomerUpdateJob.perform_later(appointment, CustomerUpdateActivity::MISSED_MESSAGE) end end - def appointment_details_changed?(appointment) + def appointment_details_changed? appointment.previous_changes.any? && (appointment.previous_changes.keys - Appointment::NON_NOTIFY_COLUMNS).present? end - def appointment_cancelled?(appointment) + def appointment_cancelled? appointment.previous_changes.slice('status').present? && appointment.cancelled? end - def appointment_missed?(appointment) + def appointment_missed? appointment.previous_changes.slice('status').present? && appointment.no_show? end
Clean up method signatures in Notify object appointment didn’t need to be passed in to each and every object.
diff --git a/app/models/token.rb b/app/models/token.rb index abc1234..def5678 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -2,7 +2,7 @@ belongs_to :user validates :name, :secret, presence: true - validate :secret_is_valid + validate :secret_is_valid_base32 before_validation :normalize_secret @@ -14,7 +14,7 @@ private - def secret_is_valid + def secret_is_valid_base32 code rescue errors.add :secret, "is not a valid base32 secret"
Rename method to reveal intent
diff --git a/jekyll-theme-midnight.gemspec b/jekyll-theme-midnight.gemspec index abc1234..def5678 100644 --- a/jekyll-theme-midnight.gemspec +++ b/jekyll-theme-midnight.gemspec @@ -4,7 +4,7 @@ s.name = "jekyll-theme-midnight" s.version = "0.0.1" s.authors = ["Please come forward"] - s.email = ["support@github.com"] + s.email = ["opensource+jekyll-theme-midnight@github.com"] s.homepage = "https://github.com/pages-themes/midnight" s.summary = "Midnight is a theme for GitHub Pages"
Update contact email in Gemspec
diff --git a/src/modules/youtube.rb b/src/modules/youtube.rb index abc1234..def5678 100644 --- a/src/modules/youtube.rb +++ b/src/modules/youtube.rb @@ -1,18 +1,7 @@ require 'uri' require 'net/http' -def fetch(uri_str, limit = 10) - # You should choose better exception. - raise ArgumentError, 'HTTP redirect too deep' if limit == 0 - - response = Net::HTTP.get_response(URI.parse(uri_str)) - case response - when Net::HTTPSuccess then response - when Net::HTTPRedirection then fetch(response['location'], limit - 1) - else - response.error! - end -end +Kernel.load('fetch_uri.rb') def parseYoutube(url) if URI.parse(url).host =~ /.*youtube\.com/ @@ -20,7 +9,7 @@ api = "http://gdata.youtube.com/feeds/api/videos/" + video print api + "\n" - reply = fetch(api) + reply = fetch_uri(api) return "" if (reply.code != "200") title = "?"
Split fetching uris to own file Signed-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>
diff --git a/spec/firebase_id_token/configuration_spec.rb b/spec/firebase_id_token/configuration_spec.rb index abc1234..def5678 100644 --- a/spec/firebase_id_token/configuration_spec.rb +++ b/spec/firebase_id_token/configuration_spec.rb @@ -11,8 +11,8 @@ describe '.project_ids=' do it 'changes default values' do config = Configuration.new - config.project_ids = 1 - expect(config.project_ids).to eq(1) + config.project_ids = String.new + expect(config.project_ids).to be_a(String) end end
Make a small convention change
diff --git a/spec/core/threadgroup/list_spec.rb b/spec/core/threadgroup/list_spec.rb index abc1234..def5678 100644 --- a/spec/core/threadgroup/list_spec.rb +++ b/spec/core/threadgroup/list_spec.rb @@ -3,11 +3,13 @@ describe "ThreadGroup#list" do it "should return the list of threads in the group" do thread = Thread.new { sleep } + Thread.pass until thread.status == 'sleep' tg = ThreadGroup.new tg.add(thread) tg.list.should include(thread) thread2 = Thread.new { sleep } + Thread.pass until thread2.status == 'sleep' tg.add(thread2) (tg.list & [thread, thread2]).should include(thread, thread2) @@ -15,4 +17,4 @@ thread.run; thread.join thread2.run; thread2.join end -end+end
Add 'sleep' checks to threadgroup spec to avoid the same race conditions seen in kernel/sleep_spec.
diff --git a/spec/factories/shipment_factory.rb b/spec/factories/shipment_factory.rb index abc1234..def5678 100644 --- a/spec/factories/shipment_factory.rb +++ b/spec/factories/shipment_factory.rb @@ -9,7 +9,7 @@ state 'pending' order address - stock_location + stock_location { DefaultStockLocation.find_or_create } after(:create) do |shipment, evalulator| shipment.add_shipping_method(create(:shipping_method), true) @@ -27,7 +27,7 @@ state 'pending' order address - stock_location + stock_location { DefaultStockLocation.find_or_create } trait :shipping_method do transient do
Fix problem with shipment's stock location creation
diff --git a/spec/regression/regression_spec.rb b/spec/regression/regression_spec.rb index abc1234..def5678 100644 --- a/spec/regression/regression_spec.rb +++ b/spec/regression/regression_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" describe "regression test" do - command("#{File.expand_path("../../../bin/foodcritic --tags any", __FILE__)} .", allow_error: true) + command("#{File.expand_path("../../../bin/foodcritic", __FILE__)} --tags any .", allow_error: true) IO.readlines(File.expand_path("../cookbooks.txt", __FILE__)).each do |line| name, ref = line.strip.split(":")
Move argument to the correct location Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/testunitxml.gemspec b/testunitxml.gemspec index abc1234..def5678 100644 --- a/testunitxml.gemspec +++ b/testunitxml.gemspec @@ -0,0 +1,10 @@+spec = Gem::Specification.new do |s| + s.name = 'rubyjedi-testunitxml' + s.version = '0.1.6.3' + s.authors = ['Henrik Mårtensson', "Laurence A. Lee"] + s.email = ['dag.henrik.martensson@gmail.com', 'rubyjedi@gmail.com'] + s.homepage = "https://github.com/rubyjedi/testunitxml" + s.platform = Gem::Platform::RUBY + s.summary = "testunitxml extends the Test::Unit framework with an assertion for testing well-formed XML documents." + s.files = Dir['lib/**/*'] +end
Add a Gemspec so we can play nicely with the rest of the RubyGems ecosystem.
diff --git a/spec/open_classes/string/to_markdown_heading_spec.rb b/spec/open_classes/string/to_markdown_heading_spec.rb index abc1234..def5678 100644 --- a/spec/open_classes/string/to_markdown_heading_spec.rb +++ b/spec/open_classes/string/to_markdown_heading_spec.rb @@ -9,26 +9,26 @@ case_no: 1, case_title: '> case', input: 'hoge>hige', - expected: "# hoge\n## hige", + expected: "# hoge\n## hige" }, { case_no: 2, case_title: '+ case', input: 'hoge+hige', - expected: "# hoge\n# hige", + expected: "# hoge\n# hige" }, { case_no: 3, case_title: '^ case', input: 'hoge>hige^hege', - expected: "# hoge\n## hige\n# hege", + expected: "# hoge\n## hige\n# hege" }, { case_no: 4, case_title: 'mix case', input: 'hoge>hige1+hige2^hege', - expected: "# hoge\n## hige1\n## hige2\n# hege", - }, + expected: "# hoge\n## hige1\n## hige2\n# hege" + } ] cases.each do |c|
Fix rubocop warning 'TrailingComma' in to_markdown_heading
diff --git a/spec/views/projects/pipelines/show.html.haml_spec.rb b/spec/views/projects/pipelines/show.html.haml_spec.rb index abc1234..def5678 100644 --- a/spec/views/projects/pipelines/show.html.haml_spec.rb +++ b/spec/views/projects/pipelines/show.html.haml_spec.rb @@ -0,0 +1,51 @@+require 'spec_helper' + +describe 'projects/pipelines/show' do + include Devise::TestHelpers + + let(:project) { create(:project) } + let(:pipeline) do + create(:ci_empty_pipeline, project: project, + sha: project.commit.id) + end + + before do + create_build('build', 0, 'build') + create_build('test', 1, 'rspec 0 2') + create_build('test', 1, 'rspec 1 2') + create_build('test', 1, 'audit') + create_build('deploy', 2, 'production') + + create(:generic_commit_status, pipeline: pipeline, stage: 'external', name: 'jenkins', stage_idx: 3) + + assign(:project, project) + assign(:pipeline, pipeline) + + allow(view).to receive(:can?).and_return(true) + end + + it 'shows a graph with grouped stages' do + render + + expect(rendered).to have_css('.pipeline-graph') + expect(rendered).to have_css('.grouped-pipeline-dropdown') + + # stages + expect(rendered).to have_text('Build') + expect(rendered).to have_text('Test') + expect(rendered).to have_text('Deploy') + expect(rendered).to have_text('External') + + # builds + expect(rendered).to have_text('rspec') + expect(rendered).to have_text('rspec 0:1') + expect(rendered).to have_text('production') + expect(rendered).to have_text('jenkins') + end + + private + + def create_build(stage, stage_idx, name) + create(:ci_build, pipeline: pipeline, stage: stage, stage_idx: stage_idx, name: name) + end +end
Add view specs for pipelines graph
diff --git a/ldp_testsuite_wrapper.gemspec b/ldp_testsuite_wrapper.gemspec index abc1234..def5678 100644 --- a/ldp_testsuite_wrapper.gemspec +++ b/ldp_testsuite_wrapper.gemspec @@ -22,8 +22,8 @@ spec.add_dependency "faraday" spec.add_dependency "ruby-progressbar" - spec.add_development_dependency "bundler", "~> 1.7" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "bundler", "~> 2.1", ">= 2.1.10" + spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "rspec" spec.add_development_dependency "coveralls"
Update bundler and rake versions in gemspec.
diff --git a/spec/best_boy_spec.rb b/spec/best_boy_spec.rb index abc1234..def5678 100644 --- a/spec/best_boy_spec.rb +++ b/spec/best_boy_spec.rb @@ -0,0 +1,26 @@+require 'spec_helper' + +describe BestBoy do + describe 'its configuration interface' do + it 'defaults or :active_record as ORM' do + expect(BestBoy.orm).to eql :active_record + end + + it 'defaults to ApplicationController as base controller' do + expect(BestBoy.base_controller).to eql 'ApplicationController' + end + + [:before_filter, :custom_redirect, :skip_after_filter, :skip_before_filter].each do |config_var| + it "defaults to nil for #{config_var}" do + expect(BestBoy.public_send(config_var)).to be_nil + end + end + end + + describe '.setup' do + it 'yields self to block' do + expect { |blk| BestBoy.setup(&blk) }. + to yield_with_args BestBoy + end + end +end
Add spec for configuration interface
diff --git a/spec/commands_spec.rb b/spec/commands_spec.rb index abc1234..def5678 100644 --- a/spec/commands_spec.rb +++ b/spec/commands_spec.rb @@ -16,13 +16,13 @@ it 'should successfully trigger the command' do event = double - bot.execute_command(:test, event, []) + bot.execute_command(:test, event, [], false, false) end it 'should not send anything to the channel' do event = spy - bot.execute_command(:test, event, []) + bot.execute_command(:test, event, [], false, false) expect(spy).to_not have_received :respond end
Call execute_command with check_permissions as false in all instances
diff --git a/spree_sitemap.gemspec b/spree_sitemap.gemspec index abc1234..def5678 100644 --- a/spree_sitemap.gemspec +++ b/spree_sitemap.gemspec @@ -16,7 +16,7 @@ s.requirements << 'none' s.add_dependency 'spree_core', '>= 1.0.0' - s.add_dependency 'sitemap_generator', '~> 3.1' + s.add_dependency 'sitemap_generator', '~> 4.0.1' s.add_development_dependency 'database_cleaner' s.add_development_dependency 'factory_girl'
Upgrade sitemap_generator gem to version 4.0.1
diff --git a/lib/bluecap/handlers/event.rb b/lib/bluecap/handlers/event.rb index abc1234..def5678 100644 --- a/lib/bluecap/handlers/event.rb +++ b/lib/bluecap/handlers/event.rb @@ -16,6 +16,8 @@ key(data[:event][:name], data[:event][:timestamp]), data[:event][:id], 1) + + nil end end end
Return nil, don't want to return data to client
diff --git a/qa/qa/runtime/user.rb b/qa/qa/runtime/user.rb index abc1234..def5678 100644 --- a/qa/qa/runtime/user.rb +++ b/qa/qa/runtime/user.rb @@ -12,12 +12,14 @@ end def ssh_key - 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFf6RYK3qu/RKF/3ndJmL5xgMLp3O9' \ - '6x8lTay+QGZ0+9FnnAXMdUqBq/ZU6d/gyMB4IaW3nHzM1w049++yAB6UPCzMB8Uo27K5' \ - '/jyZCtj7Vm9PFNjF/8am1kp46c/SeYicQgQaSBdzIW3UDEa1Ef68qroOlvpi9PYZ/tA7' \ - 'M0YP0K5PXX+E36zaIRnJVMPT3f2k+GnrxtjafZrwFdpOP/Fol5BQLBgcsyiU+LM1SuaC' \ - 'rzd8c9vyaTA1CxrkxaZh+buAi0PmdDtaDrHd42gqZkXCKavyvgM5o2CkQ5LJHCgzpXy0' \ - '5qNFzmThBSkb+XtoxbyagBiGbVZtSVow6Xa7qewz= dummy@gitlab.com' + <<~KEY.tr("\n", '') + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFf6RYK3qu/RKF/3ndJmL5xgMLp3O9 + 6x8lTay+QGZ0+9FnnAXMdUqBq/ZU6d/gyMB4IaW3nHzM1w049++yAB6UPCzMB8Uo27K5 + /jyZCtj7Vm9PFNjF/8am1kp46c/SeYicQgQaSBdzIW3UDEa1Ef68qroOlvpi9PYZ/tA7 + M0YP0K5PXX+E36zaIRnJVMPT3f2k+GnrxtjafZrwFdpOP/Fol5BQLBgcsyiU+LM1SuaC + rzd8c9vyaTA1CxrkxaZh+buAi0PmdDtaDrHd42gqZkXCKavyvgM5o2CkQ5LJHCgzpXy0 + 5qNFzmThBSkb+XtoxbyagBiGbVZtSVow6Xa7qewz= dummy@gitlab.com + KEY end end end
Use heredoc so it's more clear
diff --git a/lib/bra/model/component_creator.rb b/lib/bra/model/component_creator.rb index abc1234..def5678 100644 --- a/lib/bra/model/component_creator.rb +++ b/lib/bra/model/component_creator.rb @@ -4,14 +4,14 @@ module Bra module Model class ComponentCreator + include Bra::Common::Types::Validators + def create(type, value) case type when :load_state - fail unless Bra::Common::Types::LOAD_STATES.include? value - Bra::Model::Constant.new(value, :load_state) + Bra::Model::Constant.new(validate_load_state(value), :load_state) when :play_state - fail unless Bra::Common::Types::PLAY_STATES.include? value - Bra::Model::Constant.new(value, :state) + Bra::Model::Constant.new(validate_play_state(value), :state) end end end
Use validators to pass this test.
diff --git a/lib/github_cli/commands/merging.rb b/lib/github_cli/commands/merging.rb index abc1234..def5678 100644 --- a/lib/github_cli/commands/merging.rb +++ b/lib/github_cli/commands/merging.rb @@ -5,6 +5,12 @@ namespace :merge + option :base, :type => :string, :required => true, + :desc => "The name of the base branch that the head will be merged into" + option :head, :type => :string, :required => true, + :desc => "The head to merge. This can be a branch name or a commit SHA1" + option :message, :type => :string, + :desc => "Commit message to use for the merge commit" desc 'perform <user> <repo>', 'Perform merge' long_desc <<-DESC Inputs @@ -14,7 +20,12 @@ commit_message - Optional String - Commit message to use for the merge commit. If omitted, a default message will be used.\n DESC def perform(user, repo) - Merging.merge user, repo, options[:params], options[:format] + params = options[:params] + params['base'] = options[:base] if options[:base] + params['head'] = options[:head] if options[:head] + params['commit_message'] = options[:message] if options[:message] + + Merging.merge user, repo, params, options[:format] end end # Merging
Add specific options to merge command.
diff --git a/lib/litmus_mailer/mail_observer.rb b/lib/litmus_mailer/mail_observer.rb index abc1234..def5678 100644 --- a/lib/litmus_mailer/mail_observer.rb +++ b/lib/litmus_mailer/mail_observer.rb @@ -13,9 +13,11 @@ Rails.logger.debug "Deleting Litmus test #{existing_test['id']} (#{existing_test['name']})" end + body = (mail.parts.nil? || mail.parts.empty?) ? mail.body : mail.parts.last.body + new_test = Litmus::EmailTest.create({ :subject => mail.subject, - :body => mail.parts.last.body # Note that only the last part is sent + :body => body # Note that only the last part is sent }, mail.litmus_test) Rails.logger.debug "Created new Litmus test #{new_test['id']} (#{new_test['name']})"
Add support for non-multipart emails
diff --git a/lib/locomotive/carrierwave/base.rb b/lib/locomotive/carrierwave/base.rb index abc1234..def5678 100644 --- a/lib/locomotive/carrierwave/base.rb +++ b/lib/locomotive/carrierwave/base.rb @@ -3,11 +3,16 @@ class Base def to_liquid - { - :url => self.url, - :filename => (File.basename(self.url) rescue ''), - :size => self.size - }.stringify_keys + uploader = self + + (Hash.new do |h, key| + if key == 'size' || key == :size + h[key] = uploader.size + end + end).tap do |h| + h['url'] = self.url + h["filename"] = (File.basename(self.url) rescue '') + end end end
Fix for the performance problem when rendering carrierwave fields. Using size check only when it's needed
diff --git a/lib/pronto/rails_best_practices.rb b/lib/pronto/rails_best_practices.rb index abc1234..def5678 100644 --- a/lib/pronto/rails_best_practices.rb +++ b/lib/pronto/rails_best_practices.rb @@ -3,10 +3,10 @@ module Pronto class RailsBestPractices < Runner - def run(patches, _) - return [] unless patches + def run + return [] unless @patches - patches_with_additions = patches.select { |patch| patch.additions > 0 } + patches_with_additions = @patches.select { |patch| patch.additions > 0 } files = patches_with_additions.map do |patch| Regexp.new(patch.new_file_full_path.to_s)
Update runner to expect parameters via initialize
diff --git a/lib/requests/find_all_by_filter.rb b/lib/requests/find_all_by_filter.rb index abc1234..def5678 100644 --- a/lib/requests/find_all_by_filter.rb +++ b/lib/requests/find_all_by_filter.rb @@ -1,8 +1,10 @@ module HonestRenter class FindAllByFilter - def initialize(resource_name, session) + def initialize(resource_name, session, limit = nil, offset = nil) @resource_name = resource_name @session = session + @limit = limit + @offset = offset end def expanding(attribute) @@ -30,6 +32,9 @@ Array(@filters).each do |filter| params[filter.key] = filter.value end + + params[:limit] = @limit unless @limit.nil? + params[:offset] = @offset unless @offset.nil? end request.get(@resource_name, query)
Add limit and offset functionality to find_all_by_rental_id
diff --git a/lib/run_keeper/activity_request.rb b/lib/run_keeper/activity_request.rb index abc1234..def5678 100644 --- a/lib/run_keeper/activity_request.rb +++ b/lib/run_keeper/activity_request.rb @@ -21,18 +21,10 @@ activities -= activities.reject { |activity| (activity.start_time > @options[:start]) && (activity.start_time < @options[:finish]) } end - if response.parsed['next'] - if @options[:limit] - if activities.size < @options[:limit] - @options[:params].update(:page => response.parsed['next'].split('=').last) - activities + request(activities) - else - activities - end - else - @options[:params].update(:page => response.parsed['next'].split('=').last) - activities + request(activities) - end + if response.parsed['next'] && (@options[:limit].nil? || activities.size < @options[:limit]) + next_page = response.parsed['next'].scan(/page=(\d+)/)[0][0] + @options[:params].update(:page => next_page) + activities + request(activities) else activities end
Fix parsing of runkeeper multi-page response.
diff --git a/lib/snapshot/latest_ios_version.rb b/lib/snapshot/latest_ios_version.rb index abc1234..def5678 100644 --- a/lib/snapshot/latest_ios_version.rb +++ b/lib/snapshot/latest_ios_version.rb @@ -13,7 +13,9 @@ end matched = output.match(/iOS ([\d\.]+) \(.*/) - if matched.length > 1 + if matched.nil? + raise "Could not determine installed iOS SDK version. Try running the _xcodebuild_ command manually to ensure it works." + elsif matched.length > 1 return @version ||= matched[1] else raise "Could not determine installed iOS SDK version. Please pass it via the environment variable 'SNAPSHOT_IOS_VERSION'".red
Check for case where matched is nil. (Occurs when Xcode license agreement needs to be accepted)
diff --git a/lib/tasks/certificate_factory.rake b/lib/tasks/certificate_factory.rake index abc1234..def5678 100644 --- a/lib/tasks/certificate_factory.rake +++ b/lib/tasks/certificate_factory.rake @@ -18,7 +18,7 @@ options = { user_id: user.id, limit: ENV['LIMIT'], - jurisdiction: ENV['JURISDICTION'] || 'gb' + jurisdiction: ENV.fetch('JURISDICTION'], 'gb') } if campaign_name = ENV['CAMPAIGN'] campaign = user.certification_campaigns.where(name: campaign_name).first_or_create(url: url)
Use fetch to set default
diff --git a/lib/track_sensor/newbold_dt8000.rb b/lib/track_sensor/newbold_dt8000.rb index abc1234..def5678 100644 --- a/lib/track_sensor/newbold_dt8000.rb +++ b/lib/track_sensor/newbold_dt8000.rb @@ -6,7 +6,7 @@ # @raise [IOError] if a device is not plugged in def new_race - write ' ' + write ' ' end def serial_params
Send 2 spaces to start a Newbold race According to Chris, you need 2 when there are only 2 lanes. Strange.
diff --git a/lib/frenetic/configuration.rb b/lib/frenetic/configuration.rb index abc1234..def5678 100644 --- a/lib/frenetic/configuration.rb +++ b/lib/frenetic/configuration.rb @@ -16,7 +16,7 @@ end def adapter - @_cfg[:adapter] || :net_http + @_cfg[:adapter] || Faraday.default_adapter end def api_token
Use Faraday's default adapter instead of explicitly specifying one
diff --git a/lib/onfido/requestable.rb b/lib/onfido/requestable.rb index abc1234..def5678 100644 --- a/lib/onfido/requestable.rb +++ b/lib/onfido/requestable.rb @@ -1,6 +1,9 @@ module Onfido module Requestable - def make_request(url:, payload:, method:) + def make_request(options) + url = options.fetch(:url) + payload = options.fetch(:payload) + method = options.fetch(:method) RestClient::Request.execute(url: url, payload: payload, method: method, headers: headers) do |response, *| ResponseHandler.new(response).parse! end
Remove required keyword params to support < 2.1 version
diff --git a/lib/usps/configuration.rb b/lib/usps/configuration.rb index abc1234..def5678 100644 --- a/lib/usps/configuration.rb +++ b/lib/usps/configuration.rb @@ -1,9 +1,16 @@ module USPS + # Configuration options: + # username: Provided by the USPS during registration + # timeout: How many seconds to wait for a response before raising Timeout::Error + # testing: Should requests be done against the testing service or not + # (only specific requests are supported). class Configuration < Struct.new(:username, :timeout, :testing) def initialize self.timeout = 5 self.testing = false self.username = ENV['USPS_USER'] end + + alias :testing? :testing end end
Add some documentation to the config class.
diff --git a/db/migrate/20110125100508_tags.rb b/db/migrate/20110125100508_tags.rb index abc1234..def5678 100644 --- a/db/migrate/20110125100508_tags.rb +++ b/db/migrate/20110125100508_tags.rb @@ -4,8 +4,8 @@ create_table :tags do primary_key :id String :name, :null => false - Fixnum :user_id, :null => false, :index => true - Fixnum :table_id, :null => false, :index => true + Integer :user_id, :null => false, :index => true + Integer :table_id, :null => false, :index => true index [:user_id, :table_id, :name], :unique => true end end
Fix migration for ruby 2.4
diff --git a/lib/concurrent/concern/logging.rb b/lib/concurrent/concern/logging.rb index abc1234..def5678 100644 --- a/lib/concurrent/concern/logging.rb +++ b/lib/concurrent/concern/logging.rb @@ -17,7 +17,12 @@ def log(level, progname, message = nil, &block) #NOTE: Cannot require 'concurrent/configuration' above due to circular references. # Assume that the gem has been initialized if we've gotten this far. - (@logger || Concurrent.global_logger).call level, progname, message, &block + logger = if defined?(@logger) && @logger + @logger + else + Concurrent.global_logger + end + logger.call level, progname, message, &block rescue => error $stderr.puts "`Concurrent.configuration.logger` failed to log #{[level, progname, message, block]}\n" + "#{error.message} (#{error.class})\n#{error.backtrace.join "\n"}"
Fix uninitialized instance variable warning
diff --git a/app/models/due_item.rb b/app/models/due_item.rb index abc1234..def5678 100644 --- a/app/models/due_item.rb +++ b/app/models/due_item.rb @@ -2,4 +2,8 @@ include MyplaceonlineActiveRecordIdentityConcern belongs_to :calendar + + def final_search_result + self.calendar + end end
Add due items to full text search results
diff --git a/app/models/metering.rb b/app/models/metering.rb index abc1234..def5678 100644 --- a/app/models/metering.rb +++ b/app/models/metering.rb @@ -7,6 +7,22 @@ relevant_fields.each do |field| next unless self.class.report_col_options.include?(field) group, source, * = field.split('_') + + if field == 'net_io_used_metric' + group = 'net_io' + source = 'used' + end + + if field == 'disk_io_used_metric' + group = 'disk_io' + source = 'used' + end + + if field == 'cpu_cores_used_metric' + group = 'cpu_cores' + source = 'used' + end + chargable_field = ChargeableField.find_by(:group => group, :source => source) next if field == "existence_hours_metric" || field == "fixed_compute_metric" || chargable_field && chargable_field.metering? value = chargable_field.measure_metering(consumption, @options) if chargable_field
Fix mapping string field to ChargeableField
diff --git a/test/client/metrics.rb b/test/client/metrics.rb index abc1234..def5678 100644 --- a/test/client/metrics.rb +++ b/test/client/metrics.rb @@ -4,7 +4,7 @@ app_coverage:100, test_coverage:100, line_ratio:1.8, - hits_ratio:5.8 + hits_ratio:5.0 } MAX = {
Reduce client-side min hits-ratio metric
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index abc1234..def5678 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -1,7 +1,7 @@ CarrierWave.configure do |config| config.permissions = 0666 config.directory_permissions = 0777 - config.storage = :file + config.storage = :fog config.ignore_integrity_errors = false config.ignore_processing_errors = false config.ignore_download_errors = false
Switch from :file to :fog for storage in initializer
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index abc1234..def5678 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -14,3 +14,7 @@ # ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.acronym 'RESTful' # end + +ActiveSupport::Inflector.inflections(:en) do |inflect| + inflect.uncountable %w( medical_equipment ) +end
Add a custom inflector for Medical Equipment
diff --git a/examples/media_with_external_file.rb b/examples/media_with_external_file.rb index abc1234..def5678 100644 --- a/examples/media_with_external_file.rb +++ b/examples/media_with_external_file.rb @@ -0,0 +1,26 @@+$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'awesome_print' +require 'collectionspace/client' + +# CREATE CLIENT WITH DEFAULT (DEMO) CONFIGURATION -- BE NICE!!! +client = CollectionSpace::Client.new +client.config.throttle = 1 + +# ap client.get('media/c453755d-3442-4516-9883').xml.to_xml + +media_url = "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png" +media = <<-XML +<?xml version="1.0" encoding="UTF-8"?> +<document name="media"> + <ns2:media_common xmlns:ns2="http://collectionspace.org/services/media" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <title>GOOGLE</title> + <identificationNumber>GOOGLE-1</identificationNumber> + </ns2:media_common> +</document> +XML + +response = client.post('media', media, { query: { "blobUri" => media_url } }) +puts response.status_code +if response.status_code == 201 + puts response.headers['location'] +end
Add example media post with external url
diff --git a/lib/endpoint_base/sinatra/base.rb b/lib/endpoint_base/sinatra/base.rb index abc1234..def5678 100644 --- a/lib/endpoint_base/sinatra/base.rb +++ b/lib/endpoint_base/sinatra/base.rb @@ -8,7 +8,7 @@ include EndpointBase::Concerns::ExceptionHandler get '/' do - 'ok\n' + "#{self.class.name} ok" end end end
Print sinatra class name on status response
diff --git a/lib/facebook_ads/models/ad_set.rb b/lib/facebook_ads/models/ad_set.rb index abc1234..def5678 100644 --- a/lib/facebook_ads/models/ad_set.rb +++ b/lib/facebook_ads/models/ad_set.rb @@ -4,6 +4,6 @@ module FacebookAds class AdSet < FacebookAds::Model field :targeting - field :created_at + field :created_time end end
Use actual field name from Facebook
diff --git a/lib/shinseibank/cli/subcommand.rb b/lib/shinseibank/cli/subcommand.rb index abc1234..def5678 100644 --- a/lib/shinseibank/cli/subcommand.rb +++ b/lib/shinseibank/cli/subcommand.rb @@ -3,9 +3,9 @@ class ShinseiBank module CLI class Subcommand < Thor - DEFAULT_CREDENTIALS_PATH = "./shinsei_account.yaml".freeze + DEFAULT_CREDENTIALS_YAML = "./shinsei_account.yaml".freeze - class_option :credentials, type: :string, aliases: "-c", default: DEFAULT_CREDENTIALS_PATH + class_option :credentials, type: :string, aliases: "-c", default: DEFAULT_CREDENTIALS_YAML private @@ -19,7 +19,25 @@ end def credentials + env_credentials || yaml_credentials + end + + def yaml_credentials YAML.load_file(options[:credentials]) + end + + def env_credentials + return unless env_var(:account) + { + "account" => env_var(:account), + "password" => env_var(:password), + "pin" => env_var(:pin), + "code_card" => env_var(:code_card).split(",") + } + end + + def env_var(key) + ENV["SHINSEIBANK_#{key.upcase}"] end end end
Allow passing credentials via environment variables
diff --git a/recipes/repository.rb b/recipes/repository.rb index abc1234..def5678 100644 --- a/recipes/repository.rb +++ b/recipes/repository.rb @@ -18,7 +18,7 @@ # case node['platform_family'] -when 'fedora', 'rhel', 'amazon' +when %w(centos redhat scientific oracle fedora amazon) include_recipe 'yum-atomic' when 'debian' package 'lsb-release'
Fix foodcritic warning for platforms (FC024)
diff --git a/fastlane/lib/update_native_sdks.rb b/fastlane/lib/update_native_sdks.rb index abc1234..def5678 100644 --- a/fastlane/lib/update_native_sdks.rb +++ b/fastlane/lib/update_native_sdks.rb @@ -26,6 +26,14 @@ mode: :append, text: "\n s.header_dir = \"Branch\"" ) + + other_action.apply_patch( + files: "#{ios_subdir}/Branch-SDK.podspec", + regexp: %r{(['"]Branch-SDK/)}, + mode: :replace, + text: '\1Branch-SDK/', + global: true + ) end def available_options
Adjust Branch-SDK paths relative to submodule
diff --git a/lib/dog.rb b/lib/dog.rb index abc1234..def5678 100644 --- a/lib/dog.rb +++ b/lib/dog.rb @@ -1,7 +1,12 @@ class Dog - attr_accessor :name + attr_accessor :name, :fangs def initialize(name="Pochi") @name = name + @fangs = 2 + end + + def alived? + true end end
Fix codes to pass tests
diff --git a/spec/sequence_spec.rb b/spec/sequence_spec.rb index abc1234..def5678 100644 --- a/spec/sequence_spec.rb +++ b/spec/sequence_spec.rb @@ -4,7 +4,7 @@ describe PGExaminer do it "should be able to tell when a sequence exists" do - a = examine "" + a = examine "SELECT 1" # No-op. b = examine <<-SQL CREATE SEQUENCE my_sequence;
Fix spec failure on JRuby.
diff --git a/lib/odo.rb b/lib/odo.rb index abc1234..def5678 100644 --- a/lib/odo.rb +++ b/lib/odo.rb @@ -17,6 +17,11 @@ html = Html.for url, considering: { assets: assets } + unless File.directory? target + FileUtils.mkdir_p target + end + + File.open("#{target}/index.html", 'w') { |f| f.write html } end end
Write the modified HTML to a file.
diff --git a/twg.gemspec b/twg.gemspec index abc1234..def5678 100644 --- a/twg.gemspec +++ b/twg.gemspec @@ -10,6 +10,6 @@ s.add_dependency 'cinch', '>= 2.0.5' s.add_dependency 'cinchize' - s.add_dependency 'i18n' + s.add_dependency 'i18n', '0.6.4' s.add_dependency 'httparty' end
Fix i18n gem to 0.6.4
diff --git a/spec/puppet-lint/plugins/ghostbuster_defines_spec.rb b/spec/puppet-lint/plugins/ghostbuster_defines_spec.rb index abc1234..def5678 100644 --- a/spec/puppet-lint/plugins/ghostbuster_defines_spec.rb +++ b/spec/puppet-lint/plugins/ghostbuster_defines_spec.rb @@ -11,35 +11,28 @@ end describe 'ghostbuster_defines' do - let(:path) { "./modules/foo/manifests/init.pp" } context 'with fix disabled' do context 'when define is used' do let(:code) { "define foo {}" } + let(:path) { "./modules/foo/manifests/init.pp" } - before :each do + it 'should not detect any problem' do expect_any_instance_of(PuppetDB::Client).to \ receive(:request).with('resources', [:'=', 'type', 'Foo']) - .and_return(PuppetDBRequest.new([ - { - 'type' => 'Foo', - 'title' => 'bar', - }, - ])) - end - - it 'should not detect any problem' do + .and_return(PuppetDBRequest.new([{}])) expect(problems).to have(0).problems end end context 'when define is not used' do - let(:code) { "define foo {}" } + let(:code) { "define bar {}" } + let(:path) { "./modules/bar/manifests/init.pp" } before :each do expect_any_instance_of(PuppetDB::Client).to \ - receive(:request).with('resources', [:'=', 'type', 'Foo']) + receive(:request).with('resources', [:'=', 'type', 'Bar']) .and_return(PuppetDBRequest.new([])) end @@ -48,7 +41,7 @@ end it 'should create a warning' do - expect(problems).to contain_warning('Define Foo seems unused') + expect(problems).to contain_warning('Define Bar seems unused') end end end
Revert ghostbuster_defines unit test logic
diff --git a/spec/serializers/all_aboard/board_serializer_spec.rb b/spec/serializers/all_aboard/board_serializer_spec.rb index abc1234..def5678 100644 --- a/spec/serializers/all_aboard/board_serializer_spec.rb +++ b/spec/serializers/all_aboard/board_serializer_spec.rb @@ -4,5 +4,6 @@ let(:board) { FactoryGirl.create(:board, name: "Test Board Name") } subject { AllAboard::BoardSerializer.new(board).as_json[:board] } + its([:id]) { should eq(board.id) } its([:name]) { should eq("Test Board Name") } end
Add missing spec for board ID in serializer. Forgot to add that as I was handfighting Ember.
diff --git a/lib/docs/scrapers/react_native.rb b/lib/docs/scrapers/react_native.rb index abc1234..def5678 100644 --- a/lib/docs/scrapers/react_native.rb +++ b/lib/docs/scrapers/react_native.rb @@ -3,7 +3,7 @@ self.name = 'React Native' self.slug = 'react_native' self.type = 'react' - self.release = '0.34' + self.release = '0.35' self.base_url = 'https://facebook.github.io/react-native/docs/' self.root_path = 'getting-started.html' self.links = {
Update React Native documentation (0.35)
diff --git a/lib/reek/logging_error_handler.rb b/lib/reek/logging_error_handler.rb index abc1234..def5678 100644 --- a/lib/reek/logging_error_handler.rb +++ b/lib/reek/logging_error_handler.rb @@ -10,7 +10,7 @@ when Errors::BaseError warn exception.long_message else - warn exception + warn exception.message end true end
Make conversion from exception to string explicit JRuby does not perform automatic conversion from RuntimeError to String.