diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/requeue_content.rb b/lib/requeue_content.rb index abc1234..def5678 100644 --- a/lib/requeue_content.rb +++ b/lib/requeue_content.rb @@ -8,7 +8,7 @@ end def call - scope.each do |edition| + scope.find_each do |edition| publish_to_queue(edition) end end
Use find_each instead of each This shouldn't load the whole result set into memory.
diff --git a/app/models/spree/promotion/rules/copayment.rb b/app/models/spree/promotion/rules/copayment.rb index abc1234..def5678 100644 --- a/app/models/spree/promotion/rules/copayment.rb +++ b/app/models/spree/promotion/rules/copayment.rb @@ -9,7 +9,7 @@ end def eligible?(order, options = {}) - return false unless ( variant.present? && copayment_relations.present? ) + return false unless ( variant.present? && variant.active_copayments.present? ) order.variants.exists?(variant) && order.variants.exists?(variant.active_copayments) end @@ -19,7 +19,7 @@ end def copayment_relations - variant.try(:copayment_relations).active + variant.try(:copayment_relations) end end end
Fix rule for active and inactive relations
diff --git a/lib/ruby_extensions.rb b/lib/ruby_extensions.rb index abc1234..def5678 100644 --- a/lib/ruby_extensions.rb +++ b/lib/ruby_extensions.rb @@ -1,4 +1,4 @@-require 'unidecode' +require 'unidecoder' # Array extensions Array.class_eval do @@ -24,7 +24,7 @@ end def transliterate - # Unidecode gem is missing some hyphen transliterations + # Unidecoder gem is missing some hyphen transliterations self.gsub(/[-‐‒–—―⁃−­]/, '-').to_ascii end
Switch to `unidecoder` gem (instead of `unidecode`)
diff --git a/app/serializers/sprangular/user_serializer.rb b/app/serializers/sprangular/user_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/sprangular/user_serializer.rb +++ b/app/serializers/sprangular/user_serializer.rb @@ -2,13 +2,8 @@ class UserSerializer < BaseSerializer attributes *(user_attributes | [:bill_address_id, :ship_address_id]) - has_many :completed_orders, serializer: Sprangular::LiteOrderSerializer has_many :addresses, serializer: Sprangular::AddressSerializer has_many :payment_sources, serializer: Sprangular::PaymentSourceSerializer - - def completed_orders - object.orders.complete - end def payment_sources object.credit_cards
Remove completed_orders from /account response
diff --git a/lib/services/travis.rb b/lib/services/travis.rb index abc1234..def5678 100644 --- a/lib/services/travis.rb +++ b/lib/services/travis.rb @@ -1,5 +1,11 @@ class Service::Travis < Service self.title = "Travis CI" + url "https://travis-ci.org" + + maintained_by :github => 'travisci' + + supported_by :email => 'support@travis-ci.com' + default_events :push, :pull_request, :issue_comment, :public, :member string :user password :token
Add maintainer and support for Travis CI.
diff --git a/lib/shotoku/command.rb b/lib/shotoku/command.rb index abc1234..def5678 100644 --- a/lib/shotoku/command.rb +++ b/lib/shotoku/command.rb @@ -45,6 +45,7 @@ def complete!(exitstatus: nil, termsig: nil, exception: nil) + raise 'already completed (possible bug)' if completed? @exitstatus = exitstatus @termsig = termsig @exception = exception
Raise error when tried to complete twice
diff --git a/lib/xcode/deploy/s3.rb b/lib/xcode/deploy/s3.rb index abc1234..def5678 100644 --- a/lib/xcode/deploy/s3.rb +++ b/lib/xcode/deploy/s3.rb @@ -25,7 +25,7 @@ def deploy remote_ipa = upload @builder.ipa_path - base_url = remote_ipa.public_url(:secure => false).to_s.split("/")[0..-2].join("/") + base_url = remote_ipa.public_url(:secure => true).to_s.split("/")[0..-2].join("/") WebAssets.generate @builder, base_url do |dir| Dir["#{dir}/*"].each do |path| @@ -35,4 +35,4 @@ end end end -end+end
Change S3 to use HTTPS iOS 7.1 requires OTA app installation links to use HTTPS – they fail otherwise.
diff --git a/lib/tasks/budgets.rake b/lib/tasks/budgets.rake index abc1234..def5678 100644 --- a/lib/tasks/budgets.rake +++ b/lib/tasks/budgets.rake @@ -15,14 +15,13 @@ desc "Update investments original_heading_id with current heading_id" task set_original_heading_id: :environment do - puts "Starting" + ApplicationLogger.new.info "Setting original_heading_id to investments" Budget::Investment.find_each do |investment| unless investment.original_heading_id.present? investment.update_column(:original_heading_id, investment.heading_id) end print "." end - puts "Finished" end end
Use application logger in set_original_heading_id The pull request adding the original heading was done before we started using `ApplicationLogger` in rake tasks.
diff --git a/lib/tasks/install.rake b/lib/tasks/install.rake index abc1234..def5678 100644 --- a/lib/tasks/install.rake +++ b/lib/tasks/install.rake @@ -1,5 +1,6 @@ namespace :app do task :install do + Rake::Task['db:drop'].invoke Rake::Task['db:seed'].invoke puts "Clovrr is now installed." puts "\nVisit your_site/admin to get started."
Drop the database, just in case. HC SVNT DRACONES.
diff --git a/lib/tay/cli/helpers.rb b/lib/tay/cli/helpers.rb index abc1234..def5678 100644 --- a/lib/tay/cli/helpers.rb +++ b/lib/tay/cli/helpers.rb @@ -5,7 +5,8 @@ protected - def spec + def spec(bust_cache = false) + @spec = nil if bust_cache @spec ||= get_specification end
Add param to force refresh of spec from disk
diff --git a/lib/twitchus/worker.rb b/lib/twitchus/worker.rb index abc1234..def5678 100644 --- a/lib/twitchus/worker.rb +++ b/lib/twitchus/worker.rb @@ -18,7 +18,7 @@ data = { title: channel["status"], name: channel["name"], - image: channel["banner"], + image: channel["video_banner"], preview: data["preview"] }
Store video_banner instead of a banner
diff --git a/spec/functions/canonify_array_spec.rb b/spec/functions/canonify_array_spec.rb index abc1234..def5678 100644 --- a/spec/functions/canonify_array_spec.rb +++ b/spec/functions/canonify_array_spec.rb @@ -9,43 +9,50 @@ context "with arg => ['foo']" do it { - is_expected.to run.with_params(['foo']).and_return(['foo']) + is_expected.to + run.with_params(['foo']).and_return(['foo']) } end context "with arg => ['foo ']" do it { - is_expected.to run.with_params(['foo ']).and_return(['foo']) + is_expected.to + run.with_params(['foo ']).and_return(['foo']) } end context "with arg => [' foo']" do it { - is_expected.to run.with_params([' foo']).and_return(['foo']) + is_expected.to + run.with_params([' foo']).and_return(['foo']) } end context "with arg => [' foo ']" do it { - is_expected.to run.with_params([' foo ']).and_return(['foo']) + is_expected.to + run.with_params([' foo ']).and_return(['foo']) } end context "with arg => ['foo','bar']" do it { - is_expected.to run.with_params(['foo','bar']).and_return(['bar','foo']) + is_expected.to + run.with_params(['foo', 'bar']).and_return(['bar', 'foo']) } end context "with arg => ['foo','foo']" do it { - is_expected.to run.with_params(['foo','foo']).and_return(['foo']) + is_expected.to + run.with_params(['foo', 'foo']).and_return(['foo']) } end context "with arg => ['foo','bar','baz']" do it { - is_expected.to run.with_params(['foo','bar','baz']).and_return(['bar','baz','foo']) + is_expected.to + run.with_params(['foo', 'bar', 'baz']).and_return(['bar', 'baz', 'foo']) } end end
Fix rubocop issues with function
diff --git a/spec/observers/match_observer_spec.rb b/spec/observers/match_observer_spec.rb index abc1234..def5678 100644 --- a/spec/observers/match_observer_spec.rb +++ b/spec/observers/match_observer_spec.rb @@ -5,8 +5,6 @@ let(:contribution) { create(:contribution, state: :confirmed) } before do - Notification.unstub(:notify) - Notification.unstub(:notify_once) matching = create(:matching, match: match, contribution: contribution) create(:contribution, matching_id: matching.id) end @@ -47,7 +45,6 @@ { contribution_id: contribution.id }, { contribution: contribution }).ordered - match.notify_observers :match_been_met end end
Remove unstub from match observer specs
diff --git a/spec/providers/storage_schema_spec.rb b/spec/providers/storage_schema_spec.rb index abc1234..def5678 100644 --- a/spec/providers/storage_schema_spec.rb +++ b/spec/providers/storage_schema_spec.rb @@ -0,0 +1,16 @@+require_relative "../spec_helper" +load_resource("graphite", "storage_schema") +load_provider("graphite", "storage_schema") + +describe Chef::Provider::GraphiteStorageSchema do + + let(:resource_name) { "joe" } + + it "is whyrun support" do + expect(provider).to be_whyrun_supported + end + + it "for :create action, it exists" do + expect(provider.run_action(:create)) + end +end
Add spec coverage for the graphite_storage_schema provider.
diff --git a/spec/support/pathology_spec_helper.rb b/spec/support/pathology_spec_helper.rb index abc1234..def5678 100644 --- a/spec/support/pathology_spec_helper.rb +++ b/spec/support/pathology_spec_helper.rb @@ -10,7 +10,7 @@ observed_at: Time.zone.now, result: 1) descriptions.map do |description| - request = create(:pathology_observation_request, patient: patient) + request = create(:pathology_observation_request, patient: patient, requested_at: observed_at) create(:pathology_observation, request: request, description: description,
Fix UKRDC observations spec after changes_since change
diff --git a/spec/features/show_game_pairings_spec.rb b/spec/features/show_game_pairings_spec.rb index abc1234..def5678 100644 --- a/spec/features/show_game_pairings_spec.rb +++ b/spec/features/show_game_pairings_spec.rb @@ -2,14 +2,19 @@ RSpec.describe "show tournament round pairings" do context "Any vistor to the website" do + let(:tournament) { create :tournament } let(:round) { create :round, tournament: tournament } - let(:games) { create_list } + let!(:game_one) { create(:game_appointment, round: round) } + let!(:game_two) { create(:game_appointment, round: round) } + let!(:game_three) { create(:game_appointment, round: round) } fit "can navigate to a page showing the games for a tournament" do round_link = "Round #{round.number}" - visit tournament_path(tournament) + visit tournament_path(tournament, year: tournament.year) click_on(round_link) - expect(page).to have_selector + expect(page).to have_selector("#game_appointment_#{game_one.id}", text: "#{game_one.white_player.full_name}") + expect(page).to have_selector("#game_appointment_#{game_two.id}", text: "#{game_two.white_player.full_name}") + expect(page).to have_selector("#game_appointment_#{game_three.id}", text: "#{game_three.white_player.full_name}") end end
Add feature test for showing rounds
diff --git a/spec/acceptance/openldap__server__access_spec.rb b/spec/acceptance/openldap__server__access_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/openldap__server__access_spec.rb +++ b/spec/acceptance/openldap__server__access_spec.rb @@ -27,8 +27,15 @@ context 'with defaults' do it 'should idempotently run' do pp = <<-EOS - class { 'openldap::server': } - openldap::server::database { 'dc=example,dc=com' : } + class { '::openldap::server': } + + # This may be needed for the access rule below to work + ::openldap::server::schema { ['cosine', 'inetorgperson', 'nis']: + ensure => present, + } + + ::openldap::server::database { 'dc=example,dc=com' : } + ::openldap::server::access { 'admin': what => 'attrs=userPassword,shadowLastChange', access => ['by dn="cn=admin,dc=example,dc=com" write'],
Load schemas to possibly workaround the issues on centos7.
diff --git a/tinify.gemspec b/tinify.gemspec index abc1234..def5678 100644 --- a/tinify.gemspec +++ b/tinify.gemspec @@ -22,6 +22,6 @@ spec.add_development_dependency("bundler", "~> 1.7") spec.add_development_dependency("rake", "~> 10.0") - spec.add_development_dependency("minitest") - spec.add_development_dependency("webmock") + spec.add_development_dependency("minitest", "~> 5.5") + spec.add_development_dependency("webmock", "~> 1.20") end
Update development dependencies with versions.
diff --git a/Casks/intellij-idea14.rb b/Casks/intellij-idea14.rb index abc1234..def5678 100644 --- a/Casks/intellij-idea14.rb +++ b/Casks/intellij-idea14.rb @@ -1,6 +1,6 @@ cask 'intellij-idea14' do - version '14.1.5' - sha256 '50941026863e2d43f4c8dcc1c02f749c096c2d0bcf53943220314f0898efec24' + version '14.1.6' + sha256 '536385a0eba67347842c8df7616e47e9191a50ccf00e39ac5298759509d3ec33' url "https://download.jetbrains.com/idea/ideaIU-#{version}.dmg" homepage 'https://www.jetbrains.com/idea/index.html'
Upgrade IntelliJ IDEA Ultimate to 14.1.6
diff --git a/XLPagerTabStrip.podspec b/XLPagerTabStrip.podspec index abc1234..def5678 100644 --- a/XLPagerTabStrip.podspec +++ b/XLPagerTabStrip.podspec @@ -9,7 +9,7 @@ s.social_media_url = 'https://twitter.com/xmartlabs' s.ios.deployment_target = '8.0' s.requires_arc = true - s.ios.source_files = 'Sources/**/*' + s.ios.source_files = 'Sources/**/*.{h,m,swift}' s.ios.frameworks = 'UIKit', 'Foundation' s.resource_bundles = { 'XLPagerTabStrip' => ['Sources/ButtonCell.xib'] } end
Fix compilation of the project when using Xcode 9 new build system and CocoaPods With current podspec, one .xib file is getting picked up as a source, and is getting into Xcode Compile Sources build step in CocoaPods generated project. New build system is more strict than the old one, and prohibits this by saying: ``` error: unexpected duplicate task: CompileXIB /Path-To-Project/Pods/XLPagerTabStrip/Sources/ButtonCell.xib (in target 'XLPagerTabStrip') ``` This behavior is described in [this CocoaPods issue](https://github.com/CocoaPods/CocoaPods/issues/7079). This PR changes source_files search path from being * to more specific code-related one *.{h,m,swift}, thus picking only sources into sources. This fix can be verified by installing XLPagerTabStrip, trying to build with new Build System - it will fail. Then you can remove ButtonCell.xib file from Pods -> XLPagerTabStrip -> Compile Sources build phase and this time project will build successfully.
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 @@ -25,3 +25,5 @@ include TestHelpers load File.dirname(__FILE__) + "/support/rails_app/db/schema.rb" + +I18n.enforce_available_locales = false
Hide deprecation warning when running tests.
diff --git a/models/job_executor.rb b/models/job_executor.rb index abc1234..def5678 100644 --- a/models/job_executor.rb +++ b/models/job_executor.rb @@ -22,8 +22,9 @@ begin tests.each do |test| - job.results << test.exec(api) - job.save! + result = test.exec(api) + job.results << result + result.save! end status = status_message(job.results) reason = ''
Save individual results to avoid performance issue
diff --git a/actionpack/lib/action_view/inline_template.rb b/actionpack/lib/action_view/inline_template.rb index abc1234..def5678 100644 --- a/actionpack/lib/action_view/inline_template.rb +++ b/actionpack/lib/action_view/inline_template.rb @@ -1,10 +1,6 @@ module ActionView #:nodoc: class InlineTemplate #:nodoc: include Renderable - - # Count the number of inline templates - cattr_accessor :inline_template_count - @@inline_template_count = 0 def initialize(view, source, locals = {}, type = nil) @view = view @@ -13,14 +9,13 @@ @extension = type @locals = locals || {} - @method_key = @source + @method_key = "inline_#{@source.hash.abs}" @handler = Template.handler_class_for_extension(@extension).new(@view) end private - # FIXME: Modifying this shared variable may not thread safe def method_name_path_segment - "inline_#{@@inline_template_count += 1}" + @method_key end end end
Use the inline template's hash as a method key instead of relying on a counter
diff --git a/app/controllers/guide_container_controller.rb b/app/controllers/guide_container_controller.rb index abc1234..def5678 100644 --- a/app/controllers/guide_container_controller.rb +++ b/app/controllers/guide_container_controller.rb @@ -4,18 +4,13 @@ before_action :set_guide def show - if current_user? - @stats = subject.stats_for(current_user) - @next_exercise = subject.next_exercise(current_user) - else - @next_exercise = subject.first_exercise - end + @stats = subject.stats_for(current_user) + @next_exercise = subject.next_exercise(current_user) end private def set_guide - raise Mumuki::Domain::NotFoundError if subject.nil? @guide = subject.guide end end
Use domain updated method to simplify logic
diff --git a/tasks/mongoid_search.rake b/tasks/mongoid_search.rake index abc1234..def5678 100644 --- a/tasks/mongoid_search.rake +++ b/tasks/mongoid_search.rake @@ -2,14 +2,14 @@ desc 'Goes through all documents with search enabled and indexes the keywords.' task :index => :environment do if Mongoid::Search.classes.blank? - Log.log "No model to index keywords.\n" + Mongoid::Search::Log.log "No model to index keywords.\n" else Mongoid::Search.classes.each do |klass| - Log.silent = ENV['SILENT'] - Log.log "\nIndexing documents for #{klass.name}:\n" + Mongoid::Search::Log.silent = ENV['SILENT'] + Mongoid::Search::Log.log "\nIndexing documents for #{klass.name}:\n" klass.index_keywords! end - Log.log "\n\nDone.\n" + Mongoid::Search::Log.log "\n\nDone.\n" end end end
Use full namespace destination for Log class.
diff --git a/flatten_routes.gemspec b/flatten_routes.gemspec index abc1234..def5678 100644 --- a/flatten_routes.gemspec +++ b/flatten_routes.gemspec @@ -20,7 +20,7 @@ spec.require_paths = ['lib'] spec.add_development_dependency 'bundler', '~> 2.0' - spec.add_development_dependency 'rake', '~> 12.0' + spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec', '~> 3.0' spec.add_development_dependency 'actionpack', '~> 5.2.0' end
Update rake requirement from ~> 12.0 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.0.0...v13.0.3) Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@github.com>
diff --git a/lib/cryptoexchange/exchanges/trade_ogre/services/market.rb b/lib/cryptoexchange/exchanges/trade_ogre/services/market.rb index abc1234..def5678 100644 --- a/lib/cryptoexchange/exchanges/trade_ogre/services/market.rb +++ b/lib/cryptoexchange/exchanges/trade_ogre/services/market.rb @@ -34,7 +34,7 @@ ticker.base = market_pair.base ticker.target = market_pair.target ticker.market = TradeOgre::Market::NAME - ticker.last = NumericHelper.to_d(output['initialprice']) + ticker.last = NumericHelper.to_d(output['price']) ticker.high = NumericHelper.to_d(output['high']) ticker.low = NumericHelper.to_d(output['low']) ticker.volume = NumericHelper.divide(NumericHelper.to_d(output['volume']), ticker.last)
Fix price param for TradeOgre
diff --git a/spec/hcast/hcast_spec.rb b/spec/hcast/hcast_spec.rb index abc1234..def5678 100644 --- a/spec/hcast/hcast_spec.rb +++ b/spec/hcast/hcast_spec.rb @@ -4,6 +4,7 @@ describe ".create" do it "should cast hash attributes" do + pending input_hash = { contact: { name: "John Smith",
Mark unimplemented spec as pending
diff --git a/spec/nark/plugin_spec.rb b/spec/nark/plugin_spec.rb index abc1234..def5678 100644 --- a/spec/nark/plugin_spec.rb +++ b/spec/nark/plugin_spec.rb @@ -35,7 +35,7 @@ it "requires all plugins found" do Nark.load_plugins - Nark.available_plugins.should eql ["request_times", "requests", "revisions", "status_report"] + Nark.available_plugins.count.should eql 4 end end end
Refactor spec so that we care less about the structure of the available plugins results
diff --git a/spec/spec_helper_spec.rb b/spec/spec_helper_spec.rb index abc1234..def5678 100644 --- a/spec/spec_helper_spec.rb +++ b/spec/spec_helper_spec.rb @@ -39,6 +39,14 @@ chef_run end end # /context with a recipe + + context 'with both a recipe and a block' do + recipe 'test' do + ruby_block 'test' + end + + it { expect { chef_run }.to raise_error(Halite::Error) } + end # /context with both a recipe and a block end # /describe #recipe end
Test for the error case.
diff --git a/actionmailer/actionmailer.gemspec b/actionmailer/actionmailer.gemspec index abc1234..def5678 100644 --- a/actionmailer/actionmailer.gemspec +++ b/actionmailer/actionmailer.gemspec @@ -17,5 +17,5 @@ s.requirements << 'none' s.add_dependency('actionpack', version) - s.add_dependency('mail', '~> 2.3.0') + s.add_dependency('mail', '~> 2.4.0') end
Upgrade mail dependency to 2.4.0
diff --git a/actionpack-action_caching.gemspec b/actionpack-action_caching.gemspec index abc1234..def5678 100644 --- a/actionpack-action_caching.gemspec +++ b/actionpack-action_caching.gemspec @@ -6,6 +6,13 @@ gem.description = "Action caching for Action Pack (removed from core in Rails 4.0)" gem.summary = "Action caching for Action Pack (removed from core in Rails 4.0)" gem.homepage = "https://github.com/rails/actionpack-action_caching" + + gem.metadata = { + "bug_tracker_uri" => "https://github.com/rails/actionpack-action_caching/issues", + "changelog_uri" => "https://github.com/rails/actionpack-action_caching/blob/v#{gem.version}/CHANGELOG.md", + "documentation_uri" => "https://www.rubydoc.info/gems/actionpack-action_caching/#{gem.version}", + "source_code_uri" => "https://github.com/rails/actionpack-action_caching/tree/v#{gem.version}", + } gem.required_ruby_version = ">= 1.9.3" gem.files = `git ls-files`.split($/)
Add project metadata to the gemspec As per https://guides.rubygems.org/specification-reference/#metadata, add metadata to the gemspec file. This'll allow people to more easily access the source code, raise issues and read the changelog. These `bug_tracker_uri`, `changelog_uri`, `documentation_uri` and `source_code_uri` links will appear on the rubygems page at https://rubygems.org/gems/actionpack-action_caching and be available via the rubygems API after the next release.
diff --git a/railties/test/error_page_test.rb b/railties/test/error_page_test.rb index abc1234..def5678 100644 --- a/railties/test/error_page_test.rb +++ b/railties/test/error_page_test.rb @@ -1,6 +1,6 @@ require 'abstract_unit' require 'action_controller' -require 'action_controller/test_process' +require 'action_controller/test_case' RAILS_ENV = "test" CURRENT_DIR = File.expand_path(File.dirname(__FILE__)) @@ -22,13 +22,10 @@ map.connect ':controller/:action/:id' end -class ErrorPageControllerTest < Test::Unit::TestCase +class ErrorPageControllerTest < ActionController::TestCase def setup - @controller = ErrorPageController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - ActionController::Base.consider_all_requests_local = false + rescue_action_in_public! end def test_500_error_page_instructs_system_administrator_to_check_log_file @@ -38,6 +35,6 @@ end get :crash expected_log_file = "#{RAILS_ENV}.log" - assert_not_nil @response.body.index(expected_log_file) + assert_not_nil @response.body.index(expected_log_file), @response.body end end
Fix test broken by test process changes
diff --git a/trello_newsletter.gemspec b/trello_newsletter.gemspec index abc1234..def5678 100644 --- a/trello_newsletter.gemspec +++ b/trello_newsletter.gemspec @@ -13,9 +13,8 @@ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server." end - spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.} - spec.description = %q{TODO: Write a longer description or delete this line.} - spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.summary = %q{Use Trello to generate your newsletters.} + spec.homepage = "" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } @@ -25,4 +24,6 @@ spec.add_development_dependency "bundler", "~> 1.8" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "ruby-trello", "~> 1.1.3" + spec.add_development_dependency "maruku", "~> 0.7.2" end
Update gemspec with ruby trello and maruku gems - Ruby Trello is used to connect to Trello API - Maruku is used to convert markdown from Trello cards to HTML.
diff --git a/app/models/build.rb b/app/models/build.rb index abc1234..def5678 100644 --- a/app/models/build.rb +++ b/app/models/build.rb @@ -3,7 +3,7 @@ validates :job_id, presence: true - belongs_to :job + belongs_to :job, touch: true # Creates, queues, and returns itself. def self.create_with_queue(*args)
Build touches its job for cache
diff --git a/app/models/facet.rb b/app/models/facet.rb index abc1234..def5678 100644 --- a/app/models/facet.rb +++ b/app/models/facet.rb @@ -4,7 +4,7 @@ def self.check_active facets_to_save = [] - Facet.where(id: Session.product_type_id, feature_type: 'Binary').each do |facet| + Facet.where(product_type_id: Session.product_type_id, feature_type: 'Binary').each do |facet| products_counts = BinSpec.joins("INNER JOIN products on products.id=product_id").where(bin_specs: {name: facet.name, product_type: Session.product_type},products: {instock: 1}).count facet.active = (products_counts > 0 ? 1 : 0) facets_to_save << facet
Check active had a bug in it
diff --git a/guides/rails_guides.rb b/guides/rails_guides.rb index abc1234..def5678 100644 --- a/guides/rails_guides.rb +++ b/guides/rails_guides.rb @@ -39,6 +39,25 @@ exit 1 end +begin + require 'nokogiri' +rescue LoadError + # This can happen if doc:guides is executed in an application. + $stderr.puts('Generating guides requires Nokogiri.') + $stderr.puts(<<ERROR) if bundler? +Please add + + gem 'nokogiri' + +to the Gemfile, run + + bundle install + +and try again. +ERROR + exit 1 +end + require 'rails_guides/markdown' require "rails_guides/generator" RailsGuides::Generator.new.generate
Add error message for including nokogiri in Gemfile for rake doc:guides [ci skip] - When `rake doc:guides` is run from applications, it complains for presence of redcarpet if it not present in Gemfile - Similarly it should complain about nokogiri
diff --git a/rdf-isomorphic.gemspec b/rdf-isomorphic.gemspec index abc1234..def5678 100644 --- a/rdf-isomorphic.gemspec +++ b/rdf-isomorphic.gemspec @@ -0,0 +1,35 @@+#!/usr/bin/env ruby -rubygems +# -*- encoding: utf-8 -*- + +GEMSPEC = Gem::Specification.new do |gem| + gem.version = File.read('VERSION').chomp + gem.date = File.mtime('VERSION').strftime('%Y-%m-%d') + + gem.name = 'rdf-isomorphic' + gem.homepage = 'http://rdf.rubyforge.org/' + gem.license = 'Public Domain' if gem.respond_to?(:license=) + gem.description = 'RDF.rb plugin for graph bijections and isomorphic equivalence.' + gem.summary = 'RDF.rb plugin for graph bijections and isomorphic equivalence.' + gem.rubyforge_project = 'rdf' + + gem.authors = ['Ben Lavender','Arto Bendiken'] + gem.email = 'blavender@gmail.com' + + gem.platform = Gem::Platform::RUBY + gem.files = %w(AUTHORS README UNLICENSE VERSION) + Dir.glob('lib/**/*.rb') + gem.bindir = %q(bin) + gem.executables = %w() + gem.default_executable = gem.executables.first + gem.require_paths = %w(lib) + gem.extensions = %w() + gem.test_files = %w() + gem.has_rdoc = false + + gem.required_ruby_version = '>= 1.8.2' + gem.requirements = [] + gem.add_runtime_dependency 'rdf', '~> 0.2.0' + gem.add_development_dependency 'rdf-spec', '~> 0.2.0' + gem.add_development_dependency 'rspec', '>= 1.3.0' + gem.add_development_dependency 'yard' , '>= 0.5.3' + gem.post_install_message = nil +end
Rename gemspec so bundler can target it with git directly
diff --git a/server/config.ru b/server/config.ru index abc1234..def5678 100644 --- a/server/config.ru +++ b/server/config.ru @@ -11,8 +11,8 @@ 'soapbox_announcement_url' => '/announcement', 'soapbox_accept_url' => '/accept', 'soapbox_show_accept_button' => true, - 'soapbox_accept_color' => '#', - 'soapbox_dismiss_color' => '#' + 'soapbox_accept_color' => '#FFB300', + 'soapbox_dismiss_color' => '#7222F2' }.to_plist end
Add some colors to the plist
diff --git a/lib/resume/cli/argument_parser.rb b/lib/resume/cli/argument_parser.rb index abc1234..def5678 100644 --- a/lib/resume/cli/argument_parser.rb +++ b/lib/resume/cli/argument_parser.rb @@ -5,11 +5,12 @@ module CLI class ArgumentParser def self.parse + help = parser.help parser.parse!(ARGV) rescue OptionParser::InvalidOption - raise InvalidOptionError, parser.help + raise InvalidOptionError, help rescue OptionParser::MissingArgument - raise MissingArgumentError, parser.help + raise MissingArgumentError, help end def self.parser
Remove duplicate call to parser.help
diff --git a/predicate_bang.gemspec b/predicate_bang.gemspec index abc1234..def5678 100644 --- a/predicate_bang.gemspec +++ b/predicate_bang.gemspec @@ -8,10 +8,10 @@ spec.version = PredicateBang::VERSION spec.authors = ["Faraz Yashar"] spec.email = ["faraz.yashar@gmail.com"] - spec.summary = %q{Convert your `predicate_methods?` into `bangified_predicate_methods!` without -abusing `method_missing`} - spec.description = %q{Convert your `predicate_methods?` into `bangified_predicate_methods!` without -abusing `method_missing`.} + spec.summary = "Convert your predicate_methods? into bang_methods! without +abusing method_missing" + spec.description = "Convert your predicate_methods? into bang_methods! without +abusing method_missing." spec.homepage = 'https://github.com/fny/predicate_bang' spec.license = "MIT"
Tidy up gem summary and description
diff --git a/winnow.gemspec b/winnow.gemspec index abc1234..def5678 100644 --- a/winnow.gemspec +++ b/winnow.gemspec @@ -18,6 +18,8 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.add_dependency 'rouge', '~> 1.3' + spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec", "~> 2.14"
Add rouge as a dependency.
diff --git a/hephaestus/lib/resque/base.rb b/hephaestus/lib/resque/base.rb index abc1234..def5678 100644 --- a/hephaestus/lib/resque/base.rb +++ b/hephaestus/lib/resque/base.rb @@ -11,6 +11,13 @@ end def self.on_failure(e, *args) + id = args[0] + begin + document = Document.find(id) + document.update_attribute :status, "FAILED" + rescue Mongoid::Errors::DocumentNotFound + logging("Document not found. #{id}") + end logging('failure', args) end
[hephaestus] Change status if document fails
diff --git a/arm-eabi-binutils223.rb b/arm-eabi-binutils223.rb index abc1234..def5678 100644 --- a/arm-eabi-binutils223.rb +++ b/arm-eabi-binutils223.rb @@ -0,0 +1,49 @@+require 'formula' + +class ArmEabiBinutils223 <Formula + url 'http://ftp.gnu.org/gnu/binutils/binutils-2.23.2.tar.bz2' + homepage 'http://www.gnu.org/software/binutils/' + sha1 '042c51073205ebaf88c272d6168f9deb71984b56' + + depends_on 'gmp' + depends_on 'mpfr' + depends_on 'ppl11' + depends_on 'cloog' + + def patches + # discard PPL version test, as binutils 2.23 expect 0.11+, not 1.0+ + DATA + end + + def install + system "./configure", "--prefix=#{prefix}", "--target=arm-eabi", + "--disable-shared", "--disable-nls", + "--with-gmp=#{Formula.factory('gmp').prefix}", + "--with-mpfr=#{Formula.factory('mpfr').prefix}", + "--with-ppl=#{Formula.factory('ppl11').prefix}", + "--with-cloog=#{Formula.factory('cloog').prefix}", + "--enable-cloog-backend=isl", + "--disable-cloog-version-check", + "--enable-multilibs", "--enable-interwork", "--enable-lto", + "--disable-werror", "--disable-debug" + system "make" + system "make install" + end +end + +__END__ +--- a/configure 2012-08-09 22:02:06.000000000 +0200 ++++ b/configure 2012-08-09 22:06:14.000000000 +0200 +@@ -5662,12 +5662,6 @@ + int + main () + { +- +- #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11 +- choke me +- #endif +- +- ; + return 0; + } + _ACEOF
Add Binutils for ARM EABI v2.23.2
diff --git a/sambao21_workstation/recipes/sublime_text.rb b/sambao21_workstation/recipes/sublime_text.rb index abc1234..def5678 100644 --- a/sambao21_workstation/recipes/sublime_text.rb +++ b/sambao21_workstation/recipes/sublime_text.rb @@ -6,12 +6,6 @@ begin t = resources(:template => File.expand_path("Preferences.sublime-settings", File.join(sublime_user_path))) t.cookbook "sambao21_workstation" -end - -cookbook_file File.expand_path("Auto Encoding for Ruby.sublime-settings", File.join(sublime_user_path)) do - source "sublime_text-Auto Encoding for Ruby.sublime-settings" - owner node['current_user'] - mode "0600" end cookbook_file File.expand_path("Default (OSX).sublime-keymap", File.join(sublime_user_path)) do
Remove last traces of sublime auto encoding ruby package
diff --git a/app/controllers/socializer/activities/activities_controller.rb b/app/controllers/socializer/activities/activities_controller.rb index abc1234..def5678 100644 --- a/app/controllers/socializer/activities/activities_controller.rb +++ b/app/controllers/socializer/activities/activities_controller.rb @@ -27,7 +27,7 @@ def stream @stream ||= Activity.activity_stream(actor_uid: @activity.id, viewer_id: current_user.id) - .decorate + .decorate end end end
Style/MultilineMethodCallIndentation: Align .decorate with .activity_stream on line 28. .decorate
diff --git a/app/models/link_checker_api_report/create_from_batch_report.rb b/app/models/link_checker_api_report/create_from_batch_report.rb index abc1234..def5678 100644 --- a/app/models/link_checker_api_report/create_from_batch_report.rb +++ b/app/models/link_checker_api_report/create_from_batch_report.rb @@ -6,7 +6,7 @@ def create ActiveRecord::Base.transaction do - report = create_report + report = replace_or_create_report create_links(report) report end @@ -16,12 +16,25 @@ attr_reader :payload, :reportable + def replace_or_create_report + begin + replace_report + rescue ActiveRecord::RecordNotFound + create_report + end + end + + def replace_report + report = LinkCheckerApiReport.find_by!(batch_id: batch_id) + report.links.delete_all + report.update!(link_report_attributes) + report + end + def create_report LinkCheckerApiReport.create!( - batch_id: payload.fetch("id"), - completed_at: payload.fetch("completed_at"), - link_reportable: reportable, - status: payload.fetch("status"), + batch_id: batch_id, + **link_report_attributes, ) end @@ -38,4 +51,16 @@ .attributes_from_link_report(payload) .merge(ordering: index) end + + def link_report_attributes + { + completed_at: payload.fetch("completed_at"), + link_reportable: reportable, + status: payload.fetch("status"), + } + end + + def batch_id + payload.fetch("id") + end end
Replace or create link reports We're coming across a problem whereby the data sync is causing a mismatch in the batch IDs stored in Whitehall and the batch IDs stored in the Link Checker API. This is because the databases don't get copied across at the same time. We thought the best solution to this would be to simply replace any existing link report that exists with the same batch ID.
diff --git a/lib/extensions/destroy_callbacks/active_record/base.rb b/lib/extensions/destroy_callbacks/active_record/base.rb index abc1234..def5678 100644 --- a/lib/extensions/destroy_callbacks/active_record/base.rb +++ b/lib/extensions/destroy_callbacks/active_record/base.rb @@ -1,5 +1,14 @@ module Extensions::DestroyCallbacks::ActiveRecord::Base extend ActiveSupport::Concern + + module ClassMethods + def actable(*args) + args.unshift({}) if args.empty? + options = args.extract_options! + args.push(options.reverse_merge(dependent: :destroy)) + super(*args) + end + end included do around_destroy :update_status @@ -13,6 +22,7 @@ private def update_status + return if destroying? # Works around Rails #13609 @destroying = true yield ensure
Make all actable records destroy their specific records. This allows objects with foreign key constraints to be destroyed. This also allows for cyclic relations to be destroyed.
diff --git a/spec/acceptance/end_to_end_spec.rb b/spec/acceptance/end_to_end_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/end_to_end_spec.rb +++ b/spec/acceptance/end_to_end_spec.rb @@ -12,6 +12,7 @@ before do ENV["DB_PORT"] = db_port ENV["RAILS_ENV"] = "test" + `./bin/bundle exec rake db:create` end let(:output) { `./bin/bundle exec rails runner 'exit'` }
Make sure databases are created.
diff --git a/spec/dummy/lib/rom/test_adapter.rb b/spec/dummy/lib/rom/test_adapter.rb index abc1234..def5678 100644 --- a/spec/dummy/lib/rom/test_adapter.rb +++ b/spec/dummy/lib/rom/test_adapter.rb @@ -2,7 +2,6 @@ module TestAdapter class Relation < ROM::Relation adapter :test_adapter - schema_class Schema end class Gateway < ROM::Gateway
Remove setting schema_class in TestAdapter See https://github.com/rom-rb/rom/commit/e7878b1fce97bc43f2b9c85bf761af3bf238246a
diff --git a/spec/integration/cli_locks_spec.rb b/spec/integration/cli_locks_spec.rb index abc1234..def5678 100644 --- a/spec/integration/cli_locks_spec.rb +++ b/spec/integration/cli_locks_spec.rb @@ -4,15 +4,23 @@ with_reset_sandbox_before_each context 'when a deployment is in progress' do - before do + let(:blocking_deployment_manifest) do manifest_hash = Bosh::Spec::Deployments.simple_manifest - manifest_hash['update']['canary_watch_time'] = 6000 - deploy_from_scratch(manifest_hash: manifest_hash, no_track: true) + manifest_hash['jobs'][0]['template'] = 'job_with_blocking_compilation' + manifest_hash['jobs'][0]['instances'] = 1 + manifest_hash end it 'lists a deployment lock' do + deploy_result = deploy_from_scratch(manifest_hash: blocking_deployment_manifest, no_track: true) + task_id = Bosh::Spec::OutputParser.new(deploy_result).task_id('running') + director.wait_for_first_available_vm + output = bosh_runner.run_until_succeeds('locks', number_of_retries: 30) expect(output).to match(/\s*\|\s*deployment\s*\|\s*simple\s*\|/) + + director.vms.first.unblock_package + bosh_runner.run("task #{task_id}") # wait for task to complete end end
Make locks spec more deterministic Signed-off-by: Maria Shaldibina <dc03896a0185453e5852a5e0f0fab6cbd2e026ff@pivotal.io>
diff --git a/spec/rackson/object_mapper_spec.rb b/spec/rackson/object_mapper_spec.rb index abc1234..def5678 100644 --- a/spec/rackson/object_mapper_spec.rb +++ b/spec/rackson/object_mapper_spec.rb @@ -32,7 +32,23 @@ end it 'understands optional properties' do + expect(deserialized.something_optional).to be nil + with_optional = mapper.deserialize '{"foo": "bar", "bar": {"baz":"another thing"}, "something_optional": "this now exists"}', FakeObject + expect(with_optional.something_optional).to eq 'this now exists' + end + it 'exposes type mismatches' do + expect do + # DifferentFakeObject#baz is declared as a String above + mapper.deserialize '{ "baz": 1 }', DifferentFakeObject + end.to raise_error(/type mismatch between/) + end + + it 'yells about missing keys' do + expect do + # FakeObject also requires `bar` + mapper.deserialize '{ "foo": "bar" }', FakeObject + end.to raise_error(/missing required key/) end end end
Add tests for more cases.
diff --git a/spec/shoes/builtin_methods_spec.rb b/spec/shoes/builtin_methods_spec.rb index abc1234..def5678 100644 --- a/spec/shoes/builtin_methods_spec.rb +++ b/spec/shoes/builtin_methods_spec.rb @@ -3,8 +3,6 @@ describe Shoes::BuiltinMethods do let(:input_blk) { Proc.new {} } let(:app) { Shoes::App.new({}, &input_blk) } - - subject { Shoes::BuiltinMethods } before :each do Shoes::LOG.clear
Remove unused subject in specs
diff --git a/spec/spec_helper/load_path_spec.rb b/spec/spec_helper/load_path_spec.rb index abc1234..def5678 100644 --- a/spec/spec_helper/load_path_spec.rb +++ b/spec/spec_helper/load_path_spec.rb @@ -31,7 +31,7 @@ expect($LOAD_PATH).to include(THIRD_PARTY_DIR) end - it('should already have unique paths') do + it('should already have unique path') do expect($LOAD_PATH).to match_array($LOAD_PATH.uniq!) end end
Revert "Make word "path" plural" This reverts commit 1dbc4c3feed1ab4774e5a122b1af9ed5b533062a.
diff --git a/spec/unit/add_launch_agent_spec.rb b/spec/unit/add_launch_agent_spec.rb index abc1234..def5678 100644 --- a/spec/unit/add_launch_agent_spec.rb +++ b/spec/unit/add_launch_agent_spec.rb @@ -21,7 +21,7 @@ it 'symlinks the homebrew launch configuration into the launchAgents folder' do expect(runner).to create_link( "#{launchagent_path}/#{plist_filename}" - ).with(to: "/usr/local/opt/postgresql/#{plist_filename}").with(link_type: Symbol) + ).with(to: "/usr/local/opt/postgresql/#{plist_filename}").with(link_type: :symbolic) end it 'launches postgres' do
Update unit spec for modern Chef The link resource default link_type is now :symbolic instead of Symbol
diff --git a/spec/unit/virtus/attribute_spec.rb b/spec/unit/virtus/attribute_spec.rb index abc1234..def5678 100644 --- a/spec/unit/virtus/attribute_spec.rb +++ b/spec/unit/virtus/attribute_spec.rb @@ -60,4 +60,16 @@ it_behaves_like 'a class with boolean attribute' end end + + context 'with a module' do + let(:mod) { Module.new { include Virtus } } + let(:model) { Class.new } + + it 'adds attributes from the module to a class that includes it' do + mod.attribute(:test, String) + model.send(:include, mod) + + expect(model.attribute_set[:test]).to be_instance_of(Virtus::Attribute) + end + end end
Extend spec for Virtus.attribute with a module example
diff --git a/spec/helpers/contextual_link_helpers_spec.rb b/spec/helpers/contextual_link_helpers_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/contextual_link_helpers_spec.rb +++ b/spec/helpers/contextual_link_helpers_spec.rb @@ -0,0 +1,19 @@+require "rails_helper" + +describe ContextualLinkHelpers do + describe "#action_to_icon" do + it "returns the action parameter if no action matches" do + expect(helper.action_to_icon('unknown action')).to eq 'unknown action' + end + end + + describe "#contextual_links" do + it "should work with block returning nil" do + expect{ + helper.contextual_links('action') do + nil + end + }.to_not raise_exception + end + end +end
Add spec to test for contextual_links method properly handling nil block.
diff --git a/spec/requests/admin/admin_activities_spec.rb b/spec/requests/admin/admin_activities_spec.rb index abc1234..def5678 100644 --- a/spec/requests/admin/admin_activities_spec.rb +++ b/spec/requests/admin/admin_activities_spec.rb @@ -0,0 +1,51 @@+require 'rails_helper' + +RSpec.describe "Admin::Activities", type: :request do + let(:admin) { FactoryGirl.create(:user, :admin) } + + describe "GET /admin/activities" do + it "cannot viewed by non-admin user" do + user = FactoryGirl.create(:user) + login_as user + visit admin_activities_url + expect(page).to have_content("Permission Denied") + end + + it "display all activities" do + activities = FactoryGirl.create_list(:activity, 5) + + login_as admin + visit admin_activities_url + activities.each do |activity| + expect(page).to have_content(activity.name) + end + end + end + + describe "POST /admin/activities" do + it "creates a new activity" do + login_as admin + visit new_admin_activity_url + + within ".new_activity" do + fill_in "Name", with: "RubyConfTW" + fill_in "Description", with: "RubyConfTW is a conference of ruby in Taiwan" + click_button "Save" + end + + expect(page).to have_content("RubyConfTW") + end + + it "show errors when not fill required fields" do + login_as admin + visit new_admin_activity_url + + within ".new_activity" do + click_button "Save" + end + + expect(page).to have_css(".has-error") + end + end + +end
Add admin/activities request test with index and create parts
diff --git a/Library/Formula/libdap.rb b/Library/Formula/libdap.rb index abc1234..def5678 100644 --- a/Library/Formula/libdap.rb +++ b/Library/Formula/libdap.rb @@ -16,6 +16,12 @@ "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", + # __Always pass the curl prefix!__ + # Otherwise, configure will fall back to pkg-config and on Leopard + # and Snow Leopard, the libcurl.pc file that ships with the system + # is seriously broken---too many arch flags. This will be carried + # over to `dap-config` and from there the contamination will spread. + "--with-curl=/usr", "--with-included-regex" system "make install"
LibDAP: Use explicit path to system curl Without this we get some really nasty arch flags in `dap-config` on Leopard and Snow Leopard due to a fallback to buggy `libcurl.pc` files shipped with the system.
diff --git a/Casks/blu-ray-player.rb b/Casks/blu-ray-player.rb index abc1234..def5678 100644 --- a/Casks/blu-ray-player.rb +++ b/Casks/blu-ray-player.rb @@ -1,6 +1,6 @@ class BluRayPlayer < Cask - version '2.10.4' - sha256 '76e9731115b3305ba21f5c451f90d2123fd357defca8206a496a8f9b63480cc1' + version 'latest' + sha256 :no_check url 'http://www.macblurayplayer.com/user/download/Mac_Bluray_Player.dmg' homepage 'http://www.macblurayplayer.com/'
Upgrade Blu-Ray-Player to latest version
diff --git a/lib/infra_operator/commands/base.rb b/lib/infra_operator/commands/base.rb index abc1234..def5678 100644 --- a/lib/infra_operator/commands/base.rb +++ b/lib/infra_operator/commands/base.rb @@ -1,6 +1,8 @@ module InfraOperator module Commands class Base + class BackendIncompatibleError < StandardError; end + def initialize(options = {}, &block) @options = options @block = block @@ -22,6 +24,10 @@ end def execute(backend) + unless self.compatible?(backend) + raise BackendIncompatibleError + end + command_result = execute!(backend) if @processor @processor.call(command_result)
Raise error when given backend is incompatible
diff --git a/lib/mongomodel/support/reference.rb b/lib/mongomodel/support/reference.rb index abc1234..def5678 100644 --- a/lib/mongomodel/support/reference.rb +++ b/lib/mongomodel/support/reference.rb @@ -12,6 +12,10 @@ def hash id.hash + end + + def as_json(*) + to_s end def blank?
Fix JSON serialization of Reference type
diff --git a/lib/rubocop/cop/metrics/abc_size.rb b/lib/rubocop/cop/metrics/abc_size.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/metrics/abc_size.rb +++ b/lib/rubocop/cop/metrics/abc_size.rb @@ -10,16 +10,27 @@ include MethodComplexity MSG = 'Assignment Branch Condition size for %s is too high. [%.4g/%.4g]' - BRANCH_NODES = [:send] - CONDITION_NODES = CyclomaticComplexity::COUNTED_NODES + BRANCH_NODES = [:send].freeze + CONDITION_NODES = CyclomaticComplexity::COUNTED_NODES.freeze private def complexity(node) - a = node.each_node(ASGN_NODES).count - b = node.each_node(BRANCH_NODES).count - c = node.each_node(CONDITION_NODES).count - Math.sqrt(a**2 + b**2 + c**2).round(2) + assignment = 0 + branch = 0 + condition = 0 + + node.each_node do |child| + if ASGN_NODES.include?(child.type) + assignment += 1 + elsif BRANCH_NODES.include?(child.type) + branch += 1 + elsif CONDITION_NODES.include?(child.type) + condition += 1 + end + end + + Math.sqrt(assignment**2 + branch**2 + condition**2).round(2) end end end
Change AbcSize to only iterate through child nodes once
diff --git a/spec/feature/accept_invitation_spec.rb b/spec/feature/accept_invitation_spec.rb index abc1234..def5678 100644 --- a/spec/feature/accept_invitation_spec.rb +++ b/spec/feature/accept_invitation_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.feature 'Visiting the invitation page', type: :feature do +RSpec.feature 'Visiting the invitation page', js: true do given(:invitation) { create(:invitation) } background do
Use poltergeist for all Capybara tests
diff --git a/stitches.gemspec b/stitches.gemspec index abc1234..def5678 100644 --- a/stitches.gemspec +++ b/stitches.gemspec @@ -14,11 +14,11 @@ 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.executables = `git ls-files -- exe/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency("rails") - s.add_dependency("pg") + s.add_runtime_dependency("rails") + s.add_runtime_dependency("pg") s.add_development_dependency("rake") - s.add_dependency("rspec-rails", "~> 3") - s.add_dependency("apitome") + s.add_runtime_dependency("rspec-rails", "~> 3") + s.add_runtime_dependency("apitome") end
Update gemspec with current conventions
diff --git a/app/controllers/spree/global_collect_checkouts_controller.rb b/app/controllers/spree/global_collect_checkouts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spree/global_collect_checkouts_controller.rb +++ b/app/controllers/spree/global_collect_checkouts_controller.rb @@ -10,7 +10,7 @@ return render(nothing: true) unless status_successful? return render_ok if @payment.completed? - if @payment.complete! + if @payment.present? && @payment.can_complete? && @payment.complete! render_ok else render_nok
Check if payments can be completed before completion
diff --git a/DMNetworkHelper.podspec b/DMNetworkHelper.podspec index abc1234..def5678 100644 --- a/DMNetworkHelper.podspec +++ b/DMNetworkHelper.podspec @@ -10,7 +10,7 @@ s.source = { :git => "https://github.com/DimaAvvakumov/DMNetworkHelper.git" } s.source_files = "classes/*.{h,m}" - s.public_header_files = "classes/*.{h,m}" + s.public_header_files = "classes/*.{h}" s.framework = "UIKit" s.requires_arc = true
Fix typo in s.public_header_files podspec
diff --git a/guard-spork.gemspec b/guard-spork.gemspec index abc1234..def5678 100644 --- a/guard-spork.gemspec +++ b/guard-spork.gemspec @@ -16,7 +16,7 @@ s.required_rubygems_version = '>= 1.3.6' s.rubyforge_project = 'guard-spork' - s.add_dependency 'guard', '>= 0.2.2' + s.add_dependency 'guard', '>= 0.8.2' s.add_dependency 'spork', '>= 0.8.4' s.add_development_dependency 'bundler', '~> 1.0'
Update guard dependency to 0.8.2
diff --git a/app/controllers/admin/authors_controller.rb b/app/controllers/admin/authors_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/authors_controller.rb +++ b/app/controllers/admin/authors_controller.rb @@ -1,4 +1,6 @@ class Admin::AuthorsController < Admin::BaseController + layout "bootstrap_admin" + def show @user = User.find(params[:id]) end
Move authors to bootstrap admin
diff --git a/app/controllers/admin/metrics_controller.rb b/app/controllers/admin/metrics_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/metrics_controller.rb +++ b/app/controllers/admin/metrics_controller.rb @@ -6,8 +6,14 @@ def schedule worker = MetricWorker.worker_class(@metric) + job = Job.where(repository: @repository.id, metric: @metric) id = worker.send(:perform_async, @repository.id, @metric) - Job.create!(sidekiq_id: id, repository: @repository.id, metric: @metric) + + if job.exists? + job.update_attributes(sidekiq_id: id) + else + Job.create!(sidekiq_id: id, repository: @repository.id, metric: @metric) + end render nothing: true end
Update job document if it already exists Apparently, I have not understood yet how the MongoDB, respectively Mongoid update mechanism works. If I use .create! on attributes, which theoretically map to the same object, it is not updated to the new value. What works for now is to try to fetch the job document and use .update_attributes if it already exists and .create! otherwise. Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
diff --git a/app/controllers/georgia/pages_controller.rb b/app/controllers/georgia/pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/georgia/pages_controller.rb +++ b/app/controllers/georgia/pages_controller.rb @@ -1,7 +1,5 @@ module Georgia class PagesController < Georgia::ApplicationController - - load_and_authorize_resource class: Georgia::Page include Georgia::Concerns::Pageable include Georgia::Concerns::Searchable
Fix cancan on abstract inheritance
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -16,6 +16,6 @@ end def after_update_path_for(resource) - session[:previous_url] || courses_path + courses_path end end
Modify after_update_path in registrations controller
diff --git a/app/controllers/release_notes_controller.rb b/app/controllers/release_notes_controller.rb index abc1234..def5678 100644 --- a/app/controllers/release_notes_controller.rb +++ b/app/controllers/release_notes_controller.rb @@ -9,7 +9,7 @@ release_notes = ReleaseNotes.new(start_note) @notes = content_to_array(release_notes.notes) - if current_user && @notes.empty? + if current_user && !@notes.empty? current_user.last_release_note_viewed = release_notes.notes.first[:id] current_user.save end
Fix for release notes alert not clearing.
diff --git a/app/models/spree/look_book_image_product.rb b/app/models/spree/look_book_image_product.rb index abc1234..def5678 100644 --- a/app/models/spree/look_book_image_product.rb +++ b/app/models/spree/look_book_image_product.rb @@ -23,6 +23,9 @@ module Spree class LookBookImageProduct < ActiveRecord::Base + + default_scope { order("#{self.table_name}.position") } + def self.table_name 'look_book_image_products' end
Add default scope to look book image product
diff --git a/test/lib/test_query_result_collection.rb b/test/lib/test_query_result_collection.rb index abc1234..def5678 100644 --- a/test/lib/test_query_result_collection.rb +++ b/test/lib/test_query_result_collection.rb @@ -0,0 +1,29 @@+require 'test_helper' + +class TestQueryResultCollection < Test::Unit::TestCase + + def setup + options = { + :username => 'myusername', + :password => 'mypassword', + :token => "somelongtoken" + } + + @client = SalesforceBulk::Client.new(options) + @jobId = "123" + @batchId = "234" + @resultIds = ["12","23","34"] + end + + test "initilize" do + collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId) + assert_equal collection.client, @client + assert_equal collection.jobId, @jobId + assert_equal collection.batchId, @batchId + assert_equal collection.currentIndex, 0 + + collection = SalesforceBulk::QueryResultCollection.new(@client, @jobId, @batchId, 5) + assert_equal collection.currentIndex, 5 + end + +end
Add query result collection test file and test that initialize method sets instance variables as expected.
diff --git a/config/app.rb b/config/app.rb index abc1234..def5678 100644 --- a/config/app.rb +++ b/config/app.rb @@ -14,6 +14,11 @@ DB = Sequel.connect(ENV.fetch('DATABASE_URL', 'postgres://localhost/wikimum')) +# https://github.com/Starkast/wikimum/issues/412 +# https://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/connection_validator_rb.html +DB.extension(:connection_validator) +DB.pool.connection_validation_timeout = 60 * 5 + if App.development? require 'logger' DB.logger = Logger.new($stdout)
Validate database connections every 5th minute Hopefully addresses the issues with using Fly.io hosted Postgres. Close #412 Fixes WIKI-15 Fixes WIKI-17
diff --git a/lib/chinese_t2s/middleware.rb b/lib/chinese_t2s/middleware.rb index abc1234..def5678 100644 --- a/lib/chinese_t2s/middleware.rb +++ b/lib/chinese_t2s/middleware.rb @@ -12,7 +12,7 @@ if status == 200 && bodies.present? params = env['rack.request.query_hash'] || {} - if (env['rack.session']['chinese_t2s_lang'] || params['lang']) == 'cn' + if params['lang'] == 'cn' case bodies when ActionDispatch::Response # Rails body = ChineseT2s::translate(bodies.body)
Remove session[:chinese_t2s_lang] and there is no auto-translating now
diff --git a/lib/tasks/publishing_api.rake b/lib/tasks/publishing_api.rake index abc1234..def5678 100644 --- a/lib/tasks/publishing_api.rake +++ b/lib/tasks/publishing_api.rake @@ -0,0 +1,9 @@+namespace :publishing_api do + desc "Send pages to the content-api" + task :register => :environment do + %w[bank-holidays when-do-the-clocks-change].each do |calender_name| + calendar = Calendar.find(calender_name) + CalendarPublisher.new(calendar).publish + end + end +end
Add rake task to republish all calendars This uses functionality implemented earlier. Run with `rake publishing_api:register`.
diff --git a/lib/thor-install-gist/hook.rb b/lib/thor-install-gist/hook.rb index abc1234..def5678 100644 --- a/lib/thor-install-gist/hook.rb +++ b/lib/thor-install-gist/hook.rb @@ -9,5 +9,15 @@ Gem.pre_uninstall do |uninstalled| $stderr.puts "[I] uninstalling thor tasks for thor-install-gist" - Thor::Runner.new.uninstall('install-gist') + begin + Thor::Runner.new.uninstall('install-gist') + rescue Thor::Error => e + if e.message =~ /Can't find module/ + $stderr.puts "[W] uninstalling thor tasks failed! you just have uninstalled by yourself?" + $stderr.puts "[W] skip uninstall" + true + else + raise e + end + end end
Handle errors on gem uninstall
diff --git a/lib/ws_light/set/color_set.rb b/lib/ws_light/set/color_set.rb index abc1234..def5678 100644 --- a/lib/ws_light/set/color_set.rb +++ b/lib/ws_light/set/color_set.rb @@ -11,8 +11,8 @@ def initialize(length = DEFAULT_LENGTH, type = DEFAULT_TYPE) @length = length + @type = type @full_length = (@type == :double ? @length * 2 : @length) - @type = type @color = Color.random @frame_count = 0 init
[BUGFIX] Set type first then get full length
diff --git a/spec/lib/redis_cacheable_spec.rb b/spec/lib/redis_cacheable_spec.rb index abc1234..def5678 100644 --- a/spec/lib/redis_cacheable_spec.rb +++ b/spec/lib/redis_cacheable_spec.rb @@ -21,6 +21,10 @@ } end +class ProcKeyObject < CacheableObject + redis_key ->(object) { "object_#{object.id}" } +end + describe RedisCacheable do describe "Object including RedisCacheable" do describe "#cache_to_redis" do @@ -41,6 +45,15 @@ expect(ProcCacheableObject.find_from_redis(1)).to eq(10) end end + + context "if redis_key is proc" do + subject { ProcKeyObject.new(id: 1, name: "target").cache_to_redis } + + it "use proc result as redis key" do + subject + expect(ProcKeyObject.find_from_redis("object_1")).to eq({"id" => 1, "name" => "target"}) + end + end end end end
Add test case: redis_key is proc
diff --git a/spec/unit/recipes/global_spec.rb b/spec/unit/recipes/global_spec.rb index abc1234..def5678 100644 --- a/spec/unit/recipes/global_spec.rb +++ b/spec/unit/recipes/global_spec.rb @@ -13,4 +13,24 @@ expect(template.source).to eq("logrotate-global.erb") expect(template.mode).to eq("0644") end + + shared_examples "script in global context" do + it "puts the script in the configuration file" do + expect(chef_run).to render_file("/etc/logrotate.conf").with_content(content_regexp) + end + end + + %w{postrotate prerotate firstaction lastaction}.each do |script_type| + context "when a #{script_type} script is present in the global attribute" do + let(:script) { "/usr/bin/test_#{script_type}_script" } + let(:chef_run) do + ChefSpec::SoloRunner.new do |node| + node.override["logrotate"]["global"][script_type] = script + end.converge(described_recipe) + end + let(:content_regexp) { /#{script_type}\n#{script}\nendscript/ } + + it_behaves_like "script in global context" + end + end end
Add unit test for the global scripts feature
diff --git a/test/models/item_test.rb b/test/models/item_test.rb index abc1234..def5678 100644 --- a/test/models/item_test.rb +++ b/test/models/item_test.rb @@ -4,4 +4,8 @@ # test "the truth" do # assert true # end + test "should not save item without name, description, quantity, or price" do + item = Item.new + assert_not item.save, "Saved the article without one of the required fields" + end end
Write test checking validations for creating a new item work
diff --git a/test/models/user_test.rb b/test/models/user_test.rb index abc1234..def5678 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -13,4 +13,9 @@ @user.name = ' ' assert_not @user.valid? end + + test 'email should be present' do + @user.email = ' ' + assert_not @user.valid? + end end
Add test case for user's email presence
diff --git a/app/models/manageiq/providers/openstack/cloud_manager/vnf/status.rb b/app/models/manageiq/providers/openstack/cloud_manager/vnf/status.rb index abc1234..def5678 100644 --- a/app/models/manageiq/providers/openstack/cloud_manager/vnf/status.rb +++ b/app/models/manageiq/providers/openstack/cloud_manager/vnf/status.rb @@ -4,7 +4,7 @@ end def failed? - status.downcase =~ /failed$/ + status.downcase =~ /failed$/ || status.downcase == "error" end def rolled_back?
Handle VNF error state correctly Handle VNF error state correctly
diff --git a/lib/by_navigation/configuration.rb b/lib/by_navigation/configuration.rb index abc1234..def5678 100644 --- a/lib/by_navigation/configuration.rb +++ b/lib/by_navigation/configuration.rb @@ -18,6 +18,7 @@ end def self.get_item(id_or_url = :main) + id_or_url = "/#{id_or_url}" if id_or_url.is_a?(String) && !id_or_url.start_with?('/') id_or_url.is_a?(Symbol) ? get_item_by_id(id_or_url) : get_item_by_url(id_or_url) end
get_item: Add slash at the start of url if not present
diff --git a/spec/adapters/active_record_spec.rb b/spec/adapters/active_record_spec.rb index abc1234..def5678 100644 --- a/spec/adapters/active_record_spec.rb +++ b/spec/adapters/active_record_spec.rb @@ -31,4 +31,9 @@ $passed_args.first[:param].should == 2 $passed_args.first.should be_an_instance_of ActiveSupport::HashWithIndifferentAccess end + + it "should support Rails' special extensions for times" do + Que::Job.queue :run_at => 1.minute.from_now + DB[:que_jobs].get(:run_at).should be_within(3).of Time.now + 60 + end end
Add a spec to make sure we support Rails' 1.day.from_now syntax.
diff --git a/spec/models/axiom_selection_spec.rb b/spec/models/axiom_selection_spec.rb index abc1234..def5678 100644 --- a/spec/models/axiom_selection_spec.rb +++ b/spec/models/axiom_selection_spec.rb @@ -2,7 +2,7 @@ describe AxiomSelection do context 'associations' do - it { should have_one(:proof_attempt_configuration) } - it { should have_and_belong_to_many(:axioms) } + it { expect(subject).to have_one(:proof_attempt_configuration) } + it { expect(subject).to have_and_belong_to_many(:axioms) } end end
Use expect syntax for specs.
diff --git a/TilllessBCScanner.podspec b/TilllessBCScanner.podspec index abc1234..def5678 100644 --- a/TilllessBCScanner.podspec +++ b/TilllessBCScanner.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TilllessBCScanner" - s.version = "0.0.1" + s.version = "0.0.2" s.summary = "TBarcodeScannerViewController suitable for working with RubyMotion." s.description = <<-DESC Concrete implementation of AVCaptureMetadataOutputObjectsDelegate in
Update to remedy after upgrade to 0.36.1 of cocoapods
diff --git a/rails-erd.gemspec b/rails-erd.gemspec index abc1234..def5678 100644 --- a/rails-erd.gemspec +++ b/rails-erd.gemspec @@ -13,8 +13,6 @@ s.description = %q{Automatically generate an entity-relationship diagram (ERD) for your Rails models.} s.license = "MIT" - s.rubyforge_project = "rails-erd" - s.add_runtime_dependency "activerecord", [">= 3.2"] s.add_runtime_dependency "activesupport", [">= 3.2"] s.add_runtime_dependency "ruby-graphviz", ["~> 1.0.4"]
Remove rubyforge_project name from gemspec :skull: RubyForge
diff --git a/mongoid_magic_counter_cache.gemspec b/mongoid_magic_counter_cache.gemspec index abc1234..def5678 100644 --- a/mongoid_magic_counter_cache.gemspec +++ b/mongoid_magic_counter_cache.gemspec @@ -19,7 +19,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency("mongoid", "~> 3.0.0") + s.add_dependency("mongoid") s.add_dependency("rake") s.add_development_dependency "rspec" end
Remove mongoid version because we want to support both Mongoid 2.x and 3.x.
diff --git a/git-authors.gemspec b/git-authors.gemspec index abc1234..def5678 100644 --- a/git-authors.gemspec +++ b/git-authors.gemspec @@ -16,4 +16,6 @@ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] + + gem.add_development_dependency('rspec') end
Add rspec as development dependency
diff --git a/app/controllers/api/v1/dependencies_controller.rb b/app/controllers/api/v1/dependencies_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/dependencies_controller.rb +++ b/app/controllers/api/v1/dependencies_controller.rb @@ -1,6 +1,6 @@ class Api::V1::DependenciesController < Api::BaseController def index - gem_list = (params[:gems] || '').split(',') + gem_list = params[:gems].split(',') if gem_list.size <= Dependency::LIMIT render :text => Marshal.dump(Dependency.for(gem_list))
Revert "Don't throw error if gems param is omitted" until some tests are in place for this This reverts commit 3d367904b3e9fe341c37b349630c27c581f127fb.
diff --git a/app/controllers/users/contributions_controller.rb b/app/controllers/users/contributions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users/contributions_controller.rb +++ b/app/controllers/users/contributions_controller.rb @@ -1,15 +1,17 @@ class Users::ContributionsController < ApplicationController + after_filter :verify_authorized, except: [:index] + after_filter :verify_policy_scoped, only: [:index] inherit_resources defaults resource_class: Contribution belongs_to :user actions :index def request_refund + authorize resource authorize! :request_refund, resource - if resource.value > resource.user.user_total.credits + if resource.value > resource.user.user_total.credits || !resource.request_refund flash.alert = I18n.t('controllers.users.contributions.request_refund.insufficient_credits') - elsif can?(:request_refund, resource) && resource.can_request_refund? - resource.request_refund! + else flash.notice = I18n.t('controllers.users.contributions.request_refund.refunded') end @@ -17,9 +19,15 @@ end protected + def policy_scope(scope) + @_policy_scoped = true + ContributionPolicy::UserScope.new(current_user, parent, scope).resolve + end + def collection - @contributions ||= end_of_association_chain.available_to_display.order("created_at DESC, confirmed_at DESC") - @contributions = @contributions.not_anonymous.with_state('confirmed') unless can? :manage, @user - @contributions = @contributions.includes(:user, :reward, project: [:user, :category, :project_total]) + @contributions ||= policy_scope(end_of_association_chain). + order("created_at DESC, confirmed_at DESC"). + includes(:user, :reward, project: [:user, :category, :project_total]). + page(params[:page]).per(10) end end
Migrate user contributions controller to pundit
diff --git a/schnitzelstyle.gemspec b/schnitzelstyle.gemspec index abc1234..def5678 100644 --- a/schnitzelstyle.gemspec +++ b/schnitzelstyle.gemspec @@ -9,7 +9,7 @@ gem.homepage = "http://schnitzelpress.org/schnitzelstyle/" gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } - gem.files = `git ls-files`.split("\n") + gem.files = `git ls-files lib LICENSE README.md`.split("\n") gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") gem.name = "schnitzelstyle" gem.require_paths = ["lib"]
Update gemspec to thin down .gem contents.
diff --git a/config/initializers/exception_notification.rb b/config/initializers/exception_notification.rb index abc1234..def5678 100644 --- a/config/initializers/exception_notification.rb +++ b/config/initializers/exception_notification.rb @@ -2,5 +2,5 @@ Rails.application.config.middleware.use ExceptionNotifier, :email_prefix => "[#{Rails.application.to_s.split('::').first}] ", :sender_address => %{"Winston Smith-Churchill" <winston@alphagov.co.uk>}, - :exception_recipients => %w{govuk-publishing-platform-notifications@digital.cabinet-office.gov.uk} + :exception_recipients => %w{govuk-dev@digital.cabinet-office.gov.uk} end
Revert "Use notification email address" Wrong email address. This reverts commit 9123f1d42c5b17b94df88a53c2f10f10934139af.
diff --git a/sanitize-rails.gemspec b/sanitize-rails.gemspec index abc1234..def5678 100644 --- a/sanitize-rails.gemspec +++ b/sanitize-rails.gemspec @@ -18,5 +18,5 @@ s.files = `git ls-files`.split("\n") s.add_dependency "rails", ">= 3.0" - s.add_dependency "sanitize", "~> 3.0" + s.add_dependency "sanitize", ">= 3.0" end
Allow sanitize 3.0 and up
diff --git a/core/lib/spree/testing_support/common_rake.rb b/core/lib/spree/testing_support/common_rake.rb index abc1234..def5678 100644 --- a/core/lib/spree/testing_support/common_rake.rb +++ b/core/lib/spree/testing_support/common_rake.rb @@ -14,7 +14,7 @@ ENV["RAILS_ENV"] = 'test' Spree::DummyGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", "--quiet"] - Solidus::InstallGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", "--auto-accept", "with-authentication=false", "--migrate=false", "--seed=false", "--sample=false", "--quiet", "--user_class=#{args[:user_class]}"] + Solidus::InstallGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", "--auto-accept", "--with-authentication=false", "--migrate=false", "--seed=false", "--sample=false", "--quiet", "--user_class=#{args[:user_class]}"] puts "Setting up dummy database..."
Fix install generator auth option in common rake tasks This issue was preventing solidus from being installed in all extensions, making specs fail against master.
diff --git a/core/spec/models/spree/product_filter_spec.rb b/core/spec/models/spree/product_filter_spec.rb index abc1234..def5678 100644 --- a/core/spec/models/spree/product_filter_spec.rb +++ b/core/spec/models/spree/product_filter_spec.rb @@ -11,7 +11,7 @@ end it "does not attempt to call value method on Arel::Table" do - lambda { Spree::ProductFilters.brand_filter }.should_not raise_error(NoMethodError) + lambda { Spree::Core::ProductFilters.brand_filter }.should_not raise_error end it "can find products in the 'Nike' brand" do @@ -20,7 +20,7 @@ it "sorts products without brand specified" do product.set_property("brand", "Nike") create(:product).set_property("brand", nil) - lambda { Spree::Core::ProductFilters.brand_filter[:labels] }.should_not raise_error(ArgumentError) + lambda { Spree::Core::ProductFilters.brand_filter[:labels] }.should_not raise_error end end end
[core] Clean up RSpec deprecation warnings wrt 'should_not raise_error(SpecificError)'
diff --git a/Casks/notedup.rb b/Casks/notedup.rb index abc1234..def5678 100644 --- a/Casks/notedup.rb +++ b/Casks/notedup.rb @@ -4,7 +4,7 @@ url 'https://app.yinxiang.com/shard/s10/sh/a2d0903c-f751-48fd-a5c0-68d7bcd0c450/ce188822309c0124ba328248e1bed420/res/03724cac-da8f-4981-ac1d-946bb46fa19c/NoteDup_Mac_2014031401.zip' name 'NoteDup' - homepage 'http://appcenter.yinxiang.com/app/notedup/mac/' + homepage 'https://appcenter.yinxiang.com/app/notedup/mac/' license :closed app 'NoteDup.app'
Fix homepage to use SSL in NoteDup Cask The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly makes it more secure and saves a HTTP round-trip.