diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/services/notify_registered_user_from_proposed_org_spec.rb b/spec/services/notify_registered_user_from_proposed_org_spec.rb index abc1234..def5678 100644 --- a/spec/services/notify_registered_user_from_proposed_org_spec.rb +++ b/spec/services/notify_registered_user_from_proposed_org_spec.rb @@ -10,4 +10,9 @@ expect(->{subject}).to change{ActionMailer::Base.deliveries.size}.by(1) end + it 'associates user with the proposed organisation' do + subject + expect(proposed_org.reload.users).to include(user) + end + end
Add spec for NotifyRegisteredUserFromProposedOrg associating user with org
diff --git a/db/data_migration/20161110163557_create_unpublishing_record_for_newton_grade_separated_junction.rb b/db/data_migration/20161110163557_create_unpublishing_record_for_newton_grade_separated_junction.rb index abc1234..def5678 100644 --- a/db/data_migration/20161110163557_create_unpublishing_record_for_newton_grade_separated_junction.rb +++ b/db/data_migration/20161110163557_create_unpublishing_record_for_newton_grade_separated_junction.rb @@ -0,0 +1,22 @@+# Fixes an error with `DocumentCollection` sync checks with `document_id = 256174` +# This collection contains a `Document` with an id of `258249` which managed to get +# itself into a state where the `Edition` (383738) had a state of `withdrawn` but +# there was no corresponding record in the `Unpublishings` table. In additon the +# Document has a second `Edition` (with `edition_id` 494737) with a state of `deleted`. +# Browsing the document +# (http://www.gov.uk/government/publications/part-i-claim-a66-long-newton-grade-separated-junction) +# showed a page that stated "Sorry, we're experiencing technical difficulties". +# +# Shilpa contacted the publisher (Paul Knights of Highways England) and he confirmed +# that the document could be unpublished. +# +# To do this, we create a record in the `Unpublishings` table for the `withdrawn` +# edition. This fixes the front end "technical difficulties" notice by displaying +# a proper withdrawn notification and also sorts out our sync checks +Unpublishing.create( + edition_id: 383738, + unpublishing_reason_id: 5, + explanation: "This scheme has been completed and no further claims are permissible", + document_type: "Publication", + slug: "part-i-claim-a66-long-newton-grade-separated-junction" +)
Create unpublishing for withdrawn edition 383738 Fixes an error with `DocumentCollection` sync checks with `document_id = 256174`. This collection contains a `Document` with an id of `258249` which managed to get itself into a state where the `Edition` (383738) had a state of `withdrawn` but there was no corresponding record in the `Unpublishings` table. In additon the Document has a second `Edition` (with `edition_id` 494737) with a state of `deleted`. Browsing the document (http://www.gov.uk/government/publications/part-i-claim-a66-long-newton-grade-separated-junction) showed a page that stated "Sorry, we're experiencing technical difficulties". Shilpa contacted the publisher (Paul Knights of Highways England) and he confirmed that the document could be unpublished. To do this, we create a record in the `Unpublishings` table for the `withdrawn` edition. This fixes the front end "technical difficulties" notice by displaying a proper withdrawn notification and also sorts out our sync checks
diff --git a/event_store-messaging.gemspec b/event_store-messaging.gemspec index abc1234..def5678 100644 --- a/event_store-messaging.gemspec +++ b/event_store-messaging.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'event_store-messaging' s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP library' - s.version = '0.1.0.0' + s.version = '0.1.0.1' s.authors = [''] s.require_paths = ['lib'] s.files = Dir.glob('{lib}/**/*')
Package version is increased from 0.1.0.0 to 0.1.0.1
diff --git a/performance/aur.rb b/performance/aur.rb index abc1234..def5678 100644 --- a/performance/aur.rb +++ b/performance/aur.rb @@ -5,12 +5,20 @@ require 'aurb' -Benchmark.bm 7 do |x| - x.report 'search' do +Benchmark.bm 20 do |x| + x.report 'aurb upgrade' do + Aurb.aur.upgrade *`pacman -Qm`.split(/\n/) + end + + x.report 'aurb search' do Aurb.aur.search *:quake end - x.report 'upgrade' do - Aurb.aur.upgrade *`pacman -Qm`.split(/\n/) + x.report 'slurpy search' do + `slurpy --search quake` + end + + x.report 'bauerbill search' do + `bauerbill -Ss quake --aur` end end
Add contenders to performance check
diff --git a/spritesh.gemspec b/spritesh.gemspec index abc1234..def5678 100644 --- a/spritesh.gemspec +++ b/spritesh.gemspec @@ -10,6 +10,6 @@ spec.summary = "Build an SVG sprite from a folder of SVG files." spec.authors = ["Hugo Giraudel", "Cade Scroggins"] spec.email = ["h.giraudel@de.edenspiekermann.com", "hello@cadejs.com"] - spec.files = ["bin/spritesh", "bin/sprite.sh"] + spec.files = ["bin/spritesh", "bin/spritesh.js"] spec.executables = ["spritesh"] end
Update a file in gemspec file
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -30,8 +30,5 @@ # Custom directories with classes and modules you want to be autoloadable. config.autoload_paths += %W(#{config.root}/lib) - - # Google Analytics dimension assigned to the Tasklist A/B test - config.task_list_ab_test_dimension = 43 end end
Remove unused AB test config
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,6 +9,20 @@ module ReactRailsStarterApp class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 6.1 + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + + # + ### Custom + # config.autoload_paths << "#{config.root}/lib" @@ -31,16 +45,5 @@ asset_manifest: {}, common_manifest: {}, } - - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.1 - - # Configuration for the application, engines, and railties goes here. - # - # These settings can be overridden in specific environments using the files - # in config/environments, which are processed later. - # - # config.time_zone = "Central Time (US & Canada)" - # config.eager_load_paths << Rails.root.join("extras") end end
Move the auto generated config to top of file Keep our custom modifications at the bottom
diff --git a/lib/at_users.rb b/lib/at_users.rb index abc1234..def5678 100644 --- a/lib/at_users.rb +++ b/lib/at_users.rb @@ -2,9 +2,11 @@ def self.render(content, messageboard) at_names = AtNotificationExtractor.new(content).extract members = messageboard.members_from_list(at_names) + members.each { |member| - content.gsub!("@#{member}", %Q{<a href="/users/#{member}">@#{member}</a>}) + content.gsub!("@#{member.name}", %Q{<a href="/users/#{member.name}">@#{member.name}</a>}) } + content end end
Fix bug in rendering @usernames
diff --git a/lib/charting.rb b/lib/charting.rb index abc1234..def5678 100644 --- a/lib/charting.rb +++ b/lib/charting.rb @@ -29,7 +29,7 @@ def self.detect_available_plugin available = subclasses.select(&:available?) - available.max { |klass_a, klass_b| klass_a.priority <=> klass_b.priority } + available.max_by(&:priority) end end
Use max_by instead of max in Charting.detect_available_plugin
diff --git a/config/environment.rb b/config/environment.rb index abc1234..def5678 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -22,7 +22,8 @@ } end -# Fix the bug described here:http://stackoverflow.com/questions/9122411/rails-javascript-too-many-parameter-keys-whats-a-good-way-to-normalize-f -# Allows the CLSI to handle large POST requests -Rack::Utils.key_space_limit = 262144 +# This ensures the POST data is never parsed. Doing so can overload the parser with +# large requests and we parse it ourselves later. +Rack::Request::FORM_DATA_MEDIA_TYPES.clear +Rack::Request::PARSEABLE_DATA_MEDIA_TYPES.clear
Fix "exceeded available parameter key space" bug with large POST requests Rack attempts to parse the POST data as a form if the Content-Type header matches one of its understood formats. Sometimes the Content-Type header is not set correctly by calls to the API and it tries to parse large requests. We blank the types it tries to parse so that it never attempts to parse. This might be a problem if we want to create other pages, but for the API end point it is fine.
diff --git a/jsrebuild.gemspec b/jsrebuild.gemspec index abc1234..def5678 100644 --- a/jsrebuild.gemspec +++ b/jsrebuild.gemspec @@ -1,4 +1,6 @@-# -*- encoding: utf-8 -*- +#!/usr/bin/env gem build +# encoding: utf-8 + lib = File.expand_path('../lib/', __FILE__) $:.unshift lib unless $:.include?(lib)
Make gemspec executable and build the gem.
diff --git a/fibonacci/fib_cfe.rb b/fibonacci/fib_cfe.rb index abc1234..def5678 100644 --- a/fibonacci/fib_cfe.rb +++ b/fibonacci/fib_cfe.rb @@ -3,9 +3,9 @@ $_ = $$ / $$ # 1 @_ = $_ + $_ # 2 -$- = $_ - @_ # -1 +$-_ = $_ - @_ # -1 $__= @_ * @_ + $_ # 5 -@__= $__ ** (@_ ** $-) # sqrt(5) +@__= $__ ** (@_ ** $-_) # sqrt(5) $___ = ($_ + @__) / @_ # golden ratio @___ = ($_ / -$___) # negative reciprocal @@ -13,8 +13,8 @@ $. = $_ # Initialize counter. @____ = -> { - $- = ($___ ** $. - @___ ** $.) / @__ # Reuse for fib number. - $> << "#$-"[/[^.]+/] << ('' << @_ * $__) # Print without fractional part. + $-_ = ($___ ** $. - @___ ** $.) / @__ # Reuse for fib number. + $> << "#$-_"[/[^.]+/] << ('' << @_ * $__) # Print without fractional part. $. += $_ # Increment @____[] # and go again. }
Refactor to not use $- variable
diff --git a/krb5-auth.gemspec b/krb5-auth.gemspec index abc1234..def5678 100644 --- a/krb5-auth.gemspec +++ b/krb5-auth.gemspec @@ -7,7 +7,7 @@ s.email = %q{clalance@redhat.com} s.platform = Gem::Platform::RUBY s.summary = %q{Kerberos binding for Ruby} - s.files = ["README","lib/krb5-auth.rb","bin/example.rb","ext/extconf.rb","ext/ruby_krb5_auth.c"] + s.files = ["README","lib/krb5-auth.rb","bin/example.rb","ext/extconf.rb","ext/ruby_krb5_auth.c","COPYING","TODO"] s.autorequire = %q{Krb5Auth} s.has_rdoc = true s.extensions = %q{ext/extconf.rb}
Make sure to include the COPYING and TODO files in the gemspec, so that generated gems get those files (COPYING, in particular, is absolutely required)
diff --git a/manifests/cf-manifest/spec/secret_generation_spec.rb b/manifests/cf-manifest/spec/secret_generation_spec.rb index abc1234..def5678 100644 --- a/manifests/cf-manifest/spec/secret_generation_spec.rb +++ b/manifests/cf-manifest/spec/secret_generation_spec.rb @@ -7,6 +7,8 @@ } specify "it should produce lint-free YAML" do + skip "No mkpasswd(1) on Mac OS X" if Gem::Platform.local.os == 'darwin' + yaml, error, status = Open3.capture3(script) expect(status).to be_success, "script exited #{status.exitstatus}, stderr:\n#{error}" expect(yaml).to_not be_empty
Disable generate-cf-secrets test on Mac This test fails on Mac because there isn't an `mkpasswd` command available. Short of writing our own hash+salt function, it seems there is no portable alternative. So we have to mark this test as "pending" if being run on Mac. I think that because the tests are run using Bundler that the `rubygems` package, which provides us with this convenient OS string, will always be present.
diff --git a/app/actions.rb b/app/actions.rb index abc1234..def5678 100644 --- a/app/actions.rb +++ b/app/actions.rb @@ -11,7 +11,18 @@ end @real = @topics.sample.twitter_handles.where("real_twitter_handle_id is null").sample.tweets.sample @fake = TwitterHandle.where("real_twitter_handle_id = ?", [@real.twitter_handle.id]).sample.tweets.sample - erb :'topics/show.html' + if params['json'].nil? + erb :'topics/show.html' + else + { + real: @real.content, + fake: @fake.content, + topic: id, + real_handle: @real.twitter_handle.twitter_handle, + fake_handle: @fake.twitter_handle.twitter_handle, + tweet_topic: @real.twitter_handle.topic.topic, + }.to_json + end end get '/topics' do
Add Json output option to showing a topic The json object returned has the keys `real`: _Content of the real tweet_ `fake`: _Content of the fake tweet_ `real_handle`: _Handle of user who created the real tweet_ `fake_handle`: _Handle of user who created the fake tweet_ `tweet_topic`: _Topic of the tweets sent_ `topic`: topic the user had selected_
diff --git a/db/migrate/20170622172712_create_incline_action_groups.rb b/db/migrate/20170622172712_create_incline_action_groups.rb index abc1234..def5678 100644 --- a/db/migrate/20170622172712_create_incline_action_groups.rb +++ b/db/migrate/20170622172712_create_incline_action_groups.rb @@ -1,8 +1,8 @@ class CreateInclineActionGroups < ActiveRecord::Migration def change create_table :incline_action_groups do |t| - t.belongs_to :action_security, null: false, index: true, foreign_key: true - t.belongs_to :access_group, null: false, index: true, foreign_key: true + t.belongs_to :action_security, null: false, index: true + t.belongs_to :access_group, null: false, index: true t.timestamps null: false end
Fix foreign keys in incline_action_groups.
diff --git a/poseidon/config.rb b/poseidon/config.rb index abc1234..def5678 100644 --- a/poseidon/config.rb +++ b/poseidon/config.rb @@ -18,3 +18,5 @@ end $num_instances=3 +$vb_memory = 2048 +$vb_cpus = 2
Make the VMs a little bigger, so users do not have to wait for too long (hopefully)
diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index abc1234..def5678 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -10,9 +10,9 @@ class PostScrubber < Rails::Html::PermitScrubber def initialize super - self.tags = %w[a p b i em strong hr h1 h2 h3 h4 h5 h6 blockquote img strike del code pre br ul ol li sup sub + self.tags = %w[a p span b i em strong hr h1 h2 h3 h4 h5 h6 blockquote img strike del code pre br ul ol li sup sub section details summary ins table thead tbody tr th td] - self.attributes = %w[id class href title src height width alt rowspan colspan] + self.attributes = %w[id class href title src height width alt rowspan colspan lang] end def skip_node?(node)
Allow span tags and lang attributes
diff --git a/app/helpers/theme_helper.rb b/app/helpers/theme_helper.rb index abc1234..def5678 100644 --- a/app/helpers/theme_helper.rb +++ b/app/helpers/theme_helper.rb @@ -5,27 +5,18 @@ # happier if we didn't have to override undocumented methods. Ho # hum. -- pdcawley - def render_file(template_path, use_full_path = true, local_assigns = {}) #:nodoc: - search_path = [ - "../themes/#{this_blog.theme}/views", # for components - "../../themes/#{this_blog.theme}/views", # for normal views - ".", # fallback - "../app/views", # Fallback from component to normal view - ] + def search_paths + ["../themes/#{this_blog.theme}/views", # for components + "../../themes/#{this_blog.theme}/views", # for normal views + "."] + end - if use_full_path - search_path.each do |prefix| - theme_path = prefix+'/'+template_path - begin - template_extension = pick_template_extension(theme_path) - rescue ActionView::ActionViewError => err - next - end - return super(theme_path, use_full_path, local_assigns) - end - raise "Can't locate theme #{this_blog.theme}" - else - super(template_path, use_full_path, local_assigns) + def full_template_path(template_path, extension) + search_paths.each do |path| + themed_path = File.join(@base_path, path, "#{template_path}.#{extension}") + return themed_path if File.exist?(themed_path) end + # Can't find a themed version, so fall back to the default behaviour + super end end
Make our theme loading a little more Rails 1.1ish. Should now work with respond_to git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@1034 820eb932-12ee-0310-9ca8-eeb645f39767
diff --git a/app/models/internal_post.rb b/app/models/internal_post.rb index abc1234..def5678 100644 --- a/app/models/internal_post.rb +++ b/app/models/internal_post.rb @@ -28,7 +28,6 @@ end def number_of_comments - comments.count + comments.count end - end
Improve code according houndci comments
diff --git a/lib/napa/cli.rb b/lib/napa/cli.rb index abc1234..def5678 100644 --- a/lib/napa/cli.rb +++ b/lib/napa/cli.rb @@ -30,8 +30,8 @@ desc 'console [environment]', 'Start the Napa console' options aliases: 'c' - def console(environment = 'development' ) - ENV['RACK_ENV'] = environment + def console(environment = nil) + ENV['RACK_ENV'] = environment || 'development' require 'racksh/init' @@ -42,6 +42,9 @@ require "irb" require "irb/completion" interpreter = IRB + # IRB uses ARGV and does not expect these arguments. + ARGV.delete('console') + ARGV.delete(environment) if environment end Rack::Shell.init
Fix napa console when using IRB. IRB was taking extra arguments, "console" and optionally the environment, when running `napa console <environment>`. IRB then interprets this as a script name, and errors out. These arguments are now removed from ARGV before starting the interpreter.
diff --git a/app/helpers/manageiq/providers/lenovo/toolbar_overrides/ems_physical_infra_center.rb b/app/helpers/manageiq/providers/lenovo/toolbar_overrides/ems_physical_infra_center.rb index abc1234..def5678 100644 --- a/app/helpers/manageiq/providers/lenovo/toolbar_overrides/ems_physical_infra_center.rb +++ b/app/helpers/manageiq/providers/lenovo/toolbar_overrides/ems_physical_infra_center.rb @@ -22,7 +22,7 @@ 'function-data' => {:controller => 'provider_dialogs', # this one is required :button => :provision_apply_pattern, :modal_title => N_('Apply Config Pattern'), - :component_name => 'ApplyConfigPatternFormProvider'}.to_json + :component_name => 'ApplyConfigPatternFormProvider'} }, :klass => ApplicationHelper::Button::ButtonWithoutRbacCheck ), @@ -36,7 +36,7 @@ 'function-data' => {:controller => 'provider_dialogs', # this one is required :button => :provision_firmware_update, :modal_title => N_('Firmware Update'), - :component_name => 'FirmwareUpdateFormProvider'}.to_json + :component_name => 'FirmwareUpdateFormProvider'} }, :klass => ApplicationHelper::Button::ButtonWithoutRbacCheck )
Remove to_json from toolbar data as it's not needed After https://github.com/ManageIQ/manageiq-ui-classic/pull/5997 `to_json` is not needed and will break the data format. Related to https://github.com/ManageIQ/manageiq-ui-classic/pull/6289 fix
diff --git a/akami.gemspec b/akami.gemspec index abc1234..def5678 100644 --- a/akami.gemspec +++ b/akami.gemspec @@ -21,6 +21,7 @@ s.add_development_dependency "rspec", "~> 2.14" s.add_development_dependency "mocha", "~> 0.13" s.add_development_dependency "timecop", "~> 0.5" + s.add_development_dependency "transpec" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Add transpec as a development dependency
diff --git a/spec/builders/mobi_spec.rb b/spec/builders/mobi_spec.rb index abc1234..def5678 100644 --- a/spec/builders/mobi_spec.rb +++ b/spec/builders/mobi_spec.rb @@ -10,13 +10,15 @@ end end - before(:all) { generate_book } + before(:all) do + generate_book + @builder = Polytexnic::Builders::Mobi.new + @built = @builder.build! + chdir_to_book + end after(:all) { remove_book } describe "#build!" do - subject(:builder) { Polytexnic::Builders::Mobi.new } - before { @built = builder.build! } - it "should generate the EPUB" do expect('epub/book.epub').to exist end @@ -24,11 +26,11 @@ # Because of the way kindlegen uses tempfiles, testing for the # actual generation of the MOBI causes an error, so we just # check the command. - it "should generate the MOBI" do - expect(@built).to match(/kindlegen/) - expect(@built).to match(/epub\/book.epub/) + describe "MOBI generation" do + subject(:built) { @built } + it { should match /kindlegen/ } + it { should match /epub\/book\.epub/ } end - end end end
Move builder.build! into before(:all) block for MOBI [#52758883]
diff --git a/spec/fixtures/factories.rb b/spec/fixtures/factories.rb index abc1234..def5678 100644 --- a/spec/fixtures/factories.rb +++ b/spec/fixtures/factories.rb @@ -13,6 +13,11 @@ permissions %w(signin editor) end + factory :gds_editor, parent: :user do + organisation_slug "government-digital-service" + organisation_content_id "af07d5a5-df63-4ddc-9383-6a666845ebe9" + end + factory :cma_editor, parent: :user do organisation_slug "competition-and-markets-authority" organisation_content_id "957eb4ec-089b-4f71-ba2a-dc69ac8919ea"
Add factory for gds_editor User
diff --git a/spec/acceptance/freeradius__mod_spec.rb b/spec/acceptance/freeradius__mod_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/freeradius__mod_spec.rb +++ b/spec/acceptance/freeradius__mod_spec.rb @@ -14,7 +14,8 @@ } file { '/etc/raddb/mods-config/perl/auth.pl': ensure => file, - require => Class['freeradius::install'], + require => Package['freeradius-perl'], + notify => Class['freeradius::service'], } EOF
Fix dependencies in acceptance tests
diff --git a/spec/taint_aliases_spec.rb b/spec/taint_aliases_spec.rb index abc1234..def5678 100644 --- a/spec/taint_aliases_spec.rb +++ b/spec/taint_aliases_spec.rb @@ -10,9 +10,23 @@ end TaintAliases::TAINT_ALIASES.each do |a| + suffix = 'aeiou'[a[-1]] ? 'd' : 'ed' + query = a + suffix + "?" + it "should be tainted with #{a}" do @obj.public_send a @obj.should be_tainted + end + + it "should be untainted with un#{a}" do + @obj.public_send "un" + a + @obj.should_not be_tainted + end + + it "should be queryable with #{query}" do + @obj.public_send(query).should be_false + @obj.public_send a + @obj.public_send(query).should be_true end end end @@ -31,10 +45,6 @@ ary.should be_tainted end end - - - - end end
Add specs for untaints and taint queries They're not particularly thorough, but they sound pretty enterprise.
diff --git a/config/environment.rb b/config/environment.rb index abc1234..def5678 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,7 @@ # Load the Rails application. require File.expand_path('../application', __FILE__) +Jbuilder.key_format camelize: :lower + # Initialize the Rails application. Rails.application.initialize!
Use camelCase in JBuilder output Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
diff --git a/lib/tasks/deployment/20191004110122_update_the_brain.rake b/lib/tasks/deployment/20191004110122_update_the_brain.rake index abc1234..def5678 100644 --- a/lib/tasks/deployment/20191004110122_update_the_brain.rake +++ b/lib/tasks/deployment/20191004110122_update_the_brain.rake @@ -0,0 +1,12 @@+namespace :after_party do + desc 'Deployment task: update_the_brain' + task update_the_brain: :environment do + puts "Running deploy task 'update_the_brain'" + + # Put your task implementation HERE. + InterventionTypeGroup.find_by(icon: 'head-side-brain').update(icon: 'users') + # Update task as completed. If you remove the line below, the task will + # run with every deploy (or every time you call after_party:run). + AfterParty::TaskRecord.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp + end +end
Add rake task to nobble the brain
diff --git a/lib/onfido/api.rb b/lib/onfido/api.rb index abc1234..def5678 100644 --- a/lib/onfido/api.rb +++ b/lib/onfido/api.rb @@ -4,19 +4,40 @@ @api_key = options[:api_key] end - def method_missing(method, *args) - klass = method.to_s.split('_').collect(&:capitalize).join - Object.const_get("Onfido::#{klass}").new(@api_key) - rescue NameError - super + def applicant + Onfido::Applicant.new(@api_key) end - def respond_to_missing?(method, include_private = false) - klass = method.to_s.capitalize - Object.const_get("Onfido::#{klass}") - true - rescue NameError - super + def check + Onfido::Check.new(@api_key) + end + + def document + Onfido::Document.new(@api_key) + end + + def live_photo + Onfido::LivePhoto.new(@api_key) + end + + def report + Onfido::Report.new(@api_key) + end + + def report_type_group + Onfido::ReportTypeGroup.new(@api_key) + end + + def sdk_token + Onfido::SdkToken.new(@api_key) + end + + def webhook + Onfido::Webhook.new(@api_key) + end + + def address + Onfido::Address.new(@api_key) end end end
Replace method_missing with explicit methods Replace the use of method_missing in Onfido::API with explicit methods for each resource. This allows users to create verifying doubles in rspec tests, as well as making it clearer what methods are available on the class.
diff --git a/lib/rottendesk.rb b/lib/rottendesk.rb index abc1234..def5678 100644 --- a/lib/rottendesk.rb +++ b/lib/rottendesk.rb @@ -18,7 +18,7 @@ def logger=(logger) @logger = logger @logger.formatter = proc do |severity, datetime, progname, msg| - "Rottendesk #{severity}: #{msg}" + "Rottendesk #{severity}: #{msg}\n" end end end
Add newline in logger message
diff --git a/lib/c2y/dsl/context/user.rb b/lib/c2y/dsl/context/user.rb index abc1234..def5678 100644 --- a/lib/c2y/dsl/context/user.rb +++ b/lib/c2y/dsl/context/user.rb @@ -10,14 +10,12 @@ instance_eval(&block) end - private + [:github, :groups].each do |attr| + define_method(attr) do |arg| + @result.send("#{attr}=", arg) + end - def github(user_github) - @result.github = user_github - end - - def groups(user_groups) - @result.groups = user_groups + private attr end end end
Use dynamic method definition in User
diff --git a/config/initializers/nr_sidekiq_queue_latency.rb b/config/initializers/nr_sidekiq_queue_latency.rb index abc1234..def5678 100644 --- a/config/initializers/nr_sidekiq_queue_latency.rb +++ b/config/initializers/nr_sidekiq_queue_latency.rb @@ -0,0 +1,13 @@+class NewRelicQueueLatencyLogger + def call(worker, job, queue) + queue_latency = Time.now.utc - Time.at(job["enqueued_at"], in: "+00:00") + ::NewRelic::Agent.add_custom_attributes({ queue_latency: queue_latency, queue: queue }) + yield + end +end + +Sidekiq.configure_server do |config| + config.server_middleware do |chain| + chain.add NewRelicQueueLatencyLogger + end +end
Add queue latency for Sidekiq jobs in NR
diff --git a/lib/jsonapi/resource_for.rb b/lib/jsonapi/resource_for.rb index abc1234..def5678 100644 --- a/lib/jsonapi/resource_for.rb +++ b/lib/jsonapi/resource_for.rb @@ -16,7 +16,11 @@ else def resource_for(type) resource_name = JSONAPI::Resource._resource_name_from_type(type) - resource_name.safe_constantize if resource_name + resource = resource_name.safe_constantize if resource_name + if resource.nil? + raise NameError, "JSONAPI: Could not find resource '#{type}'. (Class #{resource_name} not found)" + end + resource end end # :nocov:
Raise a NameError if a resource can not be found
diff --git a/recipes/cluster.rb b/recipes/cluster.rb index abc1234..def5678 100644 --- a/recipes/cluster.rb +++ b/recipes/cluster.rb @@ -25,21 +25,20 @@ cluster_nodes = node['rabbitmq']['clustering']['cluster_nodes'] cluster_nodes = cluster_nodes.to_json +auto_cluster_nodes = cluster_nodes +static_cluster_nodes = cluster_nodes + # Manual clustering unless node['rabbitmq']['clustering']['use_auto_clustering'] # Join in cluster - rabbitmq_cluster cluster_nodes do + rabbitmq_cluster auto_cluster_nodes do cluster_name node['rabbitmq']['clustering']['cluster_name'] action :join end end # Set cluster name : It will be skipped once same cluster name has been set in the cluster. -rabbitmq_cluster cluster_nodes do +rabbitmq_cluster static_cluster_nodes do cluster_name node['rabbitmq']['clustering']['cluster_name'] - action :set_cluster_name + action [:set_cluster_name, :change_cluster_node_type] end -# Change the cluster node type -rabbitmq_cluster cluster_nodes do - action :change_cluster_node_type -end
Fix resource cloning deprecation warnings
diff --git a/recipes/install.rb b/recipes/install.rb index abc1234..def5678 100644 --- a/recipes/install.rb +++ b/recipes/install.rb @@ -24,16 +24,6 @@ include_recipe 'yum-epel' if platform_family?('rhel') -# fedora >= 22 workaround -# dnf provider for fedora not yet in chef -# https://github.com/chef/chef/issues/3201 -if node['platform_family'] == 'fedora' && node['platform_version'] >= '22' - p = execute 'dnf -y install yum' do - action :nothing - end - p.run_action(:run) -end - if node['openvpn']['git_package'] == true package 'openvpn-git' else
Remove the DNF workaround since Chef supports DNF now Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/app/controllers/users/profiles_controller.rb b/app/controllers/users/profiles_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users/profiles_controller.rb +++ b/app/controllers/users/profiles_controller.rb @@ -1,9 +1,13 @@ class Users::ProfilesController < Devise::SessionsController # before_filter :configure_sign_in_params, only: [:create] + respond_to :json, :html + def show @user = User.find(params[:id]) - render :'devise/profiles/show' ## possible refactor + + render json: @user + # render :'devise/profiles/show' ## possible refactor end # GET /resource/sign_in # def new
Add json endpoint for users
diff --git a/aptly.gemspec b/aptly.gemspec index abc1234..def5678 100644 --- a/aptly.gemspec +++ b/aptly.gemspec @@ -13,7 +13,6 @@ s.files = files.grep(/^(lib|bin)/) s.homepage = 'https://github.com/ryanuber/ruby-aptly' s.license = 'Apache 2.0' - s.executables = files.grep(/^bin/) { |f| File.basename f } s.test_files = files.grep(/^spec/) s.require_paths = ['lib']
Remove unused executables line in gemspec
diff --git a/lib/serverspec/type/user.rb b/lib/serverspec/type/user.rb index abc1234..def5678 100644 --- a/lib/serverspec/type/user.rb +++ b/lib/serverspec/type/user.rb @@ -29,11 +29,11 @@ end def minimum_days_between_password_change - @runner.minimum_user_days_between_password_change(@name).stdout.to_i + @runner.get_user_minimum_days_between_password_change(@name).stdout.to_i end def maximum_days_between_password_change - @runner.maximum_user_days_between_password_change(@name).stdout.to_i + @runner.get_user_maximum_days_between_password_change(@name).stdout.to_i end end end
Use get_ prefix as per changes in serverspec
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 @@ -10,11 +10,12 @@ Time.at(timestamp).strftime('%Y%m%d') end - def key(name, timestamp=Time.now.to_i) + def key(name, timestamp) return "events:#{clean_name(name)}:#{date(timestamp)}" end def handle(data) + data[:event][:timestamp] ||= Time.now.to_i Bluecap::Redis.setbit( key(data[:event][:name], data[:event][:timestamp]), data[:event][:id],
Set default timestamp in handle, not key
diff --git a/lib/cortex/snippets/client.rb b/lib/cortex/snippets/client.rb index abc1234..def5678 100644 --- a/lib/cortex/snippets/client.rb +++ b/lib/cortex/snippets/client.rb @@ -4,16 +4,18 @@ module Cortex module Snippets class Client + include ActionView::Helpers::TranslationHelper + def initialize(cortex_client) @cortex_client = cortex_client end - def snippet(request, options = {}, &block) + def snippet(request, options = {}, block) snippets = current_webpage(request).snippets || [] snippet = snippets.find { |snippet| snippet[:document][:name] == options[:id] } if snippet.nil? || snippet[:document][:body].nil? || snippet[:document][:body].empty? - content_tag(:snippet, capture(&block), options) + content_tag(:snippet, block, options) else content_tag(:snippet, snippet[:document][:body].html_safe, options) end
Modify expected block input + add TranslationHelper for content_tag
diff --git a/lib/descartes/models/users.rb b/lib/descartes/models/users.rb index abc1234..def5678 100644 --- a/lib/descartes/models/users.rb +++ b/lib/descartes/models/users.rb @@ -34,16 +34,12 @@ end def add_favorite(uuid) - preferences = JSON.parse(self.preferences) - preferences['favorites'].push(uuid).uniq! - self.preferences = preferences.to_json + self.preferences.favorites.push(uuid).uniq! self.save end def remove_favorite(uuid) - preferences = JSON.parse(self.preferences) - preferences['favorites'].delete_if {|f| f === uuid} - self.preferences = preferences.to_json + self.preferences.favorites.delete_if {|f| f === uuid} self.save end end
Revert "need to parse out preferences before adding/removing favorites" This reverts commit 4b8ecce1c2f19662e7c96f6272ad90482e4f89b2.
diff --git a/lib/dm-salesforce/property.rb b/lib/dm-salesforce/property.rb index abc1234..def5678 100644 --- a/lib/dm-salesforce/property.rb +++ b/lib/dm-salesforce/property.rb @@ -5,5 +5,3 @@ require 'dm-salesforce/property/serial' require 'dm-salesforce/property/boolean' -require 'dm-salesforce/property/integer' -require 'dm-salesforce/property/float'
Remove references to unecessary Integer and Float (in the DM1 case).
diff --git a/refinerycms-inquiries.gemspec b/refinerycms-inquiries.gemspec index abc1234..def5678 100644 --- a/refinerycms-inquiries.gemspec +++ b/refinerycms-inquiries.gemspec @@ -16,7 +16,7 @@ s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- spec/*`.split("\n") - s.add_dependency 'refinerycms-core', '~> 2.1.0.dev' - s.add_dependency 'refinerycms-settings', '~> 2.1.0.dev' + s.add_dependency 'refinerycms-core', '~> 2.1.0' + s.add_dependency 'refinerycms-settings', '~> 2.1.0' s.add_dependency 'filters_spam', '~> 0.2' end
Use non dev versions for Refinery's extension dependencies.
diff --git a/memdash.gemspec b/memdash.gemspec index abc1234..def5678 100644 --- a/memdash.gemspec +++ b/memdash.gemspec @@ -11,7 +11,8 @@ gem.homepage = 'https://github.com/bryckbost/memdash' gem.add_dependency 'activerecord', '~> 3.0' - gem.add_dependency 'dalli', '~> 2.0' + gem.add_dependency 'dalli', '~> 2.0' + gem.add_dependency 'sinatra', '~> 1.3' gem.add_development_dependency 'database_cleaner' gem.add_development_dependency 'rake'
Add Sinatra as a run time dependency
diff --git a/core/app/models/spree/calculator/default_tax.rb b/core/app/models/spree/calculator/default_tax.rb index abc1234..def5678 100644 --- a/core/app/models/spree/calculator/default_tax.rb +++ b/core/app/models/spree/calculator/default_tax.rb @@ -23,7 +23,7 @@ end def compute_shipment(shipment) - round_to_two_places(shipment.cost * rate.amount) + round_to_two_places(shipment.amount * rate.amount) end def compute_line_item(line_item)
Use amount, not cost, to compute a shipment in default tax calculator
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index abc1234..def5678 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -7,16 +7,16 @@ end def create_user(opt={ }) - email = opt[:email] || 'test@indeos.es' + @user_id_counter ||= 0 + id = @user_id_counter += 1 + email = opt[:email] || "user_#{id}@indeos.es" password = opt[:password] || 'secret' server.add_user email, password, opt end def create_admin(opt={ }) - email = opt[:email] || 'test@indeos.es' - password = opt[:password] || 'secret' opt[:admin] = true # Ensure user will be an admin - server.add_user email, password, opt + create_user opt end def login_as_user(user=create_user)
Add id to created users
diff --git a/lib/sequel/plugins/pg_trgm.rb b/lib/sequel/plugins/pg_trgm.rb index abc1234..def5678 100644 --- a/lib/sequel/plugins/pg_trgm.rb +++ b/lib/sequel/plugins/pg_trgm.rb @@ -3,7 +3,7 @@ module PgTrgm module DatasetMethods def text_search(column, query) - where("? % ?", column, query).reverse_order{ similarity(column, query) } + where(Sequel.lit('? % ?', column, query)).reverse_order{ similarity(column, query) } end end end
Replace implicit SQL literal in filter method. Sequel 4.46 deprecated implicitly treating strings in filter methods as SQL literals, and encourages explicitly using Sequel.lit. https://github.com/jeremyevans/sequel/blob/master/CHANGELOG#L237
diff --git a/app/models/renalware/pathology/view_historical_observations.rb b/app/models/renalware/pathology/view_historical_observations.rb index abc1234..def5678 100644 --- a/app/models/renalware/pathology/view_historical_observations.rb +++ b/app/models/renalware/pathology/view_historical_observations.rb @@ -11,9 +11,7 @@ def call observations_for_descriptions = find_observations_for_descriptions - date_range = determine_date_range_for_observations(observations_for_descriptions) - observations = filter_observations_within_date_range(observations_for_descriptions, date_range) - results_archive = build_results_archive(observations) + results_archive = build_results_archive(observations_for_descriptions) present(results_archive) end @@ -26,15 +24,6 @@ ).call end - def determine_date_range_for_observations(observations) - observations = DetermineDateRangeQuery.new(relation: observations, limit: @limit).call - ObservationDateRange.new(relation: observations).call - end - - def filter_observations_within_date_range(observations, date_range) - ObservationsWithinDateRangeQuery.new(relation: observations, date_range: date_range).call - end - def build_results_archive(observations) HistoricalResults.new(observations, @descriptions) end
Remove unnecessary filtering on historical obs
diff --git a/spec/helpers/html_tag_spec.rb b/spec/helpers/html_tag_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/html_tag_spec.rb +++ b/spec/helpers/html_tag_spec.rb @@ -10,6 +10,10 @@ it "returns an simple self-closing tag with option" do tag("hr", :class => "thin").should == %[<hr class="thin" />] end + + it "returns an orphean tag when open is set to true" do + tag("hr", {:class => "thin"}, true).should == %[<hr class="thin">] + end end describe "#content_tag" do @@ -21,4 +25,4 @@ content_tag("b", "Hello", :class => "highlight").should == %[<b class="highlight">Hello</b>] end end -end+end
Add test for the orphean tag on html_tag_helper
diff --git a/markdown-style.rb b/markdown-style.rb index abc1234..def5678 100644 --- a/markdown-style.rb +++ b/markdown-style.rb @@ -2,3 +2,5 @@ exclude_rule 'line-length' exclude_rule 'no-duplicate-header' + +rule 'ul-indent', :indent => 4
Allow unordered lists with four-space indentation By default, Markdown lint expects unordered lists to be indented using two spaces, but all lists here already use four: <https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md007---unordered-list-indentation>.
diff --git a/spec/hermod/xml_section_builder/integer_node_spec.rb b/spec/hermod/xml_section_builder/integer_node_spec.rb index abc1234..def5678 100644 --- a/spec/hermod/xml_section_builder/integer_node_spec.rb +++ b/spec/hermod/xml_section_builder/integer_node_spec.rb @@ -0,0 +1,29 @@+require "minitest_helper" + +module Hermod + describe XmlSection do + + IntegerXml = XmlSection.build do |builder| + builder.integer_node :day_of_the_week, range: {min: 1, max: 7} + end + + describe "Integer nodes" do + subject do + IntegerXml.new + end + + it "should accept a valid number" do + subject.day_of_the_week 7 + value_of_node("DayOfTheWeek").must_equal "7" + end + + it "should raise an error if the number is above the maximum" do + proc { subject.day_of_the_week 8 }.must_raise InvalidInputError + end + + it "should raise an error if the number is below the minimum" do + proc { subject.day_of_the_week 0 }.must_raise InvalidInputError + end + end + end +end
Add tests for integer nodes Somehow this spec file was missed
diff --git a/lib/active_record/connection_adapters/clickhouse/oid/date_time.rb b/lib/active_record/connection_adapters/clickhouse/oid/date_time.rb index abc1234..def5678 100644 --- a/lib/active_record/connection_adapters/clickhouse/oid/date_time.rb +++ b/lib/active_record/connection_adapters/clickhouse/oid/date_time.rb @@ -20,7 +20,7 @@ # Type cast a value for schema dumping. This method is private, as we are # hoping to remove it entirely. def type_cast_for_schema(value) # :nodoc: - value + value.inspect end end
Return back inspect for datetime type cast
diff --git a/config/initializers/_patch.rb b/config/initializers/_patch.rb index abc1234..def5678 100644 --- a/config/initializers/_patch.rb +++ b/config/initializers/_patch.rb @@ -1,4 +1,4 @@-# patch to correct utf8 string wrongly encoded as ASCII-8BIT +# patch to correct utf8 string wrongly encoded as ASCII-8BIT and suppress file system proxy load # tested on linux with ruby 2.2.7-p470 module ProxyPacRb # Encodes strings as UTF-8 @@ -17,4 +17,29 @@ data end end + + # Dump Proxy pac to file system + class ProxyPacLoader + def initialize + @loaders = [] + @loaders << ProxyPacStringLoader.new + @loaders << ProxyPacUriLoader.new + # @loaders << ProxyPacFileLoader.new + @loaders << ProxyPacNullLoader.new + + @default_loader = -> { ProxyPacNullLoader.new } + end + end + # Handle proxy pac == nil + class ProxyPacNullLoader + def load(proxy_pac) + proxy_pac.type = :null + + raise StandardError, 'URL or script is not valid' + end + + def suitable_for?(proxy_pac) + proxy_pac.nil? + end + end end
Patch ProxyPacRb to disallow use of proxypac on file system (for security)
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index abc1234..def5678 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -0,0 +1,6 @@+Raven.configure do |config| + config.processors -= [Raven::Processor::PostData] # Send POST data + config.processors -= [Raven::Processor::Cookies] # Send cookies + + config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s) +end
Send POST data and cookies with Sentry
diff --git a/config/initializers/tmpdir.rb b/config/initializers/tmpdir.rb index abc1234..def5678 100644 --- a/config/initializers/tmpdir.rb +++ b/config/initializers/tmpdir.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true -class Dir - def self.tmpdir - OpenWebslides.config.tmpdir.to_s +unless Rails.env.test? + class Dir + def self.tmpdir + OpenWebslides.config.tmpdir.to_s + end end end
Allow Travis to pass upload test
diff --git a/whitesimilarity.gemspec b/whitesimilarity.gemspec index abc1234..def5678 100644 --- a/whitesimilarity.gemspec +++ b/whitesimilarity.gemspec @@ -10,7 +10,7 @@ spec.email = ['elpapapollo@gmail.com'] spec.description = %q{An implementation of the White Similarity Algorithm in C} spec.summary = %q{White Similarity Algorithm} - spec.homepage = '' + spec.homepage = 'https://github.com/jfairbank/whitesimilarity' spec.license = 'MIT' spec.files = `git ls-files`.split($/) @@ -21,5 +21,4 @@ spec.add_development_dependency 'bundler', '~> 1.3' spec.add_development_dependency 'rake' - spec.add_development_dependency 'rake-compiler' end
Add homepage and remove development dependency 'rake-compiler'
diff --git a/config/puma.rb b/config/puma.rb index abc1234..def5678 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,2 +1,3 @@ port ENV['PORT'] || 3000 environment ENV['RAILS_ENV'] || 'development' +threads 0, 16
Set the default number of threads
diff --git a/db/migrate/20170706125048_add_daily_menus.rb b/db/migrate/20170706125048_add_daily_menus.rb index abc1234..def5678 100644 --- a/db/migrate/20170706125048_add_daily_menus.rb +++ b/db/migrate/20170706125048_add_daily_menus.rb @@ -3,7 +3,7 @@ create_table :daily_menus do |t| t.datetime :date, null: false t.string :content, null: false - t.references :restaurant, index: true, foreign_key: true, null: false + t.references :restaurant, index: true, null: false, foreign_key: { on_delete: :cascade } end add_index :daily_menus, %i[date restaurant_id], unique: true
Add cascade to foreign key
diff --git a/spec/defines/osx_defaults_spec.rb b/spec/defines/osx_defaults_spec.rb index abc1234..def5678 100644 --- a/spec/defines/osx_defaults_spec.rb +++ b/spec/defines/osx_defaults_spec.rb @@ -0,0 +1,34 @@+require 'spec_helper' + +describe 'boxen::osx_defaults' do + let(:title) { 'example' } + let(:domain) { 'com.example' } + let(:key) { 'testkey' } + let(:value) { 'yes' } + + let(:params) { + { :domain => domain, + :key => key, + :value => value, + } + } + + it do + should contain_exec("osx_defaults write #{domain}:#{key}=>#{value}") + end + + context "currentHost" do + let(:host) { 'currentHost' } + let(:params) { + { :domain => domain, + :key => key, + :value => value, + :host => host + } + } + + it do + should contain_exec("osx_defaults write #{host} #{domain}:#{key}=>#{value}") + end + end +end
Add simple specs around boxen::osx_defaults
diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/users_helper_spec.rb @@ -1,15 +1,7 @@ require 'rails_helper' -# Specs in this file have access to a helper object that includes -# the UsersHelper. For example: -# -# describe UsersHelper do -# describe "string concat" do -# it "concats two strings with spaces" do -# expect(helper.concat_strings("this","that")).to eq("this that") -# end -# end -# end -RSpec.describe UsersHelper, type: :helper do - pending "add some examples to (or delete) #{__FILE__}" + + +describe UsersHelper do + end
Add User Helper Spec File
diff --git a/spec/requests/rails_admin_spec.rb b/spec/requests/rails_admin_spec.rb index abc1234..def5678 100644 --- a/spec/requests/rails_admin_spec.rb +++ b/spec/requests/rails_admin_spec.rb @@ -11,4 +11,16 @@ end end + # A common mistake for translators is to forget to change the YAML file's + # root key from en to their own locale (as people tend to use the English + # file as template for a new translation). + describe "localization" do + it "should default to English" do + get rails_admin_dashboard_path + + response.should contain("Site administration") + response.should contain("Dashboard") + end + end + end
Add test to ensure English localization is working. A common mistake for translators is to forget to change the YAML file's root key from en to their own locale (as people tend to use the English file as template for a new translation).
diff --git a/lib/cangaroo/webhook/client.rb b/lib/cangaroo/webhook/client.rb index abc1234..def5678 100644 --- a/lib/cangaroo/webhook/client.rb +++ b/lib/cangaroo/webhook/client.rb @@ -14,7 +14,23 @@ def post(payload, request_id, parameters) request_body = body(payload, request_id, parameters).to_json - req = self.class.post(url, headers: headers, body: request_body) + + request_options = { + headers: headers, + body: request_body + } + + if Rails.configuration.cangaroo.basic_auth + request_options.merge!( + basic_auth: { + username: connection.key, + password: connection.token + } + ) + end + + req = self.class.post(url, request_options) + if req.response.code == '200' req.parsed_response elsif req.response.code == '203' @@ -34,7 +50,7 @@ def headers { - 'X_HUB_TOKEN' => connection.token, + 'X_HUB_TOKEN' => connection.token || '', 'Content-Type' => 'application/json', 'Accept' => 'application/json' }
Send POST with connection key as HTTP basic auth password when enabled
diff --git a/lib/modules/comfy_opengraph.rb b/lib/modules/comfy_opengraph.rb index abc1234..def5678 100644 --- a/lib/modules/comfy_opengraph.rb +++ b/lib/modules/comfy_opengraph.rb @@ -37,7 +37,7 @@ def get_fragment_value(fragment) if fragment.tag =~ /file/ # get path when fragment is file - # URI.join(root_url, rails_blob_path(fragment.attachments.first.blob, only_path: true)) + URI.join(root_url, rails_blob_path(fragment.attachments.first.blob, only_path: true)) else # expect a string by default fragment.content&.squish end
Put back code commented out
diff --git a/lib/vagrant-managed-servers.rb b/lib/vagrant-managed-servers.rb index abc1234..def5678 100644 --- a/lib/vagrant-managed-servers.rb +++ b/lib/vagrant-managed-servers.rb @@ -1,6 +1,7 @@ require "pathname" require "vagrant-managed-servers/plugin" +require "vagrant-winrm-syncedfolders/plugin" module VagrantPlugins module ManagedServers
Add a require statement so that the vagrant-winrm-syncedfolders plugin is loaded This will force the `vagrant-winrm-syncedfolders` plugin to be loaded.
diff --git a/lib/open_food_network/user_balance_calculator.rb b/lib/open_food_network/user_balance_calculator.rb index abc1234..def5678 100644 --- a/lib/open_food_network/user_balance_calculator.rb +++ b/lib/open_food_network/user_balance_calculator.rb @@ -6,7 +6,7 @@ end def balance - -completed_orders.sum(&:outstanding_balance) + -completed_orders.to_a.sum(&:outstanding_balance) end private
Convert relation to array to be able to use sum
diff --git a/lib/capistrano/lephare/defaults.rb b/lib/capistrano/lephare/defaults.rb index abc1234..def5678 100644 --- a/lib/capistrano/lephare/defaults.rb +++ b/lib/capistrano/lephare/defaults.rb @@ -31,3 +31,5 @@ set :mysqldump_args, "--opt --single-transaction" set :db_pull_filename, "app/Resources/database/#{fetch(:stage)}.sql.bz2" + +set :crontab_file, "app/Resources/crontab"
Add default value for crontab
diff --git a/lib/capistrano/tasks/database.rake b/lib/capistrano/tasks/database.rake index abc1234..def5678 100644 --- a/lib/capistrano/tasks/database.rake +++ b/lib/capistrano/tasks/database.rake @@ -1,3 +1,8 @@+def system_v(cmd) + info "Execute '#{cmd}'" + system cmd +end + desc 'Copy database from the server to your local database' task db2local: ['deploy:set_rails_env'] do on roles(:app) do @@ -21,18 +26,18 @@ credentials = [ "--user=#{ username }", - password ? "-p #{ password }" : '' + password && "--password=#{ password }" ].compact.join(' ') info 'Importing database' - system "gunzip -f #{ filename }" + system_v "gunzip -f #{ filename }" - system "mysqladmin -f #{ credentials } drop #{ database }" - system "mysqladmin #{ credentials } create #{ database }" - system "mysql #{ credentials } #{ database } < #{ filename.chomp('.gz') }" + system_v "mysqladmin -f #{ credentials } drop #{ database }" + system_v "mysqladmin #{ credentials } create #{ database }" + system_v "mysql #{ credentials } #{ database } < #{ filename.chomp('.gz') }" - system "rm #{ filename.chomp('.gz') }" + system_v "rm #{ filename.chomp('.gz') }" info 'Finished importing database' end
Make cap task db2local more robust and verbose - "--password=" instead of "-p " for compatibility with different mysql versions - log all locally executed commands
diff --git a/roles/osx-ah.rb b/roles/osx-ah.rb index abc1234..def5678 100644 --- a/roles/osx-ah.rb +++ b/roles/osx-ah.rb @@ -0,0 +1,8 @@+name "osx-ah" +description "This role is specific to machines require the software loadset for the Center for the Arts" + + # Include the classlab role, which contains the base osx role as well +run_list "role[osx-classlab]" + +# Set OIV dock attribute. +default_attributes("oiv" => {"dock" => true})
Add Art History role with OIV dock attribute
diff --git a/lib/psd/layer_info/unicode_name.rb b/lib/psd/layer_info/unicode_name.rb index abc1234..def5678 100644 --- a/lib/psd/layer_info/unicode_name.rb +++ b/lib/psd/layer_info/unicode_name.rb @@ -6,8 +6,7 @@ def parse pos = @file.tell - len = @file.read_int * 2 - @data = @file.read(len).unpack("A#{len}")[0].encode('UTF-8').delete("\000") + @data = @file.read_unicode_string # The name seems to be padded with null bytes. This is the easiest solution. @file.seek pos + @length
Fix parsing and decoding of UTF-16 layer name.
diff --git a/lib/rrj/models/concerns/methods.rb b/lib/rrj/models/concerns/methods.rb index abc1234..def5678 100644 --- a/lib/rrj/models/concerns/methods.rb +++ b/lib/rrj/models/concerns/methods.rb @@ -10,8 +10,8 @@ # Create thread keepalive def create_keepalive - ::Log.info "Janus Instance #{name} ..." - if !enable && session_id.nil? && thread_id.nil? + ::Log.info "Janus Instance '#{name}' ..." + if enable && session_id.nil? && thread_id.nil? ::Log.info 'has a new keepalive session' janus_instance = keepalive_object_new set(session: janus_instance.session, enable: true)
Fix test for create thread keepalive
diff --git a/lib/graphql/types/relay/base_connection.rb b/lib/graphql/types/relay/base_connection.rb index abc1234..def5678 100644 --- a/lib/graphql/types/relay/base_connection.rb +++ b/lib/graphql/types/relay/base_connection.rb @@ -24,6 +24,10 @@ # end # class Types::PostConnection < Types::BaseConnection # edge_type(Types::PostEdge) + # edges_nullable(true) + # edge_nullable(true) + # node_nullable(true) + # has_nodes_field(true) # end # # @see Relay::BaseEdge for edge types
Add example of nullable options to Types::Relay::BaseConnection
diff --git a/lib/rubocop/cop/lint/useless_comparison.rb b/lib/rubocop/cop/lint/useless_comparison.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/lint/useless_comparison.rb +++ b/lib/rubocop/cop/lint/useless_comparison.rb @@ -10,18 +10,14 @@ # x.top >= x.top class UselessComparison < Cop MSG = 'Comparison of something with itself detected.'.freeze - OPS = %w(== === != < > <= >= <=>).freeze + def_node_matcher :comparison?, "(send $_ {:#{OPS.join(' :')}} $_)" + def on_send(node) - # lambda.() does not have a selector - return unless node.loc.selector - - op = node.loc.selector.source - return unless OPS.include?(op) - - receiver, _method, args = *node - add_offense(node, :selector) if receiver == args + comparison?(node) do |receiver, args| + add_offense(node, :selector) if receiver == args + end end end end
Modify Lint/UselessComparison to use NodePattern
diff --git a/csv_to_popolo.gemspec b/csv_to_popolo.gemspec index abc1234..def5678 100644 --- a/csv_to_popolo.gemspec +++ b/csv_to_popolo.gemspec @@ -19,6 +19,7 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.6" + spec.add_development_dependency "json-schema", "~> 2.0.0" spec.add_development_dependency "rake" spec.add_dependency "json"
Add development dependency on json-schema
diff --git a/site-cookbooks/backup_restore/spec/recipes/configure_ruby_spec.rb b/site-cookbooks/backup_restore/spec/recipes/configure_ruby_spec.rb index abc1234..def5678 100644 --- a/site-cookbooks/backup_restore/spec/recipes/configure_ruby_spec.rb +++ b/site-cookbooks/backup_restore/spec/recipes/configure_ruby_spec.rb @@ -0,0 +1,54 @@+require_relative '../spec_helper' + +describe 'backup_restore::configure_ruby' do + let(:chef_run) do + runner = ChefSpec::Runner.new( + cookbook_path: %w(site-cookbooks cookbooks), + platform: 'centos', + version: '6.5' + ) do |node| + node.set['cloudconductor']['applications'] = { + dynamic_git_app: { + type: 'dynamic', + parameters: { + backup_directories: '/var/www/app' + } + } + } + node.set['backup_restore']['config']['use_proxy'] = 'localhost' + node.set['backup_restore']['destinations']['s3'] = { + bucket: 'cloudconductor', + access_key_id: '1234', + secret_access_key: '4321', + region: 'us-east-1', + prefix: '/backup' + } + end + runner.converge(described_recipe) + end + + it 'create clon' do + expect(chef_run).to ChefSpec::Matchers::ResourceMatcher.new( + :backup_model, + :create, + :ruby_full + ).with( + description: 'Full Backup ruby application with gems', + schedule: { + minute: '0', + hour: '2', + day: '*', + month: '*', + weekday: '0' + }, + cron_options: { + path: ENV['PATH'], + output_log: '/var/log/backup/backup_ruby.log' + } + ) + end + + it 'set_proxy_env' do + expect(chef_run).to run_ruby_block('set_proxy_env') + end +end
Add chef-spec for configuire_ruby recipe
diff --git a/week-4/good-guess/my_solution.rb b/week-4/good-guess/my_solution.rb index abc1234..def5678 100644 --- a/week-4/good-guess/my_solution.rb +++ b/week-4/good-guess/my_solution.rb @@ -1,6 +1,7 @@ # Good Guess -# I worked on this challenge [by myself, with: ]. - - +# I worked on this challenge Abe and Brian. +def good_guess?(num) +num == 42 +end # Your Solution Below
Insert the files and codes
diff --git a/pulitzer.gemspec b/pulitzer.gemspec index abc1234..def5678 100644 --- a/pulitzer.gemspec +++ b/pulitzer.gemspec @@ -26,9 +26,9 @@ s.add_dependency "carrierwave" s.add_dependency "carrierwave-aws" s.add_dependency "mini_magick" - s.add_dependency "cancancan" s.add_development_dependency "sqlite3" s.add_development_dependency "minitest" s.add_development_dependency "byebug" + s.add_development_dependency "cancancan" end
Move back cancan only as a dev dependency
diff --git a/readthis.gemspec b/readthis.gemspec index abc1234..def5678 100644 --- a/readthis.gemspec +++ b/readthis.gemspec @@ -22,6 +22,6 @@ spec.add_development_dependency 'activesupport', '> 4.0' spec.add_development_dependency 'bundler', '~> 1.16' spec.add_development_dependency 'hiredis', '~> 0.6' - spec.add_development_dependency 'rake', '~> 12.3' + spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec', '~> 3.7' end
Update rake requirement from ~> 12.3 to ~> 13.0 Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v12.3.0...v13.0.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/lib/bosh/inception/cli_helpers/settings.rb b/lib/bosh/inception/cli_helpers/settings.rb index abc1234..def5678 100644 --- a/lib/bosh/inception/cli_helpers/settings.rb +++ b/lib/bosh/inception/cli_helpers/settings.rb @@ -8,7 +8,7 @@ # Defaults to ~/.bosh_inception; and can be overridden with either: # * $SETTINGS - to a folder (supported method) def settings_dir - @settings_dir ||= (ENV["SETTINGS"] || "~/.bosh_inception") + @settings_dir ||= File.expand_path(ENV["SETTINGS"] || "~/.bosh_inception") end def settings_path
Expand $SETTINGS or ~/.bosh_inception path before using
diff --git a/spec/parameter_handler_spec.rb b/spec/parameter_handler_spec.rb index abc1234..def5678 100644 --- a/spec/parameter_handler_spec.rb +++ b/spec/parameter_handler_spec.rb @@ -7,7 +7,7 @@ describe "ParameterHandler" do include Helpers::Examples - describe "valid" do + context "valid" do before(:all) do parse_file :simple_parameter end @@ -29,7 +29,7 @@ end end - describe "invalid" do + context "invalid" do before(:all) do parse_file :bad_parameter end
Use the RSpec context method.
diff --git a/lib/generators/anonymous_user_generator.rb b/lib/generators/anonymous_user_generator.rb index abc1234..def5678 100644 --- a/lib/generators/anonymous_user_generator.rb +++ b/lib/generators/anonymous_user_generator.rb @@ -1,4 +1,4 @@-class AnonymousUserGenerator < Rails::Generators::NamedBase +class AnonymousUserGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) include Rails::Generators::Migration
Use Base instead of NamedBase.
diff --git a/spec/error_spec.rb b/spec/error_spec.rb index abc1234..def5678 100644 --- a/spec/error_spec.rb +++ b/spec/error_spec.rb @@ -0,0 +1,15 @@+describe 'Error' do + + it 'raises returned errors' do + + http_client = double(MessageBird::HttpClient) + client = MessageBird::Client.new('', http_client) + + expect(http_client) + .to receive(:request) + .and_return('{"errors":[{"code": 2,"description": "Request not allowed (incorrect access_key)","parameter": "access_key"}]}') + + expect{client.message('some-id')}.to raise_error(MessageBird::ErrorException) + end + +end
Add test to assert errors are raised when returend by service
diff --git a/spec/spec_suite.rb b/spec/spec_suite.rb index abc1234..def5678 100644 --- a/spec/spec_suite.rb +++ b/spec/spec_suite.rb @@ -6,15 +6,15 @@ end def run_core_examples - system("ruby #{dir}/core_spec_suite.rb #{spec_opts}") || raise("Core suite Failed") + system("ruby -W #{dir}/core_spec_suite.rb #{spec_opts}") || raise("Core suite Failed") end def run_rspec_examples - system("ruby #{dir}/rspec_spec_suite.rb #{spec_opts}") || raise("Rspec suite Failed") + system("ruby -W #{dir}/rspec_spec_suite.rb #{spec_opts}") || raise("Rspec suite Failed") end def run_test_unit_examples - system("ruby #{dir}/test_unit_spec_suite.rb") || raise("Test::Unit suite Failed") + system("ruby -W #{dir}/test_unit_spec_suite.rb") || raise("Test::Unit suite Failed") end def spec_opts
Enable Ruby warnings during spec suite
diff --git a/textrazor.gemspec b/textrazor.gemspec index abc1234..def5678 100644 --- a/textrazor.gemspec +++ b/textrazor.gemspec @@ -26,4 +26,5 @@ spec.add_development_dependency "rspec", "~> 3.0.0" spec.add_development_dependency "pry" spec.add_development_dependency "pry-byebug" + spec.add_development_dependency "dotenv" end
Add dotenv as a development dependency Signed-off-by: Aymeric Brisse <a462d6a602eb500679b027b39ff035d803cbe1e9@perfect-memory.com>
diff --git a/tiny_tds.gemspec b/tiny_tds.gemspec index abc1234..def5678 100644 --- a/tiny_tds.gemspec +++ b/tiny_tds.gemspec @@ -11,5 +11,7 @@ s.authors = ['Ken Collins', 'Erik Bryn'] s.email = 'ken@metaskills.net' s.extensions = ['ext/tiny_tds/extconf.rb'] - s.files = Dir['CHANGELOG', 'MIT-LICENSE', 'README.rdoc', 'ext/**/*', 'lib/**/*'] + + # use git file manifest instead of globing, exclude the gemspec from the list of files + s.files = `git ls-files`.split - ["tiny_tds.gemspec"] end
Use git existing files to build gem files manifest
diff --git a/spec/models/bootstrap_haml_helpers/scaffolding/container_spec.rb b/spec/models/bootstrap_haml_helpers/scaffolding/container_spec.rb index abc1234..def5678 100644 --- a/spec/models/bootstrap_haml_helpers/scaffolding/container_spec.rb +++ b/spec/models/bootstrap_haml_helpers/scaffolding/container_spec.rb @@ -0,0 +1,35 @@+require 'spec_helper' + +describe BootstrapHamlHelpers::Scaffolding::Container do + let(:content) { 'content' } + subject { BootstrapHamlHelpers::Scaffolding::Container.new(content) } + + context 'given a string' do + it 'renders the string content' do + Nokogiri.parse(subject.build).text == content + end + end + + context "given a block" do + let(:content) { Proc.new { 2 } } + subject { BootstrapHamlHelpers::Scaffolding::Container.new(&content) } + + it 'yields to a block for its content' do + subject.view_context.should_receive(:capture).and_yield + subject.build + end + + it 'has proper attributes' do + subject.default_css_class.should == 'container' + subject.tag_name.should == :div + end + end + + context 'with the fluid option' do + subject { BootstrapHamlHelpers::Scaffolding::Container.new(content, fluid: true) } + + it 'uses the fluid classname' do + subject.default_css_class.should == "container-fluid" + end + end +end
Add container spec from lux.
diff --git a/lib/ffi.rb b/lib/ffi.rb index abc1234..def5678 100644 --- a/lib/ffi.rb +++ b/lib/ffi.rb @@ -13,7 +13,7 @@ require 'ffi/ffi' -elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' +elsif defined?(RUBY_ENGINE) && (RUBY_ENGINE == 'jruby' || RUBY_ENGINE == 'rbx') $LOAD_PATH.delete(File.dirname(__FILE__)) $LOAD_PATH.delete(File.join(File.dirname(__FILE__), 'ffi')) unless $LOADED_FEATURES.nil?
Apply JRuby loading logic to rbx as well
diff --git a/lib/fog/providers.rb b/lib/fog/providers.rb index abc1234..def5678 100644 --- a/lib/fog/providers.rb +++ b/lib/fog/providers.rb @@ -14,6 +14,7 @@ require 'fog/providers/ecloud' require 'fog/providers/go_grid' require 'fog/providers/google' +require 'fog/providers/hp' require 'fog/providers/linode' require 'fog/providers/local' require 'fog/providers/new_servers'
Add a new HP provider.
diff --git a/lib/pagelime-rack.rb b/lib/pagelime-rack.rb index abc1234..def5678 100644 --- a/lib/pagelime-rack.rb +++ b/lib/pagelime-rack.rb @@ -1,2 +1,9 @@-require 'pagelime' -require 'rack/pagelime' +require_relative 'pagelime' +require_relative 'pagelime/s3_client' +require_relative 'pagelime/xml_processor' +require_relative 'rack/pagelime' + +Pagelime.configure do |config| + config.client_class = Pagelime::S3Client + config.processor_class = Pagelime::XmlProcessor +end
Use configure block to setup defaults
diff --git a/vendor/dotenv.rb b/vendor/dotenv.rb index abc1234..def5678 100644 --- a/vendor/dotenv.rb +++ b/vendor/dotenv.rb @@ -2,6 +2,12 @@ file = File.expand_path("../../.env", __FILE__) if File.exists?(file) File.read(file).split("\n").map {|x| x.split("=") }.each do |k,v| - ENV[k.strip] = v.strip + if k.match(/^export/) + STDOUT.puts(k.split(' ').last) + ENV[k.split(' ').last] = v.strip + else + STDOUT.puts(k) + ENV[k.strip] = v.strip + end end end
Add check for the word export in .env
diff --git a/lib/royce/methods.rb b/lib/royce/methods.rb index abc1234..def5678 100644 --- a/lib/royce/methods.rb +++ b/lib/royce/methods.rb @@ -39,7 +39,7 @@ def has_role? name # grab each role name and check for inclusion - roles.pluck(:name).include?(name.to_s) + roles.exists?(name: name.to_s) end def allowed_role? name
Use exists? to test for presence of a role.
diff --git a/test-page.gemspec b/test-page.gemspec index abc1234..def5678 100644 --- a/test-page.gemspec +++ b/test-page.gemspec @@ -16,4 +16,5 @@ gem.version = Test::Page::VERSION gem.add_development_dependency "rspec", "~>2.0" + gem.add_development_dependency "simplecov" end
Add SimpleCov for development dependency.
diff --git a/lib/tasks/metro.rake b/lib/tasks/metro.rake index abc1234..def5678 100644 --- a/lib/tasks/metro.rake +++ b/lib/tasks/metro.rake @@ -1,6 +1,26 @@ namespace :metro do - desc "Import metro data from go-metro.com" task import: :environment do + desc "Import metro data from go-metro.com" Metro::Importer.new(logger: Logger.new(STDOUT)).import! end + + task titleize: :environment do + desc "Titleize existing metro data" + Stop.find_each do |s| + s.update( + name: Metro::StringHelper.titleize(s.name), + description: Metro::StringHelper.titleize(s.description), + ) + end + Route.find_each do |r| + r.update( + long_name: Metro::StringHelper.titleize(r.long_name), + ) + end + Trip.find_each do |t| + t.update( + headsign: Metro::StringHelper.titleize_headsign(t.headsign), + ) + end + end end
Add rake task to titleize existing data
diff --git a/features/step_definitions/filtering_steps.rb b/features/step_definitions/filtering_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/filtering_steps.rb +++ b/features/step_definitions/filtering_steps.rb @@ -4,7 +4,6 @@ end Then(/^I can get a list of all documents with matching metadata$/) do - content_store_has_mosw_reports_finder visit finder_path('mosw-reports') page.should_not have_content('2 reports') page.should have_css('.filtered-results .document', count: 2) @@ -26,7 +25,6 @@ end When(/^I search documents by keyword$/) do - content_store_has_mosw_reports_finder stub_keyword_search_api_request visit finder_path('mosw-reports')
Remove some duplication in steps Stubbing the content store again in these steps isn't needed.
diff --git a/pagelapse.gemspec b/pagelapse.gemspec index abc1234..def5678 100644 --- a/pagelapse.gemspec +++ b/pagelapse.gemspec @@ -20,4 +20,6 @@ spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake" + spec.add_dependency "capybara" + spec.add_dependency "poltergeist" end
Add capybara dependencies to gemspec
diff --git a/omnibus-ansible-dk/config/projects/ansible-dk.rb b/omnibus-ansible-dk/config/projects/ansible-dk.rb index abc1234..def5678 100644 --- a/omnibus-ansible-dk/config/projects/ansible-dk.rb +++ b/omnibus-ansible-dk/config/projects/ansible-dk.rb @@ -2,8 +2,8 @@ maintainer "OmniTI" homepage "https://github.com/omniti-labs/ansible-dk" -# Defaults to C:/ansibledk on Windows -# and /opt/ansibledk on all other platforms +# Defaults to C:/ansible-dk on Windows +# and /opt/ansible-dk on all other platforms install_dir "#{default_root}/#{name}" build_version Omnibus::BuildVersion.semver @@ -22,7 +22,7 @@ # Creates required build directories dependency "preparation" -# ansibledk dependencies/components +# ansible-dk dependencies/components # Python land dependency "python"
Fix project name in comments in project file
diff --git a/lib/cerberus/builder/maven2.rb b/lib/cerberus/builder/maven2.rb index abc1234..def5678 100644 --- a/lib/cerberus/builder/maven2.rb +++ b/lib/cerberus/builder/maven2.rb @@ -8,7 +8,8 @@ def run Dir.chdir @config[:application_root] cmd = @config[:builder, :maven2, :cmd] || 'mvn' - @output = `#{@config[:bin_path]}#{cmd} #{@config[:builder, :maven2, :task]} 2>&1` + task = @config[:builder, :maven2, :task] || 'test' + @output = `#{@config[:bin_path]}#{cmd} #{task} 2>&1` successful? end
Set default task of Maven2 builder to 'test' git-svn-id: 6b26ca77393dff49db3326cae3426b51e4e94954@65 65aa75ef-ce15-0410-bc34-cdc86d5f77e6
diff --git a/test/html_renderer_test.rb b/test/html_renderer_test.rb index abc1234..def5678 100644 --- a/test/html_renderer_test.rb +++ b/test/html_renderer_test.rb @@ -11,7 +11,7 @@ binding_klass.expect :today, Time.now.to_s binding_klass.expect :last_updated, Time.now.to_s - renderer = Mako::HTMLRenderer.new(template: @template, binding: binding_klass) + renderer = Mako::HTMLRenderer.new(template: @template, bound: binding_klass) rendered = renderer.render assert_instance_of String, rendered
Change arg from binding to bound
diff --git a/upcoming.gemspec b/upcoming.gemspec index abc1234..def5678 100644 --- a/upcoming.gemspec +++ b/upcoming.gemspec @@ -13,7 +13,7 @@ s.required_ruby_version = '>= 2.0' - s.add_dependency 'activesupport', '~> 4.1' + s.add_dependency 'activesupport', '~> 5.0' %w(rake minitest-given).each do |d| s.add_development_dependency d end
Allow activesupport 5.x in dependencies
diff --git a/spec/models/task_user_spec.rb b/spec/models/task_user_spec.rb index abc1234..def5678 100644 --- a/spec/models/task_user_spec.rb +++ b/spec/models/task_user_spec.rb @@ -3,9 +3,9 @@ describe TaskUser do before(:each) do @valid_attributes = { - :user_id => 1, - :task_id => 1, - :unread => false, + :user => User.make, + :task => Task.make, + :unread => false } end
Update specs: use factory instead of magic numbers in TaskUser spec.