diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/lib/trawler/sources/readmill/fetcher_spec.rb b/spec/lib/trawler/sources/readmill/fetcher_spec.rb index abc1234..def5678 100644 --- a/spec/lib/trawler/sources/readmill/fetcher_spec.rb +++ b/spec/lib/trawler/sources/readmill/fetcher_spec.rb @@ -1,35 +1,41 @@-require 'spec_helper' -require 'ostruct' +require "spec_helper" +require "ostruct" describe Trawler::Sources::Readmill::Fetcher do - let(:client_id) { 'client-id' } - let(:parser) { double('parser', call: nil) } + let(:client_id) { "client-id" } + let(:parser) { double("parser", call: parsed_highlights) } + let(:parsed_highlights) { [] } let(:fetcher) { Trawler::Sources::Readmill::Fetcher.new(client_id, parser) } - describe '#highlights_for_user' do + describe "#highlights_for_user" do let(:response) { OpenStruct.new(code: 200, parsed_response: {}) } - it 'fetches highlights from Readmill for the user' do - HTTParty.stub(:get).and_return(OpenStruct.new(code: 200, body: '')) - - fetcher.highlights_for_user('user-id') - - expect(HTTParty).to have_received(:get).with('https://api.readmill.com/v2/users/user-id/highlights?client_id=client-id&count=100') + before(:each) do + allow(HTTParty).to receive(:get).and_return { response } end - it 'passes the parsed response to the highlight parser' do - HTTParty.stub(:get).and_return(OpenStruct.new(code: 200, parsed_response: {})) + context "when there is an error response" do + let(:response) { OpenStruct.new(code: 500, parsed_response: {}) } - fetcher.highlights_for_user('user-id') + it "raises an error" do + expect { fetcher.highlights_for_user("user-id")}.to raise_error + end + end + it "fetches highlights from Readmill for the user via HTTP" do + fetcher.highlights_for_user("user-id") + expect(HTTParty).to have_received(:get).with("https://api.readmill.com/v2/users/user-id/highlights?client_id=client-id&count=100") + end + + it "parses the json response" do + fetcher.highlights_for_user("user-id") expect(parser).to have_received(:call).with({}) end - it 'raises if there is an error fetching' do - HTTParty.stub(:get).and_return(OpenStruct.new(code: 500, parsed_response: {})) - - expect { fetcher.highlights_for_user('user-id')}.to raise_error + it "returns the parsed highlights" do + result = fetcher.highlights_for_user("user-id") + expect(result).to eq parsed_highlights end end end
Tweak the readmill fetcher spec
diff --git a/lib/commonjs/module.rb b/lib/commonjs/module.rb index abc1234..def5678 100644 --- a/lib/commonjs/module.rb +++ b/lib/commonjs/module.rb @@ -13,7 +13,7 @@ end def require_function - @require_function ||= lambda do |this, module_id| + @require_function ||= lambda do |this, module_id = nil| module_id ||= this #backwards compatibility with TRR < 0.10 @env.require(expand(module_id)) end
Fix require method exposed to JS for TRR < 0.10
diff --git a/ipinfodb.gemspec b/ipinfodb.gemspec index abc1234..def5678 100644 --- a/ipinfodb.gemspec +++ b/ipinfodb.gemspec @@ -2,22 +2,24 @@ $:.push File.expand_path("../lib", __FILE__) require 'ipinfodb/version' -Gem::Specification.new do |s| - s.name = "ipinfodb" - s.version = Ipinfodb::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Tomasz Mazur"] - s.email = ["defkode@gmail.com"] - s.homepage = "http://ipinfodb.com" - s.summary = %q{Free IP address geolocation tools} - s.description = %q{Free IP address geolocation tools} +Gem::Specification.new do |gem| + gem.name = "ipinfodb" + gem.version = Ipinfodb::VERSION + gem.platform = Gem::Platform::RUBY + gem.authors = ["Tomasz Mazur"] + gem.email = ["defkode@gmail.com"] + gem.homepage = "http://ipinfodb.com" + gem.summary = %q{Free IP address geolocation tools} + gem.description = %q{Free IP address geolocation tools} - s.rubyforge_project = "ipinfodb" + gem.rubyforge_project = "ipinfodb" - 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"] - - s.add_dependency('httparty', '~> 0.6') + gem.files = `git ls-files`.split("\n") + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } + gem.require_paths = ["lib"] + + gem.add_dependency('httparty', '~> 0.6') + + gem.add_development_dependency('rake') end
Add 'rake' as development dependency
diff --git a/lib/deep_cover/core_ext/load_overrides.rb b/lib/deep_cover/core_ext/load_overrides.rb index abc1234..def5678 100644 --- a/lib/deep_cover/core_ext/load_overrides.rb +++ b/lib/deep_cover/core_ext/load_overrides.rb @@ -3,22 +3,20 @@ # For now, this is not used, and may never be. The tracking and reporting for things can might be # loaded multiple times can be complex and is beyond the current scope of the project. -class << Kernel - alias_method :load_without_coverage, :load - def load(path, wrap = false) - return load_without_coverage(path, wrap) if wrap +module DeepCover + module LoadOverride + def load(path, wrap = false) + return load_without_deep_cover(path, wrap) if wrap - result = DeepCover.custom_requirer.load(path) - if [:not_found, :cover_failed, :not_supported].include?(result) - load_without_coverage(path) - else - result + result = DeepCover.custom_requirer.load(path) + if [:not_found, :cover_failed, :not_supported].include?(result) + load_without_deep_cover(path) + else + result + end end end + + extend ModuleOverride + override ::Kernel, ::Kernel.singleton_class end - -module Kernel - def load(path, wrap = false) - Kernel.require(path, wrap) - end -end
Fix load override, even though we might not need it
diff --git a/spree_redbox.gemspec b/spree_redbox.gemspec index abc1234..def5678 100644 --- a/spree_redbox.gemspec +++ b/spree_redbox.gemspec @@ -4,7 +4,7 @@ s.name = 'spree_redbox' s.version = '2.2' s.summary = 'Spree extenstion for redbox' - s.required_ruby_version = '>= 1.9.3' + s.required_ruby_version = '>= 2.0.0' s.author = 'Jakub Kubacki' s.email = 'kubacki.jk@gmail.com'
Update ruby version in gemspec.
diff --git a/lookup.gemspec b/lookup.gemspec index abc1234..def5678 100644 --- a/lookup.gemspec +++ b/lookup.gemspec @@ -17,7 +17,7 @@ s.add_development_dependency "rspec", "~> 2.1" s.add_development_dependency "webmock", "~> 1.6" - s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.5"]) + s.add_dependency(%q<sqlite3>, [">= 1.2.5"]) s.add_dependency(%q<nokogiri>, [">= 0"]) s.add_dependency(%q<activerecord>, [">= 2.3.8"])
Use the sqlite3 gem rather than sqlite3-ruby
diff --git a/test/bug_163/test_runner_rewrite.rb b/test/bug_163/test_runner_rewrite.rb index abc1234..def5678 100644 --- a/test/bug_163/test_runner_rewrite.rb +++ b/test/bug_163/test_runner_rewrite.rb @@ -8,27 +8,28 @@ class TestRunnerRewrite < Minitest::Test def setup @ruby_rewrite = BASE_DIR.expand_path + '../bin/ruby-rewrite' - @tmp_dir = BASE_DIR + 'tmp' @test_dir = BASE_DIR + 'bug_163' @fixtures_dir = @test_dir + 'fixtures' - FileUtils.mkdir_p(@tmp_dir) end def test_rewriter - sample_file = @tmp_dir + 'bug_163.rb' - sample_file_expanded = sample_file.expand_path - expected_file = @fixtures_dir + 'output.rb' + Dir.mktmpdir(nil, BASE_DIR.expand_path.to_s) do |tmp_dir| + tmp_dir = Pathname.new(tmp_dir) + sample_file = tmp_dir + 'bug_163.rb' + sample_file_expanded = sample_file.expand_path + expected_file = @fixtures_dir + 'output.rb' - FileUtils.cp(@fixtures_dir + 'input.rb', @tmp_dir + 'bug_163.rb') - FileUtils.cd @test_dir do - exit_code = system %Q{ - #{Shellwords.escape(@ruby_rewrite.to_s)} --modify \ - -l rewriter.rb \ - #{Shellwords.escape(sample_file_expanded.to_s)} - } + FileUtils.cp(@fixtures_dir + 'input.rb', tmp_dir + 'bug_163.rb') + FileUtils.cd @test_dir do + exit_code = system %Q{ + #{Shellwords.escape(@ruby_rewrite.to_s)} --modify \ + -l rewriter.rb \ + #{Shellwords.escape(sample_file_expanded.to_s)} + } + end + + assert File.read(expected_file.expand_path) == File.read(sample_file), + "#{sample_file} should be identical to #{expected_file}" end - - assert File.read(expected_file.expand_path) == File.read(sample_file), - "#{sample_file} should be identical to #{expected_file}" end end
Use `Dir.mktmpdir` instead of `FileUtils.mkdir`.
diff --git a/lib/ec2list/command.rb b/lib/ec2list/command.rb index abc1234..def5678 100644 --- a/lib/ec2list/command.rb +++ b/lib/ec2list/command.rb @@ -42,7 +42,7 @@ def load_profile unless profile = AWSConfig[options[:profile]] - raise RuntimeError, "Can't locate profile '#{options[:profile]}' in ~/.aws/config" + abort "Can't locate profile '#{options[:profile]}' in ~/.aws/config" end AWS.config(profile.config_hash)
Abort when specified profile not found, don't raise
diff --git a/lib/email_validator.rb b/lib/email_validator.rb index abc1234..def5678 100644 --- a/lib/email_validator.rb +++ b/lib/email_validator.rb @@ -1,4 +1,10 @@ # This is a shim for keeping backwards compatibility. # See the discussion in: https://github.com/lisinge/valid_email2/pull/79 class EmailValidator < ValidEmail2::EmailValidator + def validate_each(record, attribute, value) + warn "DEPRECATION WARNING: The email validator from valid_email2 has been " + + "deprecated in favour of using the namespaced 'valid_email_2/email' validator. " + + "For more information see https://github.com/lisinge/valid_email2#upgrading-to-v200" + super + end end
Add deprecation warning to EmailValidator
diff --git a/southpaw.gemspec b/southpaw.gemspec index abc1234..def5678 100644 --- a/southpaw.gemspec +++ b/southpaw.gemspec @@ -20,7 +20,7 @@ spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec", "~> 3.0.0" + spec.add_development_dependency "rspec", "~> 3.0" spec.add_runtime_dependency "rack", "~> 1.5" spec.add_runtime_dependency "escape_utils", "~> 1.0" spec.add_runtime_dependency "uri_template", "~> 0.7"
Correct the rspec version specification.
diff --git a/test_apps/rails/spec/workers/test_worker_spec.rb b/test_apps/rails/spec/workers/test_worker_spec.rb index abc1234..def5678 100644 --- a/test_apps/rails/spec/workers/test_worker_spec.rb +++ b/test_apps/rails/spec/workers/test_worker_spec.rb @@ -4,7 +4,7 @@ require "sneakers/runner" require "external_sneaker" -describe TestWorker do +describe TestWorker, :skip do include FileHelper let(:message) do {
Put back the skip on the flaky test
diff --git a/db/migrate/20190212171602_change_data_request_id_to_bigint.rb b/db/migrate/20190212171602_change_data_request_id_to_bigint.rb index abc1234..def5678 100644 --- a/db/migrate/20190212171602_change_data_request_id_to_bigint.rb +++ b/db/migrate/20190212171602_change_data_request_id_to_bigint.rb @@ -0,0 +1,11 @@+class ChangeDataRequestIdToBigint < ActiveRecord::Migration[6.0] + def up + change_column :data_request_reviews, :data_request_id, :bigint + change_column :supporting_documents, :data_request_id, :bigint + end + + def down + change_column :data_request_reviews, :data_request_id, :integer + change_column :supporting_documents, :data_request_id, :integer + end +end
Update data_request_id foreign key to bigint
diff --git a/webapp/db/migrate/20111214182014_unique_live_form_template.rb b/webapp/db/migrate/20111214182014_unique_live_form_template.rb index abc1234..def5678 100644 --- a/webapp/db/migrate/20111214182014_unique_live_form_template.rb +++ b/webapp/db/migrate/20111214182014_unique_live_form_template.rb @@ -1,5 +1,31 @@ class UniqueLiveFormTemplate < ActiveRecord::Migration def self.up + execute %{ + UPDATE forms + SET status = 'Inactive' + FROM ( + SELECT DISTINCT ON (template_id) template_id, id + FROM forms + WHERE + status = 'Live' AND + template_id IN ( + SELECT template_id + FROM ( + SELECT template_id, count(*) + FROM forms + WHERE status = 'Live' + GROUP BY template_id + HAVING count(*) > 1 + ) foo + ) + ORDER BY template_id, version DESC + ) bar + WHERE + bar.template_id = forms.template_id AND + bar.id != forms.id AND + forms.status = 'Live' + RETURNING forms.id; + } execute "CREATE UNIQUE INDEX unique_live_form_template ON forms (template_id) WHERE status = 'Live'" end
Add code to fix already-broken databases that would otherwise fail this migration If you've already migrated to this point, it's ok to continue without these code changes; you didn't need them anyway.
diff --git a/app/models/appointment.rb b/app/models/appointment.rb index abc1234..def5678 100644 --- a/app/models/appointment.rb +++ b/app/models/appointment.rb @@ -11,8 +11,7 @@ cancelled_by_pension_wise ) - before_validation :calculate_fulfilment_time, if: :proceeded_at_changed? - before_validation :calculate_fulfilment_window, if: :proceeded_at_changed? + before_validation :calculate_statistics, if: :proceeded_at_changed? belongs_to :booking_request @@ -31,6 +30,11 @@ def notify? previous_changes.exclude?(:status) + end + + def calculate_statistics + calculate_fulfilment_time + calculate_fulfilment_window end private
Make statistics calculation general purpose There's no point calling these things seperately.
diff --git a/app/models/club_member.rb b/app/models/club_member.rb index abc1234..def5678 100644 --- a/app/models/club_member.rb +++ b/app/models/club_member.rb @@ -1,7 +1,7 @@ class ClubMember < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable - devise :registerable, :rememberable, :trackable, :omniauthable + devise :registerable, :trackable, :omniauthable def self.from_omniauth(auth) where(provider: auth.provider, uid: auth.uid).first_or_create do |club_member| club_member.provider = auth.provider
Make club members not rememberable
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 @@ -4,8 +4,11 @@ require "minitest/autorun" require "rack/test" require "pry" +require "securerandom" require_relative "db" + +ENV["SESSION_SECRET"] = SecureRandom.uuid def assert_method_called_on_member(subject, member, method, args=[]) mock = MiniTest::Mock.new
Set a session secret even in test so that we don't get warnings
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 @@ -38,8 +38,6 @@ end def teardown - Dir[File.join(TMP_PATH, '*')].each do |file| - File.delete(file) if File.exists?(file) - end + Dir[File.join(TMP_PATH, '*')].each { |f| File.delete(f) } end -end +end
Revert "Remove if file exists" This reverts commit 8360f7dd3b1abe7d966a80214aa624b0eb5e5bed.
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 @@ -2,6 +2,9 @@ require 'minitest/autorun' require 'active_record' require 'database_cleaner' + +require 'fileutils' +FileUtils::mkdir_p '/tmp/uploads' # ActiveRecord Connection # ActiveRecord::Base.logger = Logger.new(STDERR)
Create /tmp/uploads so worker tests can pass
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,5 +1,5 @@ require "minitest/autorun" require "minitest/spec" -require "mocha" +require "mocha/setup" require "buffered_logger"
Update mocha require to mocha/setup
diff --git a/lib/motion/distance.rb b/lib/motion/distance.rb index abc1234..def5678 100644 --- a/lib/motion/distance.rb +++ b/lib/motion/distance.rb @@ -39,7 +39,7 @@ @location_manager ||= begin manager = CLLocationManager.alloc.init - manager.desiredAccuracy = self.accuracy ||= KCLLocationAccuracyBest + manager.desiredAccuracy = self.accuracy || KCLLocationAccuracyBest manager.activityType = self.activity_type || CLActivityTypeOther manager.delegate = self manager
Fix typo in location manager.
diff --git a/app/controllers/about_loa1_controller.rb b/app/controllers/about_loa1_controller.rb index abc1234..def5678 100644 --- a/app/controllers/about_loa1_controller.rb +++ b/app/controllers/about_loa1_controller.rb @@ -1,4 +1,8 @@+require 'partials/viewable_idp_partial_controller' + class AboutLoa1Controller < ApplicationController + include ViewableIdpPartialController + layout 'slides', except: [:choosing_a_company] def index
TT-1766: Fix merge conflict by including ViewableIdpPartialController Authors: 30e32bebb47edfdde2fee768480b7a9867c83640@rachelthecodesmith
diff --git a/spec/features/articles/show_spec.rb b/spec/features/articles/show_spec.rb index abc1234..def5678 100644 --- a/spec/features/articles/show_spec.rb +++ b/spec/features/articles/show_spec.rb @@ -13,9 +13,8 @@ end scenario 'saves the reading progress', js: true do - expect { - page.execute_script 'window.scrollBy(0, 100)' - sleep 2.5 - }.to change(article.positions, :count).by(1) + page.execute_script 'window.scrollBy(0, 100)' + sleep 2.5 + expect(page).to have_content('SENT!') end end
Check for SENT! message in article JS test
diff --git a/app/controllers/submission_controller.rb b/app/controllers/submission_controller.rb index abc1234..def5678 100644 --- a/app/controllers/submission_controller.rb +++ b/app/controllers/submission_controller.rb @@ -1,6 +1,6 @@ class SubmissionController < ApplicationController before_filter :clean_submissions, :only => :create - before_filter :submitter? + before_filter :_submitter? allow_param({ :submission => [
Fix that, it should be _submitter?
diff --git a/app/models/threadable/emails/validate.rb b/app/models/threadable/emails/validate.rb index abc1234..def5678 100644 --- a/app/models/threadable/emails/validate.rb +++ b/app/models/threadable/emails/validate.rb @@ -6,7 +6,7 @@ @errors = [] Array(email.smtp_envelope_from).each do |address| - (ValidateEmailAddress.call(address) || address.empty?) or invalid! "envelope from address: #{address.inspect}" + (ValidateEmailAddress.call(address) || address == '<>') or invalid! "envelope from address: #{address.inspect}" end Array(email.smtp_envelope_to).each do |address|
Update email address validation checking for explicit null sender (<>)
diff --git a/lib/active_model/serializable.rb b/lib/active_model/serializable.rb index abc1234..def5678 100644 --- a/lib/active_model/serializable.rb +++ b/lib/active_model/serializable.rb @@ -1,13 +1,5 @@ module ActiveModel module Serializable - def meta_key - options[:meta_key].try(:to_sym) || :meta - end - - def include_meta(hash) - hash[meta_key] = options[:meta] if options.has_key?(:meta) - end - def as_json(args={}) if root = args[:root] || options[:root] options[:hash] = hash = {} @@ -30,5 +22,15 @@ super end end + + private + + def include_meta(hash) + hash[meta_key] = options[:meta] if options.has_key?(:meta) + end + + def meta_key + options[:meta_key].try(:to_sym) || :meta + end end end
Make include_meta and meta_key private
diff --git a/app/view_models/live_effort_mail_data.rb b/app/view_models/live_effort_mail_data.rb index abc1234..def5678 100644 --- a/app/view_models/live_effort_mail_data.rb +++ b/app/view_models/live_effort_mail_data.rb @@ -31,7 +31,7 @@ split_times.each do |split_time| result << {split_id: split_time.split_id, split_name: split_time.split_name, - day_and_time: split_time.day_and_time.strftime("%B %-d, %Y %l:%M%p"), + day_and_time: split_time.day_and_time.strftime("%A, %B %-d, %Y %l:%M%p"), pacer: split_time.pacer} end result
Add weekday to reported times in email follower reporting.
diff --git a/lib/zebra/print_job.rb b/lib/zebra/print_job.rb index abc1234..def5678 100644 --- a/lib/zebra/print_job.rb +++ b/lib/zebra/print_job.rb @@ -14,7 +14,8 @@ @printer = printer end - def print(label) + def print(label, ip) + @remote_ip = ip tempfile = label.persist send_to_printer tempfile.path end @@ -28,13 +29,8 @@ def send_to_printer(path) puts "* * * * * * * * * * * * * * * * * * * * * * * * Sending file to printer #{@printer} * * * * * * * * * * * * * * * * * * * * * * * * * " - # My ip is 192.168.101.99 - `lp -h 192.168.101.128 -d #{@printer} -o raw #{path}` - # if RUBY_PLATFORM =~ /darwin/ - # `lpr -h 192.168.101.99 -P #{@printer} -o raw #{path}` - # else - # `lp -h 192.168.101.99 -d #{@printer} -o raw #{path}` - # end + `lp -h #{@remote_ip} -d #{@printer} -o raw #{path}` + end end end
Send job to requester ip
diff --git a/lib/facter/virtualenv_version.rb b/lib/facter/virtualenv_version.rb index abc1234..def5678 100644 --- a/lib/facter/virtualenv_version.rb +++ b/lib/facter/virtualenv_version.rb @@ -6,7 +6,7 @@ has_weight 100 setcode do begin - Facter::Util::Resolution.exec('virtualenv --version') + Facter::Util::Resolution.exec('virtualenv --version') || "absent" rescue false end
Return 'absent' instead of nil
diff --git a/lib/lastfm/api_classes/artist.rb b/lib/lastfm/api_classes/artist.rb index abc1234..def5678 100644 --- a/lib/lastfm/api_classes/artist.rb +++ b/lib/lastfm/api_classes/artist.rb @@ -4,6 +4,9 @@ :get_podcast, :get_shouts, :get_similar, :get_top_albums, :get_top_fans, :get_top_tags, :gettoptracks, :search - restricted_methods :add_tags, :get_tags, :remove_tag, :share, :shout + restricted_methods do + read :get_tags + write :add_tags, :remove_tag, :share, :shout + end end end
Split restricted_methods into "read" and "write"
diff --git a/lib/simplest_photo/url_helper.rb b/lib/simplest_photo/url_helper.rb index abc1234..def5678 100644 --- a/lib/simplest_photo/url_helper.rb +++ b/lib/simplest_photo/url_helper.rb @@ -20,10 +20,16 @@ end config.before_serve do |job, env| - photo = Photo.with_image_uid!(job.uid) - uid = job.store + existing = PhotoCropping.find_by(signature: job.signature) - PhotoCropping.create!(photo: photo, uid: uid, signature: job.signature) + if existing + throw :halt, [301, { 'Location' => job.app.remote_url_for(existing.uid) }, [""]] + else + photo = Photo.with_image_uid!(job.uid) + uid = job.store + + PhotoCropping.create!(photo: photo, uid: uid, signature: job.signature) + end end end
Handle multiple requests for cropping w/ redirect
diff --git a/lib/tasks/republish_manuals.rake b/lib/tasks/republish_manuals.rake index abc1234..def5678 100644 --- a/lib/tasks/republish_manuals.rake +++ b/lib/tasks/republish_manuals.rake @@ -2,9 +2,11 @@ require "logger" desc "Republish manuals" -task :republish_manuals, [:slug] => :environment do |_, args| +task :republish_manuals, %i[user_email slug] => :environment do |_, args| logger = Logger.new(STDOUT) logger.formatter = Logger::Formatter.new + + user = User.find_by(email: args[:user_email]) manuals = if args.has_key?(:slug) [Manual.find_by_slug!(args[:slug], user)]
Fix the republish manuals rake task Previously, it would fail as user isn't defined. Now you can provide an email address, and it will republish using that user. I believe this has been broken for a while, ever since e838d066257fd3372e5bd3a6215848753597ed47. I'm looking at this as part of investigating data anomalies in the Content Performance Manager, as the guidance/the-highway-code manual was republished back in 2017, and was sent through without a public_updated_at value.
diff --git a/yesand/app/controllers/application_controller.rb b/yesand/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/yesand/app/controllers/application_controller.rb +++ b/yesand/app/controllers/application_controller.rb @@ -10,4 +10,8 @@ def current_user @_current_user ||= User.find(session[:user_id]) if session[:user_id] end + + def find_idea(id) + Idea.find_by(id: id) + end end
Add find_idea helper to abstract Idea away from controller
diff --git a/test/esignatur/esignatur_test.rb b/test/esignatur/esignatur_test.rb index abc1234..def5678 100644 --- a/test/esignatur/esignatur_test.rb +++ b/test/esignatur/esignatur_test.rb @@ -16,5 +16,15 @@ assert_kind_of Array, result["PendingOrders"] end end + + def test_order_status + VCR.use_cassette('order_status') do + headers = {'Content-Type' => 'application/json', + 'X-Esignatur-Id' => '1aa6f55d-5724-e411-899d-d89d67640044'} + client = Esignatur::APIClient.new(headers) + result = client.order_status("info@kreditmatch.dk", "c00771af-359c-4628-a72d-185d20f4e608") + assert_kind_of Hash, result + end + end end
Test for order status API call
diff --git a/spec/flipper/adapters/active_record_requires_spec.rb b/spec/flipper/adapters/active_record_requires_spec.rb index abc1234..def5678 100644 --- a/spec/flipper/adapters/active_record_requires_spec.rb +++ b/spec/flipper/adapters/active_record_requires_spec.rb @@ -0,0 +1,5 @@+# This nominally-empty spec ensures that the file "flipper-active_record.rb" can be +# required without error, and guards against regressions of the kind fixed in +# https://github.com/jnunemaker/flipper/pull/437. + +require "flipper-active_record.rb"
Add spec testing require of flipper-active_record.rb This will guard against regressions like that fixed in #437.
diff --git a/slurper.gemspec b/slurper.gemspec index abc1234..def5678 100644 --- a/slurper.gemspec +++ b/slurper.gemspec @@ -2,15 +2,14 @@ Gem::Specification.new do |gem| gem.name = "slurper" - gem.version = "2.0.0" + gem.version = "2.1.0" gem.license = "MIT" - gem.authors = ["Adam Lowe", "Paul Elliott", "Taylor Mock"] + gem.authors = ["Adam Lowe", "Paul Elliott", "Taylor Mock", "Chris Erin"] gem.description = "Slurps stories from the given file (stories.slurper by default) and creates Pivotal Tracker stories from them. Useful during story carding sessions when you want to capture a number of stories quickly without clicking your way through the Tracker UI." gem.email = "dev@hashrocket.com" gem.executables = ["slurp"] - gem.extra_rdoc_files = ["README.rdoc"] - gem.files = Dir.glob("lib/**/*") + %w(bin/slurp MIT_LICENSE README.rdoc Rakefile) + gem.files = Dir.glob("lib/**/*") + %w(bin/slurp MIT_LICENSE README.md Rakefile) gem.homepage = "http://github.com/hashrocket/slurper" gem.rdoc_options = ["--charset=UTF-8"] gem.require_path = "lib"
Bump Version && Update Gemspec Co-authored-by: Chris Erin <616b74d5888ada3e51dc8f8c8c98902b4a8a2d03@gmail.com>
diff --git a/CalWebViewApp/features/support/01_launch.rb b/CalWebViewApp/features/support/01_launch.rb index abc1234..def5678 100644 --- a/CalWebViewApp/features/support/01_launch.rb +++ b/CalWebViewApp/features/support/01_launch.rb @@ -18,11 +18,19 @@ end Before do |_| - #RunLoop::SimControl.new.reset_sim_content_and_settings launcher = LaunchControl.launcher - #launcher.run_loop = nil + + options = { + # Physical devices: default is :host + # Xcode < 7.0: default is :prefences + # Xcode >= 7.0: default is :host + # :uia_strategy => :shared_element, + # :uia_strategy => :preferences, + # :uia_strategy => :host + :relaunch_simulator => false, + } unless launcher.active? - LaunchControl.launcher.relaunch({:relaunch_simulator => false}) + LaunchControl.launcher.relaunch(options) LaunchControl.launcher.calabash_notify(self) end end
Clarify the default :uia_strategy with a comment
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,7 +1,7 @@ name 'libuuid-user' maintainer 'Chef Software, Inc.' maintainer_email 'cookbooks@chef.io' -license 'Apache 2.0' +license 'Apache-2.0' description 'Set a non-login shell for the libuuid user on Ubuntu/Debian and validate that it is correct.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '1.0.1'
Use SPDX standard license string Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -2,8 +2,8 @@ maintainer 'John Bellone' maintainer_email 'jbellone@bloomberg.net' license 'Apache v2.0' -description 'Installs/Configures consul' -long_description 'Installs/Configures consul' +description 'Installs/Configures Consul client, server and UI.' +long_description 'Installs/Configures Consul client, server and UI.' version '0.6.0' recipe 'consul', 'Installs and starts consul service.' @@ -21,8 +21,9 @@ supports 'ubuntu', '= 12.04' supports 'ubuntu', '= 14.04' +suggests 'chef-provisioning' + depends 'ark' -depends 'chef-provisioning' depends 'golang', '~> 1.3.0' depends 'runit' depends 'yum-repoforge'
Make chef-provisioning cookbook a weak dependency. This is only suggested if you want to use chef-provisioning to start a cluster using the recipe in the root of the directory.
diff --git a/lib-aws-sdk.rb b/lib-aws-sdk.rb index abc1234..def5678 100644 --- a/lib-aws-sdk.rb +++ b/lib-aws-sdk.rb @@ -0,0 +1,36 @@+class LibAwsSdk < Formula + url "https://github.com/awslabs/aws-sdk-cpp/archive/0.9.6.tar.gz" + sha256 "2d26995974eb03b6ba6d26c32f9956e95d5a3d0db6b5fa149a2df7e4773112f4" + homepage "http://aws.amazon.com/" + + option "with-s3", + "Build s3 client" + option "with-ec2", + "Build ec2 client" + option "with-custom-memory-management", + "Build with custom memory management" + + depends_on "cmake" => :build + + def install + clients = [] + clients << 'aws-cpp-sdk-s3' if build.with? "s3" + clients << 'aws-cpp-sdk-ec2' if build.with? "ec2" + + args = std_cmake_args + args << '-DCUSTOM_MEMORY_MANAGEMENT=' + build.with? "custom-memory-management" 1 else 0 + if clients.any? + args << 'BUILD_ONLY=' + clients.join(';') + end + + mkdir "build" do + system "cmake", "..", *args + system "make" + system "make", "install" + end + + test do + raise + end + +end
Add very initial aws-sdk homebrew formula.
diff --git a/lib/dctvbot.rb b/lib/dctvbot.rb index abc1234..def5678 100644 --- a/lib/dctvbot.rb +++ b/lib/dctvbot.rb @@ -24,9 +24,10 @@ end end - def custom_log_file(file_name, log_level) + # Set a custom log file for the bot + def custom_log_file(file_name, log_level=:info) file = open(file_name, 'a') - file.sync = true + file.sync = true # Write buffered data immediately self.loggers << Cinch::Logger::FormattedLogger.new(file) self.loggers.first.level = log_level end
Set default log level for custom log
diff --git a/lib/ransack.rb b/lib/ransack.rb index abc1234..def5678 100644 --- a/lib/ransack.rb +++ b/lib/ransack.rb @@ -26,4 +26,6 @@ Ransack::Adapters.object_mapper.require_adapter -ActionController::Base.helper Ransack::Helpers::FormHelper +ActiveSupport.on_load(:action_controller) do + ActionController::Base.helper Ransack::Helpers::FormHelper +end
Use lazy load hooks to hook on ActionController::Base - Calling directly `ActionController::Base` affects the initialization process (one of them being one that controls ActionController [configuration](https://github.com/rails/rails/blob/aa6bcbbac8517d5b077f21073e9902637d7c7157/actionpack/lib/action_controller/railtie.rb#L53-L67)) - As a result setting configuration inside an initializer (such as the asset_host), won't have any effect
diff --git a/telebot.gemspec b/telebot.gemspec index abc1234..def5678 100644 --- a/telebot.gemspec +++ b/telebot.gemspec @@ -14,7 +14,7 @@ spec.homepage = "https://github.com/greyblake/telebot" spec.license = "MIT" - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.files = Dir['./lib/**/*.rb'] spec.require_paths = ["lib"] spec.add_dependency "faraday"
Include only lib files into gem
diff --git a/test/functional/omniauth_callbacks_controller_test.rb b/test/functional/omniauth_callbacks_controller_test.rb index abc1234..def5678 100644 --- a/test/functional/omniauth_callbacks_controller_test.rb +++ b/test/functional/omniauth_callbacks_controller_test.rb @@ -4,18 +4,18 @@ include Devise::TestHelpers setup do - request.env["devise.mapping"] = Devise.mappings[:user] - request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:github] + request.env["devise.mapping"] = Devise.mappings[:user] + request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:github] end - should "make user feel good when legit email address" do + test "make user feel good when legit email address" do stub_oauth_user('legit@legit.com') get :github assert flash[:notice] == I18n.t("devise.omniauth_callbacks.success", :kind => "GitHub") end - should "redirect to user page and inform when bad e-mail address" do + test "redirect to user page and inform when bad e-mail address" do user = stub_oauth_user('awful e-mail address') get :github assert flash[:notice] == I18n.t("devise.omniauth_callbacks.bad_email_success",
Remove 'should' from omniuath_callbacks tests
diff --git a/test/spec/libraries/consul_installation_webui_spec.rb b/test/spec/libraries/consul_installation_webui_spec.rb index abc1234..def5678 100644 --- a/test/spec/libraries/consul_installation_webui_spec.rb +++ b/test/spec/libraries/consul_installation_webui_spec.rb @@ -30,6 +30,8 @@ it do is_expected.to unzip_zipfile('consul_0.7.0_web_ui.zip') .with( + checksum: '42212089c228a73a0881a5835079c8df58a4f31b5060a3b4ffd4c2497abe3aa8', + path: '/opt/consul-webui/0.7.0', source: 'https://releases.hashicorp.com/consul/0.7.0/consul_0.7.0_web_ui.zip' ) end
Revert "Remove some test parameters" This reverts commit da50fb52273f435e6fc5c8f94aa3d1a06672ab89.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -15,7 +15,7 @@ depends 'redis' depends 'nodejs' depends 'openresty' -depends 'serf', '0.2.0' +depends 'serf', '0.3.0' depends 'gitreceive' depends 'sysdig' depends 'etcd'
Update to newer Serf cookbook.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,7 +1,7 @@ name 'asp_core' -maintainer 'The Authors' -maintainer_email 'you@example.com' -license 'all_rights' +maintainer 'Dan Webb' +maintainer_email 'dan.webb@damacus.io' +license 'Apache v2.0' description 'Installs/Configures asp_core' long_description 'Installs/Configures asp_core' version '0.1.0'
Change licence and author details
diff --git a/lib/arel/crud.rb b/lib/arel/crud.rb index abc1234..def5678 100644 --- a/lib/arel/crud.rb +++ b/lib/arel/crud.rb @@ -41,17 +41,6 @@ InsertManager.new @engine end - # FIXME: this method should go away - def insert values - if $VERBOSE - warn <<-eowarn -insert (#{caller.first}) is deprecated and will be removed in Arel 4.0.0. Please -switch to `compile_insert` - eowarn - end - @engine.connection.insert compile_insert(values).to_sql - end - def compile_delete dm = DeleteManager.new @engine dm.wheres = @ctx.wheres
Remove deprecated calls to `insert` with preference to using `compile_insert` and then calling `to_sql` on the resulting object to execute the SQL
diff --git a/.delivery/build/cookbooks/delivery-red-pill/metadata.rb b/.delivery/build/cookbooks/delivery-red-pill/metadata.rb index abc1234..def5678 100644 --- a/.delivery/build/cookbooks/delivery-red-pill/metadata.rb +++ b/.delivery/build/cookbooks/delivery-red-pill/metadata.rb @@ -7,3 +7,4 @@ version '0.1.0' depends 'delivery-truck' +depends 'delivery-sugar'
Add dependency to delivery-sugar for delivery-red-pill
diff --git a/doc/ex/affine_transform.rb b/doc/ex/affine_transform.rb index abc1234..def5678 100644 --- a/doc/ex/affine_transform.rb +++ b/doc/ex/affine_transform.rb @@ -3,10 +3,10 @@ # Demonstrate the Image#affine_transform method +img = Magick::Image.read("images/Flower_Hat.jpg").first + # Construct a simple affine matrix -flipflop = Magick::AffineMatrix.new(-1, Math::PI/6, Math::PI/6, -1, 0, 0) - -img = Magick::Image.read("images/Flower_Hat.jpg").first +flipflop = Magick::AffineMatrix.new(1, Math::PI/6, Math::PI/6, 1, 0, 0) # Apply the transform img = img.affine_transform(flipflop)
Fix bug with negative scaling
diff --git a/lib/skyed/git.rb b/lib/skyed/git.rb index abc1234..def5678 100644 --- a/lib/skyed/git.rb +++ b/lib/skyed/git.rb @@ -13,8 +13,8 @@ Skyed::Utils.create_template('/tmp', 'ssh-git', 'ssh-git.erb', 0755) ENV['GIT_SSH'] = '/tmp/ssh-git' path = "/tmp/skyed.#{SecureRandom.hex}" - r = ::Git.clone(stack[:custom_cookbooks_source][:url], path) - puts "#{stack[:custom_cookbooks_source][:url]} #{r.branch}" + ::Git.clone(stack[:custom_cookbooks_source][:url], path) + puts Dir[path] path end end
INF-941: Add check if remore is cloned
diff --git a/lib/tus/input.rb b/lib/tus/input.rb index abc1234..def5678 100644 --- a/lib/tus/input.rb +++ b/lib/tus/input.rb @@ -21,7 +21,11 @@ end def size - @input.size + if defined?(Rack::Lint) && @input.is_a?(Rack::Lint::InputWrapper) + @input.instance_variable_get("@input").size + else + @input.size + end end def close
Make Tus::Input compatible with Rack::Lint::InputWrapper Rack::Lint::InputWrapper doesn't respond to #size, since this method is not officially part of the Rack specification.
diff --git a/vendor/pliny/lib/pliny.rb b/vendor/pliny/lib/pliny.rb index abc1234..def5678 100644 --- a/vendor/pliny/lib/pliny.rb +++ b/vendor/pliny/lib/pliny.rb @@ -2,7 +2,6 @@ require "pliny/generator" require "pliny/log" -require "pliny/request_store" require "pliny/utils" require "pliny/middleware/cors" require "pliny/middleware/request_id"
Fix bad reference to request_store
diff --git a/KSPAutomaticHeightCalculationTableCellView.podspec b/KSPAutomaticHeightCalculationTableCellView.podspec index abc1234..def5678 100644 --- a/KSPAutomaticHeightCalculationTableCellView.podspec +++ b/KSPAutomaticHeightCalculationTableCellView.podspec @@ -14,7 +14,7 @@ spec.source = {:git => 'https://github.com/konstantinpavlikhin/KSPAutomaticHeightCalculationTableCellView.git', :tag => "#{spec.version}"} - spec.summary = 'A useful superclass for a custom view-based NSTableView's cell.' + spec.summary = 'A useful superclass for a custom view-based NSTableViews cell.' spec.platform = :osx, "10.7"
Fix an issue with an accidental backtick in a pod spec summary.
diff --git a/sslbrick.gemspec b/sslbrick.gemspec index abc1234..def5678 100644 --- a/sslbrick.gemspec +++ b/sslbrick.gemspec @@ -11,7 +11,7 @@ spec.summary = %q{SSL WEBrick handler} spec.description = %q{Modified copy of the standard WEBrick handler with options to force SSL} - spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.homepage = "https://github.com/ogd-software/SSLbrick" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject do |f|
Fix hompage url for new rubygems version The gemspec at sslbrick.gemspec is not valid. Please fix this gemspec. The validation error was '"TODO: Put your gem's website or public repo URL here." is not a valid HTTP URI
diff --git a/spec/views/renalware/patients/_header.html.slim_spec.rb b/spec/views/renalware/patients/_header.html.slim_spec.rb index abc1234..def5678 100644 --- a/spec/views/renalware/patients/_header.html.slim_spec.rb +++ b/spec/views/renalware/patients/_header.html.slim_spec.rb @@ -1,6 +1,8 @@ require "rails_helper" describe "renalware/patients/_header" do + helper(Renalware::ApplicationHelper, Renalware::PatientHelper) + it "includes the correctly formatted NHS number" do patient = build(:patient, nhs_number: "1234567890") render partial: "renalware/patients/header", locals: { patient: patient }
Add helpers to patient header view spec
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -15,28 +15,32 @@ def source_rank_options(source, type, action) case action when 'create' - create_source_rank_options(type) + options = create_source_rank_options(type) when 'edit' - edit_source_rank_options(source, type) + options = edit_source_rank_options(source, type) end + + options.sort_by(&:last) end def edit_source_rank_options(selected_source, type) Source.all.map do |source| rank = source.rank_for(type) + if source.name == selected_source.name ["#{rank}: current - #{source.name}", rank] else ["#{rank}: move here - #{source.name}", rank] end - end.sort + end end def create_source_rank_options(type) options = Source.all.map do |source| rank = source.rank_for(type) ["#{rank}: insert above #{source.name}", rank] - end.sort + end + final_rank = options.count + 1 final_option = ["#{final_rank}: add to end", final_rank] options + [final_option]
Fix sort method for source select options
diff --git a/app/models/spree/bulk_discount.rb b/app/models/spree/bulk_discount.rb index abc1234..def5678 100644 --- a/app/models/spree/bulk_discount.rb +++ b/app/models/spree/bulk_discount.rb @@ -55,7 +55,6 @@ def create_label(amount) label = "" label << "Bulk Discount" - label << " #{amount}" label end end
Remove label from bulk discount
diff --git a/sudokusolver.gemspec b/sudokusolver.gemspec index abc1234..def5678 100644 --- a/sudokusolver.gemspec +++ b/sudokusolver.gemspec @@ -19,5 +19,5 @@ spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec", "~> 3.1.0" + spec.add_development_dependency "rspec", "~> 3.1" end
Fix warning and use proper rspec version
diff --git a/lib/akephalos.rb b/lib/akephalos.rb index abc1234..def5678 100644 --- a/lib/akephalos.rb +++ b/lib/akephalos.rb @@ -17,7 +17,3 @@ Capybara.register_driver :akephalos do |app| Capybara::Driver::Akephalos.new(app) end - -if Object.const_defined? :Cucumber - require 'akephalos/cucumber' -end
Remove automatic cucumber loading, force manual require.
diff --git a/lib/eventless.rb b/lib/eventless.rb index abc1234..def5678 100644 --- a/lib/eventless.rb +++ b/lib/eventless.rb @@ -15,8 +15,8 @@ end module Eventless - def self.spawn(&callback) - f = Fiber.new(Eventless.loop.fiber, &callback) + def self.spawn(&block) + f = Fiber.new(Eventless.loop.fiber, &block) Eventless.loop.schedule(f) f
Fix variable name:The fiber body isn't a callback.
diff --git a/app/controllers/theblog/admin/posts_controller.rb b/app/controllers/theblog/admin/posts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/theblog/admin/posts_controller.rb +++ b/app/controllers/theblog/admin/posts_controller.rb @@ -1,7 +1,7 @@ module Theblog class Admin::PostsController < Admin::ItemsController MODEL = Theblog::Post - ATTRIBUTES = [:title, :slug, :description, :body, :tags] + ATTRIBUTES = [:title, :slug, :description, {body: :wysihtml5}, :tags] INDEX = [:title, :description, :body, :category] ASSOCIATIONS = [:category] end
Add wisihtml5 to post's body
diff --git a/app/jobs/asset_schedule_replacement_update_job.rb b/app/jobs/asset_schedule_replacement_update_job.rb index abc1234..def5678 100644 --- a/app/jobs/asset_schedule_replacement_update_job.rb +++ b/app/jobs/asset_schedule_replacement_update_job.rb @@ -6,6 +6,11 @@ # #------------------------------------------------------------------------------ class AssetScheduleReplacementUpdateJob < AbstractAssetUpdateJob + + # Force an update of the SOGR characteristics based on the new replacement date + def requires_sogr_update? + true + end def execute_job(asset) asset.update_scheduled_replacement
Make sure that the replacement cost prorperties of assets are updated when the user sets the scheuled replacement year
diff --git a/lib/kitno/cli.rb b/lib/kitno/cli.rb index abc1234..def5678 100644 --- a/lib/kitno/cli.rb +++ b/lib/kitno/cli.rb @@ -12,6 +12,10 @@ A comma separated list of global methods in the form of `global:dependency`. Example: '_:underscore,$:jquery' GLOBALS + option :externals, aliases: '-e', type: :string, desc: <<-EXTERNALS + A comma separated list of external dependencies in the form of `constructor:dependency`. + Example: 'Module.Dependency:module#Dependency,Module.Foo.Dependency:module/foo#Dependency' + EXTERNALS def enumerate KillingInTheNamespaceOf.new(options).enumerate end
Add externals option to enumerate command
diff --git a/lib/scarecrow.rb b/lib/scarecrow.rb index abc1234..def5678 100644 --- a/lib/scarecrow.rb +++ b/lib/scarecrow.rb @@ -11,9 +11,22 @@ "patterns" => [ { "request" => { + "params" => { + "name" => "Tom" + } }, "response" => { "body" => "hello, Tom!" + } + }, + { + "request" => { + "params" => { + "name" => "Bob" + } + }, + "response" => { + "body" => "Who are you? I don't know such name" } } ] @@ -29,10 +42,19 @@ get File.join("/", path) do hash[path]["patterns"].each do |pattern| conds = [] + + pattern["request"]["params"].each do |name, value| + conds << params[name].eql?(value) + end unless pattern["request"]["params"].nil? + + pattern["request"]["headers"].each do |name, value| + conds << request.env["HTTP_#{name.upcase}"].eql?(value) + end unless pattern["request"]["headers"].nil? + if conds.all? status pattern["response"]["status"] || 200 headers pattern["response"]["header"] || {} - return body pattern["response"]["body"] + return body pattern["response"]["body"] || "" end end
Implement switching response based on params and headers
diff --git a/app/views/components/pageflow/admin/members_tab.rb b/app/views/components/pageflow/admin/members_tab.rb index abc1234..def5678 100644 --- a/app/views/components/pageflow/admin/members_tab.rb +++ b/app/views/components/pageflow/admin/members_tab.rb @@ -4,7 +4,7 @@ def build(entry) if entry.memberships.any? table_for entry.memberships, :class => 'memberships' do - column t('activerecord.attributes.user.full_name') do |membership| + column t('activerecord.attributes.user.full_name'), class: 'name' do |membership| if authorized? :manage, User link_to membership.user.full_name, admin_user_path(membership.user), :class => 'view_creator' else
Add CSS Class to name Column of Admin Table Feature spec depends on exact class name.
diff --git a/lib/zohax/crm.rb b/lib/zohax/crm.rb index abc1234..def5678 100644 --- a/lib/zohax/crm.rb +++ b/lib/zohax/crm.rb @@ -12,6 +12,10 @@ def find_leads(queryParameters) @api.call('Leads', 'getRecords', queryParameters, :get) + end + + def search_leads(searchConditions) + @api.call('Leads', 'getSearchRecords', searchConditions, :get) end def add_lead(data)
Add the ability to search leads.
diff --git a/spec/views/meetings/show.html.erb_spec.rb b/spec/views/meetings/show.html.erb_spec.rb index abc1234..def5678 100644 --- a/spec/views/meetings/show.html.erb_spec.rb +++ b/spec/views/meetings/show.html.erb_spec.rb @@ -5,7 +5,10 @@ @meeting = assign(:meeting, FactoryGirl.create(:meeting)) end - it "renders attributes in <p>" do + it "renders the div" do + skip('Gives me hell about current_user') render + + assert_select('div.show-meeting') end end
Mark spec as pending because it was giving me hell for no apparent reason pertaining to bcrypt
diff --git a/spec/requests/api/guest_devices_spec.rb b/spec/requests/api/guest_devices_spec.rb index abc1234..def5678 100644 --- a/spec/requests/api/guest_devices_spec.rb +++ b/spec/requests/api/guest_devices_spec.rb @@ -0,0 +1,32 @@+RSpec.describe "guest devices API" do + describe "display guest device details" do + context "with a valid role" do + it "shows its properties" do + device = FactoryGirl.create(:guest_device, + :device_name => "Broadcom 2-port 1GbE NIC Card", + :device_type => "ethernet", + :location => "Bay 7") + + api_basic_authorize action_identifier(:guest_devices, :read, :resource_actions, :get) + + run_get(guest_devices_url(device.id)) + + expect_single_resource_query("device_name" => "Broadcom 2-port 1GbE NIC Card", + "device_type" => "ethernet", + "location" => "Bay 7") + end + end + + context "with an invalid role" do + it "fails to show its properties" do + device = FactoryGirl.create(:guest_device) + + api_basic_authorize + + run_get(guest_devices_url(device.id)) + + expect(response).to have_http_status(:forbidden) + end + end + end +end
Add test cases for the guest_devices API
diff --git a/spec/views/events/edit.html.erb_spec.rb b/spec/views/events/edit.html.erb_spec.rb index abc1234..def5678 100644 --- a/spec/views/events/edit.html.erb_spec.rb +++ b/spec/views/events/edit.html.erb_spec.rb @@ -17,4 +17,10 @@ assert_select "input#event_knowledge_level[name=?]", "event[knowledge_level]" end end + + it "shows that organizer and knowledge_level are optional" do + render + expect(rendered).to have_field("event_organizer", :placeholder => "optional") + expect(rendered).to have_field("event_knowledge_level", :placeholder => "optional") + end end
Add test that asserts that the new fields appear as optional
diff --git a/ruby/server.rb b/ruby/server.rb index abc1234..def5678 100644 --- a/ruby/server.rb +++ b/ruby/server.rb @@ -7,8 +7,8 @@ get '/' do str = params['str'] || "" - ch = params['ch'] - len = params['len'] + ch = params['ch'] || "" + len = params['len'] || 0 { str: LeftPad.leftPad(str, len, ch) }.to_json end
Add some null variable checks
diff --git a/app/controllers/opening_hours_controller.rb b/app/controllers/opening_hours_controller.rb index abc1234..def5678 100644 --- a/app/controllers/opening_hours_controller.rb +++ b/app/controllers/opening_hours_controller.rb @@ -1,5 +1,5 @@ class OpeningHoursController < ApplicationController - before_action :set_post, except: %i(index create) + before_action :set_opening_hour, except: %i(index create) def index @opening_hours = policy_scope(OpeningHour)
Fix typo in before action
diff --git a/app/presenters/field/reference_presenter.rb b/app/presenters/field/reference_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/field/reference_presenter.rb +++ b/app/presenters/field/reference_presenter.rb @@ -7,7 +7,7 @@ related_item_type.sorted_items, :id, :display_name, - input_defaults(options) + input_defaults(options).reverse_merge(:include_blank => true) ) end
Allow blank option for reference input
diff --git a/spec/controllers/spree/admin/subscriptions_controller_spec.rb b/spec/controllers/spree/admin/subscriptions_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/spree/admin/subscriptions_controller_spec.rb +++ b/spec/controllers/spree/admin/subscriptions_controller_spec.rb @@ -14,7 +14,7 @@ end end - describe 'DELET destroy' do + describe 'DELETE destroy' do before do spree_delete :destroy, id: subscription.id end
Fix typo on admin subscriptions controller spec
diff --git a/assets/samples/sample_broadcast_receiver.rb b/assets/samples/sample_broadcast_receiver.rb index abc1234..def5678 100644 --- a/assets/samples/sample_broadcast_receiver.rb +++ b/assets/samples/sample_broadcast_receiver.rb @@ -1,6 +1,9 @@-require 'ruboto' +require 'ruboto/broadcast_receiver' # will get called whenever the BroadcastReceiver receives an intent (whenever onReceive is called) -$broadcast_receiver.handle_receive do |context, intent| - Log.v "MYAPP", intent.getExtras.to_s +RubotoBroadcastReceiver.new_with_callbacks do + def on_receive(context, intent) + Log.v "MYAPP", intent.getExtras.to_s + end end +
Update sample to match new ruboto split
diff --git a/lib/braid.rb b/lib/braid.rb index abc1234..def5678 100644 --- a/lib/braid.rb +++ b/lib/braid.rb @@ -42,7 +42,10 @@ require 'braid/mirror' require 'braid/config' require 'braid/command' - -Dir[dirname + '/braid/commands/*'].each do |file| - require file -end +require 'braid/commands/add' +require 'braid/commands/diff' +require 'braid/commands/list' +require 'braid/commands/push' +require 'braid/commands/remove' +require 'braid/commands/setup' +require 'braid/commands/update'
Expand the require to hardcode set of files to require
diff --git a/fc-reminder.gemspec b/fc-reminder.gemspec index abc1234..def5678 100644 --- a/fc-reminder.gemspec +++ b/fc-reminder.gemspec @@ -1,4 +1,4 @@-$:.push File.expand_path('../lib', __FILE__) +$:.unshift File.expand_path('../lib', __FILE__) require 'fc-reminder/version' Gem::Specification.new do |spec|
Put path to gem on the top
diff --git a/texticle.gemspec b/texticle.gemspec index abc1234..def5678 100644 --- a/texticle.gemspec +++ b/texticle.gemspec @@ -9,7 +9,6 @@ spec.authors = ["David Hahn"] spec.email = ["davidmichaelhahn@gmail.com"] spec.description = %q{ One stop shop for sending sms via email. } - spec.summary = %q{Write a gem summary} spec.homepage = "https://github.com/dhahn/texticle" spec.license = "MIT"
Remove unused line from gemspec
diff --git a/trackler.gemspec b/trackler.gemspec index abc1234..def5678 100644 --- a/trackler.gemspec +++ b/trackler.gemspec @@ -22,7 +22,6 @@ spec.add_dependency "rubyzip", "~> 1.1.0" spec.add_dependency "org-ruby", "~> 0.9.0" - spec.add_development_dependency "bundler", "~> 1.11" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "minitest", "~> 5.0" spec.add_development_dependency "simplecov", "~> 0.12.0"
Remove bundler as dev dependency Not sure what I was thinking. I probably wasn't, to be honest. :/
diff --git a/test/integration/supervisor_test.rb b/test/integration/supervisor_test.rb index abc1234..def5678 100644 --- a/test/integration/supervisor_test.rb +++ b/test/integration/supervisor_test.rb @@ -12,7 +12,8 @@ visit '/' login_coordinator - click_on 'Supervisors' + click_on 'Administration' + click_on 'Manage Supervisors' click_on 'Create Supervisor Account' within '#new_user' do @@ -25,13 +26,11 @@ assert page.has_content? 'Supervisor created successfully' - click_on 'Supervisors' + click_on 'Administration' + click_on 'Manage Supervisors' - #I give up with xpath and I can't figure this out - #Maybe later I can get this to work and test multiple supervisors and deletions - #puts find(:xpath, "//tr[contains(.,'#{supervisor_attrs[:full_name]}')]", :text => 'Delete').click - - click_on 'Delete' + row_xpath = "//tr[contains(.,'#{supervisor_attrs[:full_name]}')]" + find(:xpath, row_xpath).click_on('Delete') assert page.has_content? 'Supervisor deleted successfully' end
Use an XPath to click the delete button in specific rows.
diff --git a/app/models/describable.rb b/app/models/describable.rb index abc1234..def5678 100644 --- a/app/models/describable.rb +++ b/app/models/describable.rb @@ -12,6 +12,8 @@ end def t(attr_name) + return '' unless description + lang = I18n.locale.to_s.split('-').first description["#{attr_name}_#{lang}"]&.html_safe end
Add guard case to filter empty descriptions
diff --git a/lib/ost.rb b/lib/ost.rb index abc1234..def5678 100644 --- a/lib/ost.rb +++ b/lib/ost.rb @@ -1,7 +1,7 @@ require "nest" module Ost - TIMEOUT = ENV["OST_TIMEOUT"] || 2 + TIMEOUT = ENV["OST_TIMEOUT"].to_i || 2 class Queue attr :key
Fix bug with non-integer timeouts
diff --git a/optic14n.gemspec b/optic14n.gemspec index abc1234..def5678 100644 --- a/optic14n.gemspec +++ b/optic14n.gemspec @@ -23,5 +23,5 @@ spec.add_development_dependency "rake" spec.add_development_dependency "rspec" - spec.add_development_dependency "rubocop-govuk", "~> 1.0.0" + spec.add_development_dependency "rubocop-govuk", "~> 4.7.0" end
Update rubocop-govuk requirement from ~> 1.0.0 to ~> 4.7.0 Updates the requirements on [rubocop-govuk](https://github.com/alphagov/rubocop-govuk) to permit the latest version. - [Release notes](https://github.com/alphagov/rubocop-govuk/releases) - [Changelog](https://github.com/alphagov/rubocop-govuk/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/rubocop-govuk/compare/v1.0.0...v4.7.0) --- updated-dependencies: - dependency-name: rubocop-govuk dependency-type: direct:development ... Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@github.com>
diff --git a/erbtex2.gemspec b/erbtex2.gemspec index abc1234..def5678 100644 --- a/erbtex2.gemspec +++ b/erbtex2.gemspec @@ -10,5 +10,5 @@ between .{ and }. markers, greatly expanding the ability to generate automated TeX and LaTeX documents.} s.files = Dir.glob(['./*', './*/**']) - s.files.delete_if {|f| f =~ /(log|etc|aux)$/} + s.files.delete_if {|f| f =~ /(log|etc|aux|etx|pdf|gem)$/} end
Remove auxillary files from gem file set.
diff --git a/test/models/category_relationship_test.rb b/test/models/category_relationship_test.rb index abc1234..def5678 100644 --- a/test/models/category_relationship_test.rb +++ b/test/models/category_relationship_test.rb @@ -1,7 +1,7 @@ require 'test_helper' class CategoryRelationshipTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + test "CategoryRelationship without child_id should not be valid" do + assert_not CategoryRelationship.new(child_id: nil).valid? + end end
Add test for CategoryRelationship model
diff --git a/loaf.gemspec b/loaf.gemspec index abc1234..def5678 100644 --- a/loaf.gemspec +++ b/loaf.gemspec @@ -1,17 +1,16 @@-# -*- encoding: utf-8 -*- -$:.push File.expand_path("../lib", __FILE__) +# coding: utf-8 +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'loaf/version' Gem::Specification.new do |s| s.name = "loaf" - s.version = Loaf::Version::STRING.dup + s.version = Loaf::VERSION.dup s.authors = ["Piotr Murach"] s.email = [""] s.homepage = "https://github.com/peter-murach/loaf" s.summary = %q{Loaf is a breadcrumb managing gem.} s.description = %q{Loaf helps you manage breadcrumbs in your rails app. It aims to handle crumb data through easy dsl and expose it through view helpers without any assumptions about markup.} - - s.rubyforge_project = "tytus" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {spec,features}/*`.split("\n") @@ -20,9 +19,5 @@ s.add_dependency 'rails' - s.add_development_dependency 'rails', '~> 3.1' - s.add_development_dependency 'sqlite3' - s.add_development_dependency 'rspec-rails' - s.add_development_dependency 'capybara' - s.add_development_dependency 'bundler' + s.add_development_dependency 'bundler', '~> 1.6' end
Change to remove dev dependencies.
diff --git a/test/unit/RakeDSL.rb b/test/unit/RakeDSL.rb index abc1234..def5678 100644 --- a/test/unit/RakeDSL.rb +++ b/test/unit/RakeDSL.rb @@ -35,7 +35,7 @@ def test_build_dispatcher - assert_methods_exist 'observers', 'observer', 'execute' + assert_methods_exist 'observers', 'reset_observers', 'observer', 'execute' end
Add test assertion for reset_observers
diff --git a/pathspec.gemspec b/pathspec.gemspec index abc1234..def5678 100644 --- a/pathspec.gemspec +++ b/pathspec.gemspec @@ -13,7 +13,7 @@ s.test_files = s.files.grep(%r{^spec/}) s.require_paths = ['lib'] s.homepage = 'https://github.com/highb/pathspec-ruby' - s.license = 'Apache' + s.license = 'Apache-2.0' s.add_development_dependency 'bundler', '~> 1.0' s.add_development_dependency 'fakefs', '~> 0.12' s.add_development_dependency 'rake', '~> 12.3'
Use valid license key in gemspec When trying to build the gem locally I got the following warning: $ gem build pathspec.gemspec WARNING: license value 'Apache' is invalid. Use a license identifier from http://spdx.org/licenses or 'Nonstandard' for a nonstandard license. Did you mean 'mpich2'? WARNING: See http://guides.rubygems.org/specification-reference/ for help The gem built successfully, but using the correct key for Apache-2.0 removes the warning: $ gem build pathspec.gemspec Successfully built RubyGem Name: pathspec Version: 0.2.0 File: pathspec-0.2.0.gem
diff --git a/app/serializers/conditional_logic_form/condition_serializer.rb b/app/serializers/conditional_logic_form/condition_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/conditional_logic_form/condition_serializer.rb +++ b/app/serializers/conditional_logic_form/condition_serializer.rb @@ -3,8 +3,8 @@ module ConditionalLogicForm # Serializes Condition for use in condition form. class ConditionSerializer < ApplicationSerializer - attributes :id, :left_qing_id, :op, :value, :option_node_id, :option_set_id, - :form_id, :conditionable_id, :conditionable_type, :operator_options + attributes :id, :left_qing_id, :right_qing_id, :right_side_type, :op, :value, + :option_node_id, :option_set_id, :form_id, :conditionable_id, :conditionable_type, :operator_options has_many :refable_qings, serializer: TargetFormItemSerializer
9689: Add right side stuff to serializer
diff --git a/spec/internal/app/controllers/some_controller.rb b/spec/internal/app/controllers/some_controller.rb index abc1234..def5678 100644 --- a/spec/internal/app/controllers/some_controller.rb +++ b/spec/internal/app/controllers/some_controller.rb @@ -7,6 +7,8 @@ end end + before_filter :authorize + def some_action end
Use the authorize filter in the SomeController tests
diff --git a/pyonnuka.gemspec b/pyonnuka.gemspec index abc1234..def5678 100644 --- a/pyonnuka.gemspec +++ b/pyonnuka.gemspec @@ -15,7 +15,7 @@ spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - spec.bindir = "exe" + spec.bindir = "bin" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"]
Fix can execute files dirname to bin
diff --git a/test/factories/documents.rb b/test/factories/documents.rb index abc1234..def5678 100644 --- a/test/factories/documents.rb +++ b/test/factories/documents.rb @@ -1,5 +1,17 @@+GenericDocument = Class.new(Document) + +Rails.application.routes.url_helpers.module_eval do + def generic_document_path(id) + "/government/generic-documents/#{id}" + end + + def admin_generic_document_editorial_remarks_path(*args) + admin_document_editorial_remarks_path(*args) + end +end + FactoryGirl.define do - factory :document do + factory :document, class: GenericDocument do creator title "document-title" body "document-body"
Stop using instances of Document in tests This lets us remove test-only code from Document::Workflow.
diff --git a/guides/check_typo.rb b/guides/check_typo.rb index abc1234..def5678 100644 --- a/guides/check_typo.rb +++ b/guides/check_typo.rb @@ -0,0 +1,10 @@+#!/usr/bin/ruby +# -*- coding: utf-8 -*- +# Cited from コードの世界 by Matz +# 典型的なスペル・ミスを探す方法, 図6 文章のミスをチェックするスクリプト + +ARGF.each do |line| + print ARGF.file.path, " ", + ARGF.file.lineno, ":", + line if line.gsub!(/([へにおはがでな])\1/s, '[[\&]]') +end
Add a script to check typos
diff --git a/lib/headlines/security_headers/security_header.rb b/lib/headlines/security_headers/security_header.rb index abc1234..def5678 100644 --- a/lib/headlines/security_headers/security_header.rb +++ b/lib/headlines/security_headers/security_header.rb @@ -2,8 +2,6 @@ module SecurityHeaders class SecurityHeader attr_reader :name, :value - - EMPTY_SCORE = 0 def initialize(name, value) @name = name
Remove EMPTY_SCORE contstant from security header base class
diff --git a/extras/searchable_model.rb b/extras/searchable_model.rb index abc1234..def5678 100644 --- a/extras/searchable_model.rb +++ b/extras/searchable_model.rb @@ -16,13 +16,12 @@ module ClassMethods def fulltext_search(q) - if !CMS_CONFIG["FULLTEXT"].blank? + # Check if Sphinx is enabled globally and for this model; if not, fallback to db_search + if CMS_CONFIG["FULLTEXT"].present? && respond_to?(:search_for_ids) ids = search_for_ids(q).to_a where(:id => ids) else - t = arel_table - q = "%#{q}%" - where(t[:title].matches(q).or(t[:slug].matches(q))) + db_search(q) end end
Fix .fulltext_search to check whether Sphinx is enabled on a model and fallback to db_search if not
diff --git a/isbm-adaptor.gemspec b/isbm-adaptor.gemspec index abc1234..def5678 100644 --- a/isbm-adaptor.gemspec +++ b/isbm-adaptor.gemspec @@ -18,8 +18,8 @@ s.add_development_dependency 'activesupport', '~> 3.2.0' s.add_development_dependency 'rake', '~> 10.0.0' s.add_development_dependency 'rspec', '~> 2.13.0' - s.add_development_dependency 'vcr', '~> 2.4.0' - s.add_development_dependency 'webmock', '~> 1.9.0' + s.add_development_dependency 'vcr', '~> 2.5.0' + s.add_development_dependency 'webmock', '~> 1.11.0' s.add_runtime_dependency 'builder', '>= 3.0.0' s.add_runtime_dependency 'savon', '>= 2.0.0'
Update vcr and webmock gem versions
diff --git a/lib/bandicoot/processor.rb b/lib/bandicoot/processor.rb index abc1234..def5678 100644 --- a/lib/bandicoot/processor.rb +++ b/lib/bandicoot/processor.rb @@ -24,7 +24,7 @@ end def go_to_the_next_page - browser.a(css:config.next_page_css_path).link.when_present.click + browser.a(css:config.next_page_css_path).click end
Change the next page clicker logic
diff --git a/lib/console_game_engine.rb b/lib/console_game_engine.rb index abc1234..def5678 100644 --- a/lib/console_game_engine.rb +++ b/lib/console_game_engine.rb @@ -2,7 +2,7 @@ class ConsoleGameEngine - attr_reader :gametype, :rules, :comp_player, :ui + attr_reader :gametype, :rules, :comp_player, :ui, :first_player def initialize(args) @gametype = args.fetch(:gametype, nil) @@ -14,8 +14,8 @@ def alternate_move index_position = ui.get_user_input - if @gametype.valid_slots.include?(index_position) - @gametype = gametype.move(index_position) + if @gametype.valid_move?(index_position) + @gametype = first_player.user_move(gametype, index_position) if !@gametype.valid_slots.empty? @gametype = comp_player.ai_move(gametype, rules) end
Update logic so that it is more modular
diff --git a/lib/csv_query/outputter.rb b/lib/csv_query/outputter.rb index abc1234..def5678 100644 --- a/lib/csv_query/outputter.rb +++ b/lib/csv_query/outputter.rb @@ -15,7 +15,7 @@ def output results.each_with_index do |result, index| puts format_string % result - if index == 0 + if index.zero? puts separator_line end end
Use index.zero? instead of index == 0
diff --git a/git_tracker.gemspec b/git_tracker.gemspec index abc1234..def5678 100644 --- a/git_tracker.gemspec +++ b/git_tracker.gemspec @@ -14,7 +14,7 @@ EOF gem.add_development_dependency "rspec", "~> 2.14" - gem.add_development_dependency "activesupport", "~> 3.2" + gem.add_development_dependency 'activesupport', '~> 4.0' gem.add_development_dependency "pry", "~> 0.9.11" # Use Rake < 10.2 (requires Ruby 1.9+) until we drop Ruby 1.8.7 support gem.add_development_dependency "rake", "~> 10.1.1"
Use newer ActiveSupport for dev. Because time doesn't stand still.
diff --git a/google_text.gemspec b/google_text.gemspec index abc1234..def5678 100644 --- a/google_text.gemspec +++ b/google_text.gemspec @@ -7,7 +7,7 @@ s.version = GoogleText::Version s.platform = Gem::Platform::RUBY s.summary = "GoogleText is a SMS client library for sending and receiving free SMS through Google Voice." - s.description = "GoogleText is a SMS client library for sending and receiving free SMS through Google Voice." + s.description = "GoogleText is a SMS client library for sending and receiving free SMS through Google Voice. GoogleText uses Curl and Nokogiri to scrape and post using your regular Google Voice service URLs." s.homepage = "http://github.com/feldpost/google_text" s.email = "sebastian@feldpost.com" @@ -17,7 +17,7 @@ s.files += Dir['[A-Z]*', 'lib/**/*.rb', 'spec/**/*.rb'] s.require_path = 'lib' - + s.rubyforge_project = 'google_text' s.test_files = Dir['spec/**/*_spec.rb', 'features/**/*'] s.add_dependency('curb', '~>0.7.6')
Update gem specs to surpress warnings