diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/dimples/post.rb b/lib/dimples/post.rb index abc1234..def5678 100644 --- a/lib/dimples/post.rb +++ b/lib/dimples/post.rb @@ -24,7 +24,7 @@ @slug = parts[4] @layout = @site.config[:layouts][:post] - self.date = Time.mktime(parts[1], parts[2], parts[3]) + self.date = DateTime.new(parts[1].to_i, parts[2].to_i, parts[3].to_i) @output_directory = File.join( @date.strftime(@site.output_paths[:posts]),
Switch to DateTime instead of Time
diff --git a/lib/ansible/transmit.rb b/lib/ansible/transmit.rb index abc1234..def5678 100644 --- a/lib/ansible/transmit.rb +++ b/lib/ansible/transmit.rb @@ -2,6 +2,8 @@ module Transmit def self.extended(base) base.class_eval do + include ActionController::Live + def self._beacons @_beacons ||= [] end
Add in ActionController::Live in class_eval
diff --git a/lib/axiom/types/hash.rb b/lib/axiom/types/hash.rb index abc1234..def5678 100644 --- a/lib/axiom/types/hash.rb +++ b/lib/axiom/types/hash.rb @@ -9,16 +9,23 @@ coercion_method :to_hash accept_options :key_type, :value_type - key_type ::Object - value_type ::Object + key_type Object + value_type Object # TODO: create a factory method that returns a subtype with more - # constrainted key/value types. + # constrainted key/value types. This should be used with the lookup + # system so that the best matching type can be used. It could also check + # the descendants to see if a previously created type matches the key and + # value types, in which case it can be reused. def self.finalize return self if finalized? - # TODO: lookup the types that handle the key/value primitives and then - # setup a constraint for the keys and values. + constraint do |hash| + # TODO: change to #to_h when added to backports + hash.respond_to?(:to_hash) && hash.to_hash.all? do |key, value| + key_type.include?(key) && value_type.include?(value) + end + end super end
Add constraints for Hash type
diff --git a/lib/flickr/error.rb b/lib/flickr/error.rb index abc1234..def5678 100644 --- a/lib/flickr/error.rb +++ b/lib/flickr/error.rb @@ -38,7 +38,7 @@ ## # @private # - def initialize(message, code = nil) + def initialize(message = nil, code = nil) super(message) @code = code.to_i end
Make the ApiError message optional Fixes #9
diff --git a/lib/contentful_rails.rb b/lib/contentful_rails.rb index abc1234..def5678 100644 --- a/lib/contentful_rails.rb +++ b/lib/contentful_rails.rb @@ -1,6 +1,5 @@ require "contentful_rails/engine" require "contentful_rails/development_constraint" -require 'contentful_rails/caching/objects' require 'contentful_rails/caching/timestamps' require "contentful_rails/markdown_renderer" require "contentful_rails/nested_resource"
Remove reference to object cachign
diff --git a/lib/gemrat/arguments.rb b/lib/gemrat/arguments.rb index abc1234..def5678 100644 --- a/lib/gemrat/arguments.rb +++ b/lib/gemrat/arguments.rb @@ -2,13 +2,12 @@ class Arguments class UnableToParse < StandardError; end - ATTRIBUTES = [:gems, :gemfile, :replace_gem] + ATTRIBUTES = [:gems, :gemfile] ATTRIBUTES.each { |arg| attr_accessor arg } def initialize(*args) - self.replace_gem = true self.arguments = *args validate
Remove all instances of :replace_gem, they're no longer needed
diff --git a/lib/knuckles/fetcher.rb b/lib/knuckles/fetcher.rb index abc1234..def5678 100644 --- a/lib/knuckles/fetcher.rb +++ b/lib/knuckles/fetcher.rb @@ -6,17 +6,24 @@ "fetcher".freeze end - def call(objects, options) - view = options.fetch(:view) + def call(prepared, options) + results = get_cached(prepared, options.fetch(:view)) - objects.each do |hash| - key = view.cache_key(hash[:object]) - res = Knuckles.cache.read(key) + prepared.each do |hash| + result = results[hash[:key]] + hash[:cached?] = !result.nil? + hash[:result] = result + end + end - hash[:key] = key - hash[:cached?] = !res.nil? - hash[:result] = res + private + + def get_cached(prepared, view) + keys = prepared.map do |hash| + hash[:key] = view.cache_key(hash[:object]) end + + Knuckles.cache.read_multi(*keys) end end end
Use read_multi for the fetching stage
diff --git a/lib/looksee/core_ext.rb b/lib/looksee/core_ext.rb index abc1234..def5678 100644 --- a/lib/looksee/core_ext.rb +++ b/lib/looksee/core_ext.rb @@ -1,21 +1,21 @@ module Looksee module ObjectMixin # - # Shortcut for Looksee[self, *args]. + # Define #ls as a shortcut for Looksee[self, *args]. + # + # This is defined via method_missing to be less intrusive. pry 0.10, e.g., + # relies on Object#ls not existing. # def method_missing(name, *args) - case name.to_s - when /^ls$/ - # when in repl, p is no need. - # but when no repl, p is need for output looksee result. - if defined? Pry or defined? Irb - Looksee[self, *args] - else - p Looksee[self, *args] - end + if name == :ls + Looksee[self, *args] else super end + end + + def respond_to?(name, include_private=false) + super || name == :ls end def self.rename(name) # :nodoc:
Clean up ObjectMixin, update docs, don't print, define respond_to?.
diff --git a/lib/pew_pew/resource.rb b/lib/pew_pew/resource.rb index abc1234..def5678 100644 --- a/lib/pew_pew/resource.rb +++ b/lib/pew_pew/resource.rb @@ -20,6 +20,16 @@ end private :post + def put(*) + super.body + end + private :put + + def delete(*) + super.body + end + private :delete + def connection super do |builder| builder.basic_auth(Config::USERNAME, config.api_key)
Return response body for PUT and DELETE requests.
diff --git a/lib/serf/command.rb b/lib/serf/command.rb index abc1234..def5678 100644 --- a/lib/serf/command.rb +++ b/lib/serf/command.rb @@ -20,6 +20,7 @@ include Serf::Util::WithOptionsExtraction attr_reader :request + attr_reader :args def initialize(request, *args) extract_options! args
Add attr_reader for args in Command. Details: * We have the reader for the set request, but we also want it for the remaining args.
diff --git a/lib/tasks/pull.rake b/lib/tasks/pull.rake index abc1234..def5678 100644 --- a/lib/tasks/pull.rake +++ b/lib/tasks/pull.rake @@ -21,25 +21,22 @@ # TODO: Limit batch size after Feed#stale? is fixed # .limit(Defaults::MAX_FEEDS_PER_BATCH) - feeds_count = feeds.count - if feeds_count.zero? - Rails.logger.info('---> no stale feeds found, nothing to update') - else - feed_names = feeds.pluck(:name).join(', ') - Rails.logger.info("---> updating #{feeds.count} feed(s): #{feed_names}") - CreateDataPoint.call(:batch, feeds: feeds.pluck(:name)) + feed_names = feeds.pluck(:name).join(', ') + Rails.logger.info("---> updating #{feeds.count} feed(s): #{feed_names}") + data_point = CreateDataPoint.call(:batch, feeds: feeds.pluck(:name)) - feeds.each do |feed| - ProcessFeed.call(feed) if feed.active? - rescue StandardError => e - ErrorDumper.call( - exception: e, - message: 'Error processing feed', - target: feed - ) - next - end + feeds.each do |feed| + ProcessFeed.call(feed) + rescue StandardError => e + ErrorDumper.call( + exception: e, + message: 'Error processing feed', + target: feed, + context: { batch_data_point: data_point.id } + ) + + next end end end
Remove redundant checks; add data point reference to processing errors
diff --git a/librato-metrics.gemspec b/librato-metrics.gemspec index abc1234..def5678 100644 --- a/librato-metrics.gemspec +++ b/librato-metrics.gemspec @@ -16,7 +16,7 @@ s.authors = ["Matt Sanders"] s.email = 'matt@librato.com' - s.homepage = 'http://metrics.librato.com' + s.homepage = 'https://github.com/librato/librato-metrics' s.require_paths = %w[lib]
Switch gem website to github repo.
diff --git a/scripts/remove-gems.rb b/scripts/remove-gems.rb index abc1234..def5678 100644 --- a/scripts/remove-gems.rb +++ b/scripts/remove-gems.rb @@ -0,0 +1,7 @@+#!/usr/bin/env ruby +`gem list --no-versions`.split("\n").each do |gem| + `gem list -d #{gem}`.gsub(/Installed at(.*):.*/).each do |dir| + dir = dir.gsub(/Installed at(.*): /,'').gsub("\n", '') + system "gem uninstall #{gem} -aIx -i #{dir}" + end +end
Add a script to remove all ruby gems.
diff --git a/spec/views/events/edit.html.erb_spec.rb b/spec/views/events/edit.html.erb_spec.rb index abc1234..def5678 100644 --- a/spec/views/events/edit.html.erb_spec.rb +++ b/spec/views/events/edit.html.erb_spec.rb @@ -13,6 +13,8 @@ assert_select "input#event_description[name=?]", "event[description]" assert_select "input#event_max_participants[name=?]", "event[max_participants]" assert_select "input#event_active[name=?]", "event[active]" + assert_select "input#event_organizer[name=?]", "event[organizer]" + assert_select "input#event_knowledge_level[name=?]", "event[knowledge_level]" end end end
Add additional edit view test not required in specification
diff --git a/Casks/tg-pro.rb b/Casks/tg-pro.rb index abc1234..def5678 100644 --- a/Casks/tg-pro.rb +++ b/Casks/tg-pro.rb @@ -1,11 +1,11 @@ cask :v1 => 'tg-pro' do - version '2.8.5' - sha256 'ddffad55f0c8998323d270649f22f3e7a63ed45f867ba141a4b6df2b76bca6fc' + version '2.8.7' + sha256 '32b622cec40f4cfe0cd5455dd110696b8284524aadd92c552a769c130bbc88e7' url "http://www.tunabellysoftware.com/resources/TGPro_#{version.gsub('.','_')}.zip" name 'TG Pro' appcast 'http://tunabellysoftware.com/resources/sparkle/tgpro/profileInfo.php', - :sha256 => '6377de7a9e67766d24c12c4580337b509d9572552e3def8a8f33af09272942e2' + :sha256 => 'e276cc14d86471bc7c416faefc7e8bcffe94da4458c87c71c2f14287414df5fa' homepage 'http://www.tunabellysoftware.com/tgpro/' license :commercial
Update TG Pro to 2.8.7
diff --git a/Casks/tower1.rb b/Casks/tower1.rb index abc1234..def5678 100644 --- a/Casks/tower1.rb +++ b/Casks/tower1.rb @@ -5,8 +5,9 @@ url 'http://www.git-tower.com/download-v1' appcast 'https://macapps.fournova.com/tower1-1060/updates.xml', :sha256 => '0a053ca1cf31f5dd6512a4528a4d793a4993c2e180002c4967511a6dc9bfbf87' + name 'Tower' homepage 'http://www.git-tower.com/' - license :unknown + license :commercial app 'Tower.app' end
Tower1: Add name and update license stanza
diff --git a/etc/mitamae/cookbooks/rbenv/default.rb b/etc/mitamae/cookbooks/rbenv/default.rb index abc1234..def5678 100644 --- a/etc/mitamae/cookbooks/rbenv/default.rb +++ b/etc/mitamae/cookbooks/rbenv/default.rb @@ -16,6 +16,7 @@ end file "#{node[:home]}/.anyenv/envs/rbenv/default-gems" do + content "rails\n" content "bundler\n" content "forman\n" owner node[:user]
Install `rails` on executing `rbenv install`
diff --git a/resources/notify.rb b/resources/notify.rb index abc1234..def5678 100644 --- a/resources/notify.rb +++ b/resources/notify.rb @@ -1,6 +1,6 @@ provides :slack_notify -property :message, String, name_attribute: true +property :message, String, name_property: true property :channels, Array, default: [] property :username, String property :webhook_url, String
Resolve the new FC118 foodcritic warning Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/clock_indicator/calendar_window.rb b/lib/clock_indicator/calendar_window.rb index abc1234..def5678 100644 --- a/lib/clock_indicator/calendar_window.rb +++ b/lib/clock_indicator/calendar_window.rb @@ -11,7 +11,7 @@ CAL_WIDTH = 350 def cals_in_window - (Gdk::Screen.width / CAL_WIDTH) / 2 + [(Gdk::Screen.width / CAL_WIDTH) / 2, 3].min end def window
Put a maximum of 7 calendars
diff --git a/lib/opsicle/commands/ssh_clean_keys.rb b/lib/opsicle/commands/ssh_clean_keys.rb index abc1234..def5678 100644 --- a/lib/opsicle/commands/ssh_clean_keys.rb +++ b/lib/opsicle/commands/ssh_clean_keys.rb @@ -8,8 +8,7 @@ def execute(options={}) instances.each do |instance| - # As a side note, maybe always connecting to the instance ip - # (NOT the elastic ip) would bypass this issue + # Fun note: public_dns will be for the elastic ip (if elastic_ip?) host_keys = [:elastic_ip, :public_ip, :public_dns, :private_ip, :private_dns] hosts = host_keys.map{ |key| instance[key] }
Update comment (WITH NEW KNOWLEDGE)
diff --git a/test/integration/users_login_test.rb b/test/integration/users_login_test.rb index abc1234..def5678 100644 --- a/test/integration/users_login_test.rb +++ b/test/integration/users_login_test.rb @@ -10,7 +10,7 @@ test "login with invalid information" do get @login_path assert_template 'login_page/index' - post session_path, { email: "", password: "" } + post session_path, params: { email: "", password: "" } assert_redirected_to @login_path assert_not flash.empty? get @login_path @@ -19,8 +19,8 @@ test "login with valid information" do get @login_path - post session_path, { email: ENV['SCRIVITO_EMAIL'], - password: ENV["SCRIVITO_PASSWORD"] } + post session_path, params: { email: ENV['SCRIVITO_EMAIL'], + password: ENV["SCRIVITO_PASSWORD"] } assert_redirected_to scrivito_path(Obj.root) assert_equal session[:user] , ENV['SCRIVITO_EMAIL'] follow_redirect! @@ -31,8 +31,8 @@ test_url = "/kata" get test_url get @login_path - post session_path, { email: ENV['SCRIVITO_EMAIL'], - password: ENV["SCRIVITO_PASSWORD"] } + post session_path, params: { email: ENV['SCRIVITO_EMAIL'], + password: ENV["SCRIVITO_PASSWORD"] } assert_redirected_to test_url follow_redirect! # assert_template "blog_post_page/index.html"
Fix DEPRECATION: Use new keyword style for POST in Integration Test
diff --git a/Formula/exult.rb b/Formula/exult.rb index abc1234..def5678 100644 --- a/Formula/exult.rb +++ b/Formula/exult.rb @@ -1,4 +1,6 @@ require 'formula' + +# TODO we shouldn't be installing .apps if there is an option class Exult <Formula # Use a specific revision that is known to compile (on Snow Leopard too.) @@ -20,13 +22,13 @@ system "make" system "make bundle" - libexec.install "Exult.app" + prefix.install "Exult.app" end - def caveats - "Cocoa app installed to #{libexec}\n\n"\ - "Note that this includes only the game engine; you will need to supply\n"\ - "your own legal copy of the Ultima 7 game files.\n\n"\ - "Try here:\n\thttp://www.amazon.com/gp/product/B0002SKOEC?ie=UTF8&tag=adamvandesper-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B0002SKOEC" + def caveats; + "Cocoa app installed to #{prefix}\n\n"\ + "Note that this includes only the game engine; you will need to supply your own\n"\ + "own legal copy of the Ultima 7 game files. Try here:\n\n"\ + "http://www.amazon.com/gp/product/B0002SKOEC?ie=UTF8&tag=adamvandesper-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B0002SKOEC" end end
Install single files to prefix It's a single .app file, our convention here is typically to just put it at the formula's prefix root.
diff --git a/lib/spree_shared/apartment_elevator.rb b/lib/spree_shared/apartment_elevator.rb index abc1234..def5678 100644 --- a/lib/spree_shared/apartment_elevator.rb +++ b/lib/spree_shared/apartment_elevator.rb @@ -34,17 +34,19 @@ #Spraycan::Engine.initialize_themes rescue Exception => e Rails.logger.error " Stopped request due to: #{e.message}" - Apartment::Database.reset - ahh_no and return + + #fallback + ENV['RAILS_CACHE_ID'] = "" + Apartment::Database.current_database = nil + ActiveRecord::Base.establish_connection + return ahh_no end #continue on to rails @app.call(env) - else ahh_no end - end def subdomain(request) @@ -52,7 +54,7 @@ end def ahh_no - [200, {"Content-type" => "text/html"}, "Ahh No."] + [200, {"Content-type" => "text/html"}, "Ahh No."] end end
Fix handling of missing db / subdomain
diff --git a/MOAspects.podspec b/MOAspects.podspec index abc1234..def5678 100644 --- a/MOAspects.podspec +++ b/MOAspects.podspec @@ -6,7 +6,7 @@ s.license = 'MIT' s.author = { "Hiromi Motodera" => "moai.motodera@gmail.com" } s.source = { :git => "https://github.com/MO-AI/MOAspects.git", :tag => "#{s.version}", :submodules => true } - s.source_files = 'MOAspects/*.{h,m,swift}' + s.source_files = 'MOAspects/*.{h,m}' s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.8" s.requires_arc = true
Update pod spec for source files
diff --git a/spec/guideline/checker_factory_spec.rb b/spec/guideline/checker_factory_spec.rb index abc1234..def5678 100644 --- a/spec/guideline/checker_factory_spec.rb +++ b/spec/guideline/checker_factory_spec.rb @@ -19,10 +19,10 @@ end it "creates instances of given classes with given config" do - LongLineChecker.should_receive(:new).with(:max => 80).and_call_original - LongMethodChecker.should_receive(:new).with(:max => 10).and_call_original checkers[0].should be_a LongLineChecker checkers[1].should be_a LongMethodChecker + checkers[0].send(:max).should == 80 + checkers[1].send(:max).should == 10 end end end
Refactor not to use should receive and check option value
diff --git a/app/controllers/spree/admin/review_settings_controller.rb b/app/controllers/spree/admin/review_settings_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spree/admin/review_settings_controller.rb +++ b/app/controllers/spree/admin/review_settings_controller.rb @@ -8,9 +8,9 @@ Spree::Reviews::Config.set(params[:preferences]) respond_to do |format| - format.html { + format.html do redirect_to admin_review_settings_path - } + end end end end
Use multi-lined do and end in ReviewSettingsController
diff --git a/sprout-osx-base/attributes/versions.rb b/sprout-osx-base/attributes/versions.rb index abc1234..def5678 100644 --- a/sprout-osx-base/attributes/versions.rb +++ b/sprout-osx-base/attributes/versions.rb @@ -1 +1 @@-node.default['versions']['bash_it'] = '8bf641baec4316cebf1bc1fd2757991f902506dc' +node.default['versions']['bash_it'] = '0986e40d6c4c64dc03cce6497294cef17ca57307'
Update bash-it sha to latest Includes * chruby(-auto) plugin rename [306f7b1587](https://github.com/revans/bash-it/commit/306f7b1587486cd4ed20726f64ecc2bf96334d47) * system-ruby display in prompt [5ef3f817fe](https://github.com/revans/bash-it/commit/5ef3f817fef1aff10f34881f856a60f4066ac1ea)
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 @@ -20,3 +20,12 @@ $:.unshift 'lib' require 'groff_parser/document' require 'groff_parser/engine' + +# Allow usage of 'context' like 'describe' +module MiniTest + class Spec + class << self + alias_method :context, :describe + end + end +end
Test Suite: enables the usage of context like describe
diff --git a/tumblr_client.gemspec b/tumblr_client.gemspec index abc1234..def5678 100644 --- a/tumblr_client.gemspec +++ b/tumblr_client.gemspec @@ -5,7 +5,7 @@ gem.add_dependency 'faraday', '~> 0.9.0' gem.add_dependency 'faraday_middleware', '~> 0.9.0' gem.add_dependency 'json' - gem.add_dependency 'simple_oauth', '~> 0.2.0' + gem.add_dependency 'simple_oauth', '0.2.0' gem.add_dependency 'oauth' gem.add_dependency 'mime-types' gem.add_development_dependency 'rake'
Revert "Enforced simple_oauth ~> 0.2.0 as a dependency" This reverts commit 0f9a4b160540edf2397631ce956067f035cfe4b2.
diff --git a/test/integration/compute/core_compute/test_disks.rb b/test/integration/compute/core_compute/test_disks.rb index abc1234..def5678 100644 --- a/test/integration/compute/core_compute/test_disks.rb +++ b/test/integration/compute/core_compute/test_disks.rb @@ -29,4 +29,25 @@ :type => "PERSISTENT" } assert_equal(example_with_params, config_with_params) end + + def test_create_snapshot + disk = @factory.create + disk.wait_for { ready? } + + snapshot = disk.create_snapshot("fog-test-snapshot") + + assert(snapshot.is_a?(Fog::Compute::Google::Snapshot), + "Resulting snapshot should be a snapshot object.") + + assert_raises(ArgumentError) { snapshot.set_labels(["bar", "test"]) } + + snapshot.set_labels(foo: "bar", fog: "test") + + assert_equal(snapshot.labels[:foo], "bar") + assert_equal(snapshot.labels[:fog], "test") + + # Clean up the snapshot + operation = snapshot.destroy + operation.wait_for { ready? } + end end
Add an integration test for snapshots
diff --git a/TorchORM.podspec b/TorchORM.podspec index abc1234..def5678 100644 --- a/TorchORM.podspec +++ b/TorchORM.podspec @@ -20,7 +20,10 @@ s.tvos.deployment_target = '9.0' s.source_files = ['Source/**/*.swift'] s.preserve_paths = ['Generator/**/*', 'run'] - s.prepare_command = './build_generator' + s.prepare_command = <<-CMD + git submodule update --init --recursive + ./build_generator + CMD s.frameworks = 'CoreData' s.module_name = 'Torch' s.requires_arc = true
Add git submodule init to prepare_command.
diff --git a/test/redis/store/redis_version_test.rb b/test/redis/store/redis_version_test.rb index abc1234..def5678 100644 --- a/test/redis/store/redis_version_test.rb +++ b/test/redis/store/redis_version_test.rb @@ -11,15 +11,16 @@ describe '#redis_version' do it 'returns redis version' do - @store.redis_version.to_s.must_match(/^\d{1}\.\d{1}\.\d{1}$/) + @store.redis_version.to_s.must_match(/^\d{1}\.\d{1,}\.\d{1,}$/) end end describe '#supports_redis_version?' do it 'returns true if redis version is greater or equal to required version' do - @store.stubs(:redis_version).returns('2.8.9') - @store.supports_redis_version?('2.8.0').must_equal(true) - @store.supports_redis_version?('2.8.9').must_equal(true) + @store.stubs(:redis_version).returns('2.8.19') + @store.supports_redis_version?('2.6.0').must_equal(true) + @store.supports_redis_version?('2.8.19').must_equal(true) + @store.supports_redis_version?('2.8.20').must_equal(false) @store.supports_redis_version?('2.9.0').must_equal(false) @store.supports_redis_version?('3.0.0').must_equal(false) end
Handle minor and patch version correctly as they may be multiple digits
diff --git a/controller_validator.gemspec b/controller_validator.gemspec index abc1234..def5678 100644 --- a/controller_validator.gemspec +++ b/controller_validator.gemspec @@ -19,7 +19,7 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.7" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake", "~> 12.3" spec.add_development_dependency "rspec", "~> 3" spec.add_development_dependency "reek" spec.add_development_dependency "roodi"
Upgrade rake to version 12.3.0
diff --git a/lib/fooda-bot/slack_event_formatter.rb b/lib/fooda-bot/slack_event_formatter.rb index abc1234..def5678 100644 --- a/lib/fooda-bot/slack_event_formatter.rb +++ b/lib/fooda-bot/slack_event_formatter.rb @@ -21,8 +21,12 @@ end def formatted_reactions - reactions.reactions.map do |reaction| - "#{reaction[:count]} :#{reaction[:name]}:" - end.join(' ') + if reactions.reactions + reactions.reactions.map do |reaction| + "#{reaction[:count]} :#{reaction[:name]}:" + end.join(' ') + else + 'no reactions??? Bad humans!' + end end end
Fix for when nobody reacts
diff --git a/lib/podio/models/app_store_category.rb b/lib/podio/models/app_store_category.rb index abc1234..def5678 100644 --- a/lib/podio/models/app_store_category.rb +++ b/lib/podio/models/app_store_category.rb @@ -14,8 +14,8 @@ end # @see https://developers.podio.com/doc/app-market/get-categories-37009 - def find_all - categories = Podio.connection.get("/app_store/category/").body + def find_all(options = {}) + categories = Podio.connection.get("/app_store/category/", options).body categories.each do | key, value | categories[key] = list value
Add options to get the categories
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -32,11 +32,9 @@ end end -# Set FOG_MOCK=true to enable Fog Mock mode. -# NB: Your test data will need to reflect the 'initial data structure' in -# https://github.com/fog/fog/blob/master/lib/fog/vcloud_director/compute.rb#L483 -# -# Use FOG_CREDENTIAL=fog_mock in vcloud_tools_tester +# To enable Fog Mock mode use FOG_CREDENTIAL=fog_mock and FOG_MOCK=true +# If you do not have configuration for fog_mock in your vcloud_tools_testing_config.yaml, +# the test data is defined here: https://github.com/fog/fog/blob/master/lib/fog/vcloud_director/compute.rb#L483-L733 # if ENV['FOG_MOCK'] Fog.mock!
Clarify explanation of how to set up fog mock mode We are adding the test data to [our shared setup](https://github.gds/gds/vcloud-tools-testing-config/blob/master/vcloud_tools_testing_config.yaml) so this detail is for external users.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,15 @@ require "simplecov" SimpleCov.start +require "webmock/rspec" + if ENV["CI"] + WebMock.disable_net_connect!(allow: "codeclimate.com") require "codeclimate-test-reporter" CodeClimate::TestReporter.start end require "syoboi_calendar" -require "webmock/rspec" RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true
Allow net connect to codeclimate
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -21,4 +21,5 @@ config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true config.filter_run :focus + config.include ElementHelpers end
Include element helpers in spec helper.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,4 +9,11 @@ config.expect_with :rspec do |c| c.syntax = :expect end + + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true end
Allow focus: true to work
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ require File.expand_path('../../lib/urban_dictionary', __FILE__) RSpec.configure do |config| - config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered = true config.filter_run :focus config.order = 'random'
Fix RSpec 3.4 deprecation warning > Deprecation Warnings: > > RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values = > is deprecated, it is now set to true as default and setting it to false has > no effect.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,4 @@-if ENV["CODECLIMATE_REPO_TOKEN"] +if ENV["CC_TEST_REPORTER_ID"] require "simplecov" SimpleCov.start end
Send coverage to CodeClimate. Maybe?
diff --git a/spec/stream_spec.rb b/spec/stream_spec.rb index abc1234..def5678 100644 --- a/spec/stream_spec.rb +++ b/spec/stream_spec.rb @@ -7,7 +7,7 @@ before { mock_amqp } - it 'should open a streaming connection' do + it 'should open a event-stream streaming connection' do @event_machine.run do get '/stream', provides: 'text/event-stream' expect(last_response.content_type).to eq 'text/event-stream;charset=utf-8' @@ -41,6 +41,14 @@ it 'forwards each message to the clients' do em.run do subscription.to 'samples' + subscription.exchange.publish "some observation", routing_key: '' + expect(@stream).to receive(:<<).with(/some observation/) + end + end + + it 'messages conform to the Event Stream Format' do + @event_machine.run do + subscription.to 'samples' subscription.exchange.publish "Hello, world!", routing_key: '' expect(stream).to receive(:<<).with("data: Hello, world!\n\n") end
Test Event Stream Format compliance
diff --git a/tty-command.gemspec b/tty-command.gemspec index abc1234..def5678 100644 --- a/tty-command.gemspec +++ b/tty-command.gemspec @@ -14,7 +14,7 @@ spec.homepage = "https://piotrmurach.github.io/tty" spec.license = "MIT" - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.files = Dir['README.md', 'LICENSE.txt', 'CHANGELOG.md', "lib/**/*.rb", 'tty-command.gemspec'] spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"]
Change to only load necessary files
diff --git a/voight_kampff.gemspec b/voight_kampff.gemspec index abc1234..def5678 100644 --- a/voight_kampff.gemspec +++ b/voight_kampff.gemspec @@ -12,6 +12,6 @@ s.require_path = 'lib' s.author = "Adam Crownoble" s.email = "adam@obledesign.com" - s.homepage = "https://github.com/adamcrown/Voight-Kampff" + s.homepage = "https://github.com/biola/Voight-Kampff" s.add_dependency('httpclient', '>2.1.0') end
Update gemspec to point to new repository location
diff --git a/0_code_wars/complete_the_pattern_3.rb b/0_code_wars/complete_the_pattern_3.rb index abc1234..def5678 100644 --- a/0_code_wars/complete_the_pattern_3.rb +++ b/0_code_wars/complete_the_pattern_3.rb @@ -0,0 +1,12 @@+# http://www.codewars.com/kata/557341907fbf439911000022 +# --- iteration 1 --- +def pattern(n) + return "" unless n > 0 + nums = n.downto(1) + (1.upto(n)).reduce([]){ |acc, i| acc << nums.first(i).join }.join("\n") +end + +# --- iteration 2 --- +def pattern(n) + n.downto(1).map { |x| n.downto(x).to_a.join }.join("\n") +end
Add code wars (7) - complete the pattern 3
diff --git a/spec/customer_management_spec.rb b/spec/customer_management_spec.rb index abc1234..def5678 100644 --- a/spec/customer_management_spec.rb +++ b/spec/customer_management_spec.rb @@ -4,30 +4,25 @@ # Author:: jlopezn@neonline.cl describe BingAdsApi::CustomerManagement do - before :all do - @config = BingAdsApi::Config.instance - @options = { - :environment => :sandbox, - :username => "ruby_bing_ads_sbx", - :password => "sandbox123", - :developer_token => "BBD37VB98", - :customer_id => "21025739", - :account_id => "8506945" + let(:default_options) do + { + environment: :sandbox, + username: "ruby_bing_ads_sbx", + password: "sandbox123", + developer_token: "BBD37VB98", + customer_id: "21025739", + account_id: "8506945" } - @service = BingAdsApi::CustomerManagement.new(@options) + end + let(:service) { BingAdsApi::CustomerManagement.new(default_options) } + + it "should initialize with options" do + new_service = BingAdsApi::CustomerManagement.new(default_options) + expect(new_service).not_to be_nil end - it "truth" do - expect(BingAdsApi).to be_kind_of(Module) - end - - it "initialize" do - @service = BingAdsApi::CustomerManagement.new(@options) - expect(@service).not_to be_nil - end - - it "get accounts info" do - response = @service.get_accounts_info + it "should get accounts info" do + response = service.get_accounts_info expect(response).not_to be_nil expect(response).to be_kind_of(Array) end
Clean up customer management spec
diff --git a/spec/jira/resource/issue_spec.rb b/spec/jira/resource/issue_spec.rb index abc1234..def5678 100644 --- a/spec/jira/resource/issue_spec.rb +++ b/spec/jira/resource/issue_spec.rb @@ -0,0 +1,22 @@+require 'spec_helper' + +describe Jira::Resource::Issue do + + let(:client) { mock() } + + it "should find an issue by key or id" do + response = mock() + response.stub(:body).and_return('{"key":"foo","id":"101"}') + Jira::Resource::Issue.stub(:rest_base_path).and_return('/jira/rest/api/2/issue') + client.should_receive(:get).with('/jira/rest/api/2/issue/foo') + .and_return(response) + client.should_receive(:get).with('/jira/rest/api/2/issue/101') + .and_return(response) + + issue_from_id = Jira::Resource::Issue.find(client,101) + issue_from_key = Jira::Resource::Issue.find(client,'foo') + + issue_from_id.attrs.should == issue_from_key.attrs + end + +end
Add test for finding issue by key or id
diff --git a/spec/routing/api_routing_spec.rb b/spec/routing/api_routing_spec.rb index abc1234..def5678 100644 --- a/spec/routing/api_routing_spec.rb +++ b/spec/routing/api_routing_spec.rb @@ -7,25 +7,17 @@ end it 'does not route to the GraphqlController' do - expect(get('/api/graphql')).not_to route_to('graphql#execute') - end - - it 'does not expose graphiql' do - expect(get('/-/graphql-explorer')).not_to route_to('graphiql/rails/editors#show') + expect(post('/api/graphql')).not_to route_to('graphql#execute') end end - context 'when graphql is disabled' do + context 'when graphql is enabled' do before do stub_feature_flags(graphql: true) end it 'routes to the GraphqlController' do - expect(get('/api/graphql')).not_to route_to('graphql#execute') - end - - it 'exposes graphiql' do - expect(get('/-/graphql-explorer')).not_to route_to('graphiql/rails/editors#show') + expect(post('/api/graphql')).to route_to('graphql#execute') end end end
Fix spec for routes to the GraphqlController
diff --git a/spec/support/selector_helpers.rb b/spec/support/selector_helpers.rb index abc1234..def5678 100644 --- a/spec/support/selector_helpers.rb +++ b/spec/support/selector_helpers.rb @@ -0,0 +1,7 @@+def dom_id_selector(model) + "#" + ActionController::RecordIdentifier.dom_id(model) +end + +def dom_class_selector(model) + "." + ActionController::RecordIdentifier.dom_class(model) +end
Add dom_id and dom_class selector helpers for constraining to areas of a page.
diff --git a/test/customer_saved_search_test.rb b/test/customer_saved_search_test.rb index abc1234..def5678 100644 --- a/test/customer_saved_search_test.rb +++ b/test/customer_saved_search_test.rb @@ -7,13 +7,13 @@ end def test_get_customers_from_customer_saved_search - fake 'customers.json?customer_saved_search_id=8899730', :body => load_fixture('customer_saved_search_customers'), :extension => false + fake 'customers/search.json?saved_search_id=8899730', :body => load_fixture('customer_saved_search_customers'), :extension => false assert_equal 1, @customer_saved_search.customers.length assert_equal 112223902, @customer_saved_search.customers.first.id end def test_get_customers_from_customer_saved_search_with_params - fake 'customers.json?customer_saved_search_id=8899730&limit=1', :body => load_fixture('customer_saved_search_customers'), :extension => false + fake 'customers/search.json?saved_search_id=8899730&limit=1', :body => load_fixture('customer_saved_search_customers'), :extension => false customers = @customer_saved_search.customers(:limit => 1) assert_equal 1, customers.length assert_equal 112223902, customers.first.id
Update tests to use search endpoint
diff --git a/vagrant_files/basic/change_hostname.rb b/vagrant_files/basic/change_hostname.rb index abc1234..def5678 100644 --- a/vagrant_files/basic/change_hostname.rb +++ b/vagrant_files/basic/change_hostname.rb @@ -1,4 +1,4 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "shell", inline: "/root/change_hostname.sh #{HOSTNAME}" - config.vm.provision "shell", inline: "sed -i 's/\(manage_etc_hosts:\).*/\1 false/' /etc/cloud/cloud.cfg" + config.vm.provision "shell", inline: "if [ -f /etc/cloud/cloud.cfg ]; then sed -i 's/\(manage_etc_hosts:\).*/\1 false/' /etc/cloud/cloud.cfg; fi" end
Fix setting hostname on none cloud-init based providers
diff --git a/spec/functional/new_app_spec.rb b/spec/functional/new_app_spec.rb index abc1234..def5678 100644 --- a/spec/functional/new_app_spec.rb +++ b/spec/functional/new_app_spec.rb @@ -0,0 +1,58 @@+require 'functional_spec_helper' + +describe 'New app loading' do + TIMEOUT = 10 + + let(:app) { create_app } + let(:notification) { create_notification } + let(:tcp_socket) { double(TCPSocket, setsockopt: nil, close: nil) } + let(:ssl_socket) do double(OpenSSL::SSL::SSLSocket, :sync= => nil, connect: nil, + write: nil, flush: nil, read: nil, close: nil) + end + let(:io_double) { double(select: nil) } + + before do + stub_tcp_connection + end + + def create_app + app = Rpush::Apns::App.new + app.certificate = TEST_CERT + app.name = 'test' + app.environment = 'sandbox' + app.save! + app + end + + def create_notification + notification = Rpush::Apns::Notification.new + notification.app = app + notification.alert = 'test' + notification.device_token = 'a' * 64 + notification.save! + notification + end + + def stub_tcp_connection + Rpush::Daemon::TcpConnection.any_instance.stub(connect_socket: [tcp_socket, ssl_socket]) + Rpush::Daemon::TcpConnection.any_instance.stub(setup_ssl_context: double.as_null_object) + stub_const('Rpush::Daemon::TcpConnection::IO', io_double) + end + + def wait_for_notification_to_deliver(notification) + Timeout.timeout(TIMEOUT) do + until notification.delivered + sleep 0.1 + notification.reload + end + end + end + + it 'delivers a notification successfully' do + Rpush.embed + sleep 1 # wait to boot. this sucks. + wait_for_notification_to_deliver(notification) + end + + after { Timeout.timeout(TIMEOUT) { Rpush.shutdown } } +end
Add functional spec for new apps.
diff --git a/spec/support/coverage_loader.rb b/spec/support/coverage_loader.rb index abc1234..def5678 100644 --- a/spec/support/coverage_loader.rb +++ b/spec/support/coverage_loader.rb @@ -1,4 +1,4 @@-MINIMUM_COVERAGE = 76.3 +MINIMUM_COVERAGE = 76.1 unless ENV['COVERAGE'] == 'off' require 'simplecov'
Reduce coverage to travis level
diff --git a/spec/data_table_spec.rb b/spec/data_table_spec.rb index abc1234..def5678 100644 --- a/spec/data_table_spec.rb +++ b/spec/data_table_spec.rb @@ -1,14 +1,34 @@ require 'spec_helper' describe DataTable::DataTable do - let(:row) { ['col1', 2] } + let(:row) { ['col1', 2, Money.new(3)] } + let(:money_class) { + Class.new do + def initialize(dollars) + @dollars = dollars + end + + def format + "$#{with_places}" + end + + def to_s + with_places + end + + def with_places + '%.2f' % @dollars + end + end + } before do + stub_const 'Money', money_class subject << { body: [row] } end it 'should generate csv' do - expect(subject.to_csv).to eq 'col1,2' + expect(subject.to_csv).to eq 'col1,2,3.00' end it 'should generate html' do @@ -18,6 +38,7 @@ '<tr>'\ '<td class="text">col1</td>'\ '<td class="number">2</td>'\ + '<td class="money">$3.00</td>'\ '</tr>'\ '</tbody>'\ '</table>'
Add spec to document existing money behaviour
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,7 +1,7 @@ class SessionsController < ApplicationController def callback user = User.omniauth(env['omniauth.auth']) - user.update metadata: Mumukit::Auth::Token.from_env(env).metadata + user.update! metadata: Mumukit::Auth::Token.from_env(env).metadata remember_me_token.value = user.remember_me_token redirect_after_login
Update must not fail silently
diff --git a/app/jobs/fetch_developers_job.rb b/app/jobs/fetch_developers_job.rb index abc1234..def5678 100644 --- a/app/jobs/fetch_developers_job.rb +++ b/app/jobs/fetch_developers_job.rb @@ -4,10 +4,10 @@ rescue_from ActiveRecord::RecordNotFound, &:message def perform(cache_key) - logins = Rails.cache.read(cache_key) + search = Rails.cache.read(cache_key) Rails.cache.fetch([cache_key, 'collection'], expires_in: 2.days) do response.developers_collection - end unless logins.nil? + end unless search.nil? && search.logins.any? end end
Add check to make sure logins aren't empty
diff --git a/app/models/concerns/sluggable.rb b/app/models/concerns/sluggable.rb index abc1234..def5678 100644 --- a/app/models/concerns/sluggable.rb +++ b/app/models/concerns/sluggable.rb @@ -3,6 +3,10 @@ included do before_validation :generate_slug, if: :generate_slug? + + def self.find_by_slug_or_id(slug_or_id) + find_by_slug(slug_or_id) || find_by_id(slug_or_id) + end end def generate_slug
Add method find_by_slug_or_id to Sluggable module Make it easier to find by slug or id for sluggable models. Will return nil if resource is not found.
diff --git a/spec/travis/app_spec.rb b/spec/travis/app_spec.rb index abc1234..def5678 100644 --- a/spec/travis/app_spec.rb +++ b/spec/travis/app_spec.rb @@ -15,4 +15,16 @@ expect(response.status).to be == 204 end end + + describe 'GET /cache' do + let(:token) { + # payload with no time stamps + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJUcmF2aXMgQ0ksIEdtYkgiLCJjb250ZXh0Ijp7InNsdWciOiJ0cmF2aXMtY2kvdHJhdmlzLWNpIiwiYnJhbmNoIjoibWFzdGVyIiwibGFuZ3VhZ2UiOiJydWJ5In19.FcN-ncXaziPZZHJectxTUkX2pjrIcQi9Tmcxugtrufo' + } + + it 'decodes payload correctly' do + response = get "/cache?token=#{token}" + expect(response.status).to be == 200 + end + end end
Add spec for GET /cache
diff --git a/spree_robokassa.gemspec b/spree_robokassa.gemspec index abc1234..def5678 100644 --- a/spree_robokassa.gemspec +++ b/spree_robokassa.gemspec @@ -7,9 +7,9 @@ s.description = 'TODO: Add (optional) gem description here' s.required_ruby_version = '>= 1.9.3' - # s.author = 'You' - # s.email = 'you@example.com' - # s.homepage = 'http://www.spreecommerce.com' + s.author = 'Oleg Litvin' + s.email = 'oleg@dointeractive.ru' + s.homepage = 'http://www.dointeractive.ru' #s.files = `git ls-files`.split("\n") #s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Update author to prevent bundler warning
diff --git a/Library/Homebrew/test/formula_test.rb b/Library/Homebrew/test/formula_test.rb index abc1234..def5678 100644 --- a/Library/Homebrew/test/formula_test.rb +++ b/Library/Homebrew/test/formula_test.rb @@ -39,4 +39,12 @@ assert_equal('', result, "--prefix is incorrectly single-quoted in #{f}") end end + + def test_for_crufy_sourceforge_url + # Don't specify mirror for SourceForge downloads + Formulary.paths.each do |f| + result = `grep "\?use_mirror=" "#{f}"`.strip + assert_equal('', result, "Remove 'use_mirror' from url for #{f}") + end + end end
Add formula check for crufy SourceForge URLs.
diff --git a/1_codility/0_training/8_2_equileader.rb b/1_codility/0_training/8_2_equileader.rb index abc1234..def5678 100644 --- a/1_codility/0_training/8_2_equileader.rb +++ b/1_codility/0_training/8_2_equileader.rb @@ -0,0 +1,52 @@+# 100/100 +def solution(arr) + # find the leader for the overall array + stack = [] + arr.each do |el| + stack.unshift(el) + if stack.size > 1 && stack[0] != stack[1] + stack.shift(2) + end + end + + candidate = stack.shift + total_leader_count = 0 + + if candidate + arr.each do |el| + total_leader_count += 1 if el == candidate + end + end + + return 0 unless total_leader_count > arr.size / 2 + leader = candidate + + # count indexes where leader is fulfilled for left and right + left_length, right_length = 0, arr.size + left_leader_count, right_leader_count = 0, total_leader_count + + same_leader_index_count = 0 + + (0...(arr.size - 1)).each do |i| + left_length += 1 + right_length -= 1 + + if arr[i] == leader + left_leader_count += 1 + right_leader_count -= 1 + end + + if (left_leader_count > left_length / 2) && (right_leader_count > right_length / 2) + same_leader_index_count += 1 + end + end + + same_leader_index_count +end + +=begin +gotchas +* If X is the leader for the overall array, it's the only possible leader for both halves of the array +* Use the technique here: https://codility.com/media/train/6-Leader.pdf with a stack to get the original leader +* Line 39 needs to be outside the if statement on line 34 (I accidentally put it inside on my first attempt) +=end
Add codility training 8-2 equileader
diff --git a/rest-client.gemspec b/rest-client.gemspec index abc1234..def5678 100644 --- a/rest-client.gemspec +++ b/rest-client.gemspec @@ -18,5 +18,6 @@ s.add_development_dependency(%q<webmock>, ["~> 1.4"]) s.add_development_dependency(%q<rspec>, ["~> 2.4"]) s.add_dependency(%q<netrc>, ["~> 0.7.7"]) + s.add_dependency(%q<rdoc>, [">= 2.4.2"]) end
Add rdoc to gem dependencies for the sake of Ruby 1.9.2 Without this, attempting to run rake in 1.9.2 will raise a confusing error message about changing 'rake/rdoctask' to 'rdoc/task' in Rakefile, even though this is already done in the Rakefile.
diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb index abc1234..def5678 100644 --- a/app/controllers/session_controller.rb +++ b/app/controllers/session_controller.rb @@ -6,9 +6,7 @@ email = params[:email] password = params[:password] @user = User.find_by email: email - if @user.nil? - render :new - elsif @user.password == password + if @user && @user.authenticate(password) session[:user_id] = @user.id redirect_back_or_default root_path else
Edit session controller so that feature tests pass
diff --git a/app/models/visualization/presenter.rb b/app/models/visualization/presenter.rb index abc1234..def5678 100644 --- a/app/models/visualization/presenter.rb +++ b/app/models/visualization/presenter.rb @@ -18,7 +18,8 @@ description: visualization.description, privacy: visualization.privacy.upcase, table: table_data_for(visualization.table), - related_tables: visualization.related_tables + related_tables: visualization.related_tables, + stats: visualization.stats } end #to_poro
Return stats when rendering a visualization to JSON
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -7,6 +7,7 @@ class Star < Sinatra::Base configure do + set :haml, { :format => :html5 } @@config = YAML.load_file('config.yml') Twitter.configure do |config|
Use html5 format for haml.
diff --git a/features/support/capybara.rb b/features/support/capybara.rb index abc1234..def5678 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -2,3 +2,11 @@ # We think this may be due to timeouts (the default is 2 secs), # so we've increased the default timeout. Capybara.default_wait_time = 5 + +module ScreenshotHelper + def screenshot(name = 'capybara') + page.driver.render(File.join(Rails.root, 'tmp', "#{name}.png"), full: true) + end +end + +World(ScreenshotHelper)
Add screenshot helper for cucumber @javascript scenarios Call `screenshot` within a Cucumber step and Poltergeist (the capybara driver) will create a tmp/capybara.png file containing a screenshot of the current page. Pass an argument to give the screenshot a different name. Useful when debugging failing steps.
diff --git a/fluent-plugin-loggly.gemspec b/fluent-plugin-loggly.gemspec index abc1234..def5678 100644 --- a/fluent-plugin-loggly.gemspec +++ b/fluent-plugin-loggly.gemspec @@ -9,6 +9,7 @@ s.homepage = "https://github.com/patant/fluent-plugin-loggly" s.summary = %q{Fluentd plugin for output to loggly} s.description = %q{Fluentd pluging (fluentd.org) for output to loggly (loggly.com)} + s.license = "Apache-2.0" s.rubyforge_project = "fluent-plugin-loggly"
Add missing license entry in gemspec Display license information on rubygems.org when release new version.
diff --git a/spec/features/components_guide_spec.rb b/spec/features/components_guide_spec.rb index abc1234..def5678 100644 --- a/spec/features/components_guide_spec.rb +++ b/spec/features/components_guide_spec.rb @@ -0,0 +1,16 @@+require "rails_helper" + +RSpec.feature "Visit Component Guide" do + scenario "User views the component guide page" do + when_i_visit_the_component_guide_index_page + then_i_receive_a_valid_response + end + + def when_i_visit_the_component_guide_index_page + visit "/component-guide" + end + + def then_i_receive_a_valid_response + expect(page.status_code).to eq(200) + end +end
Add test to check component guide loads correctly
diff --git a/spec/lib/angellist_api/request_spec.rb b/spec/lib/angellist_api/request_spec.rb index abc1234..def5678 100644 --- a/spec/lib/angellist_api/request_spec.rb +++ b/spec/lib/angellist_api/request_spec.rb @@ -0,0 +1,53 @@+require 'spec_helper' + +describe AngellistApi::Request do + class DummyRequest; include AngellistApi::Request; end + + before(:each) do + @dummy = DummyRequest.new + @sample_path = "/index" + @sample_params = { :sample => "params" } + @sample_options = { :sample => "options" } + end + + describe "#get" do + it "should call request with the passed params" do + @dummy.expects(:request).with(:get, @sample_path, @sample_params, @sample_options).returns("result") + @dummy.get(@sample_path, @sample_params, @sample_options).should == "result" + end + end + + describe "#post" do + it "should call request with the passed params" do + @dummy.expects(:request).with(:post, @sample_path, @sample_params, @sample_options).returns("result") + @dummy.post(@sample_path, @sample_params, @sample_options).should == "result" + end + end + + describe "#put" do + it "should call request with the passed params" do + @dummy.expects(:request).with(:put, @sample_path, @sample_params, @sample_options).returns("result") + @dummy.put(@sample_path, @sample_params, @sample_options).should == "result" + end + end + + describe "#delete" do + it "should call request with the passed params" do + @dummy.expects(:request).with(:delete, @sample_path, @sample_params, @sample_options).returns("result") + @dummy.delete(@sample_path, @sample_params, @sample_options).should == "result" + end + end + + describe "#formatted_path" do + it "should return a string with the path and the given format appended" do + @dummy.expects(:format).returns(:something) + @dummy.send(:formatted_path, @sample_path, {:format => 'json'}).should == "/index.json" + end + + it "should not throw an error options[:format] is not provided" do + @dummy.expects(:format).returns(:json) + lambda { @dummy.send(:formatted_path, @sample_path) }.should_not raise_error + end + end + +end
Add spec tests for request
diff --git a/ext/trie/extconf.rb b/ext/trie/extconf.rb index abc1234..def5678 100644 --- a/ext/trie/extconf.rb +++ b/ext/trie/extconf.rb @@ -1,4 +1,4 @@-system('cd ext/libdatrie && ./configure && make') +system("cd #{File.dirname(__FILE__)}/../libdatrie && ./configure && make") require 'mkmf' dir_config 'trie'
Make the libdatrie compile command use a relative path.
diff --git a/spec/views/home/index.html.erb_spec.rb b/spec/views/home/index.html.erb_spec.rb index abc1234..def5678 100644 --- a/spec/views/home/index.html.erb_spec.rb +++ b/spec/views/home/index.html.erb_spec.rb @@ -12,15 +12,15 @@ visit '/' end - it "displays a sign-up header button" do + it "displays a Learn More header button" do within ".sign-up-club" do - page.should have_selector("a", :text => "Sign Up Now!") + page.should have_selector("a", :text => "Learn More!") end end - it "displays a sign-up main button" do + it "displays a learn more main button" do within ".submit-sign-up" do - page.should have_selector("span", :text => "Start A Club Now") + page.should have_selector("span", :text => "Click to Learn More") end end end
Update Home Spec for Learn More Buttons Update the Home page spec to ensure it corresponds to the new Learn More buttons.
diff --git a/spec/support/pages/admin_users_page.rb b/spec/support/pages/admin_users_page.rb index abc1234..def5678 100644 --- a/spec/support/pages/admin_users_page.rb +++ b/spec/support/pages/admin_users_page.rb @@ -11,11 +11,11 @@ end def admin? - !!@element.all('td')[2].find('input[type="checkbox"]').checked? + !!@element.all('td')[4].find('input[type="checkbox"]').checked? end def set_admin - @element.all('td')[2].find('input[type="checkbox"]').set(true) + @element.all('td')[4].find('input[type="checkbox"]').set(true) end end
Update AdminUsersPage::UserFragment for table changes
diff --git a/spec/views/home/index.html.erb_spec.rb b/spec/views/home/index.html.erb_spec.rb index abc1234..def5678 100644 --- a/spec/views/home/index.html.erb_spec.rb +++ b/spec/views/home/index.html.erb_spec.rb @@ -0,0 +1,53 @@+require 'spec_helper' + +describe "home/index.html.erb" do + include Warden::Test::Helpers + Warden.test_mode! + + describe "GET '/'" do + describe "for a signed-in user" do + before :each do + login_as FactoryGirl.create(:user), :scope => :user + visit '/' + end + + after :each do + Warden.test_reset! + end + + it "should display a link to the user's club" do + page.should have_selector('a span', :text => 'My Club') + end + + describe "navbar" do + it "should display a link to the user's account" do + within ".navbar" do + page.should have_selector('a', :text => 'Account') + end + end + + it "should display a link to Logout" do + within ".navbar" do + page.should have_selector('a', :text => 'Logout') + end + end + end + end + + describe "for a non signed-in guest" do + before :each do + visit '/' + end + + it "should display a 'Learn More' link" do + page.should have_selector('a span', :text => 'Learn More') + end + + it "should display a link to Login" do + within ".navbar" do + page.should have_selector('a', :text => 'Login') + end + end + end + end +end
Add Capybara Spec for Home Index View Add a view spec test for the home view to ensure that user logged in/logged out functions as expected.
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -14,18 +14,6 @@ set :scm_auth_cache, true set :mongrel_conf, "/usr/local/etc/mongrel_cluster/#{application}.yml" -desc "Show source control status of files on server, in case anyone has edited them directly" -task :edits do - run "cd #{current_path}; svn stat" - run "cd #{current_path}/local; svn stat" -end - -desc "Commit modified files on server to source control, in case anyone has edited them directly" -task :commit_edits do - # Can't commit from Rails root without side-stepping log symlink, so just do local for now - run "cd #{current_path}/local; svn commit -m 'Manual updates'" -end - namespace :deploy do desc "Custom deployment" task :after_update_code do
Remove old SVN-based Cap tasks
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,10 @@ ActionController::Routing::Routes.draw do |map| map.resources :db_instances - map.resources :apps do |apps| - apps.resources :activities do |activities| - activities.resources :changes, :collection => {:suggest_new => :get, :suggest => :post} - activities.resources :versions + map.resources :apps, :except => [:destroy] do |apps| + apps.resources :activities, :except => [:destroy] do |activities| + activities.resources :changes, :collection => {:suggest_new => :get, :suggest => :post}, :except => [:destroy] + activities.resources :versions, :except => [:destroy] end end
Remove destroy action from all resources
diff --git a/fech-search.gemspec b/fech-search.gemspec index abc1234..def5678 100644 --- a/fech-search.gemspec +++ b/fech-search.gemspec @@ -15,7 +15,7 @@ gem.require_paths = ["lib"] gem.version = Fech::Search::VERSION - gem.add_dependency "fech", "1.4.1" + gem.add_dependency "fech", "~> 1.4.1" gem.add_development_dependency "rspec", "~> 2.13.0" end
Use ~> for Fech version dependency
diff --git a/app/models/concerns/hyrax/with_events.rb b/app/models/concerns/hyrax/with_events.rb index abc1234..def5678 100644 --- a/app/models/concerns/hyrax/with_events.rb +++ b/app/models/concerns/hyrax/with_events.rb @@ -10,7 +10,7 @@ # @return [String] def event_class - self.class.name + model_name.name end def events(size = -1)
Use `model_name.name` for event class namespacing Pin the namespacing for events to the model name, not the Ruby class name. In most cases (excepting adopters who have specificially overridden ActiveModel naming behavior) this should have no impact, but loosens the dependency on specific Ruby class names.
diff --git a/app/serializers/assessment_serializer.rb b/app/serializers/assessment_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/assessment_serializer.rb +++ b/app/serializers/assessment_serializer.rb @@ -1,6 +1,6 @@ class AssessmentSerializer < ActiveModel::Serializer embed :ids, include: true - attributes :id, :score, :notes, :created_at + attributes :id, :score, :notes, :published, :created_at has_one :submission has_one :assessor -end+end
Add published flag to assessment serializer.
diff --git a/pandoc-ruby.gemspec b/pandoc-ruby.gemspec index abc1234..def5678 100644 --- a/pandoc-ruby.gemspec +++ b/pandoc-ruby.gemspec @@ -14,7 +14,7 @@ 'LICENSE', 'README.md' ] - s.files = %w( + s.files = %w[ .document Gemfile Gemfile.lock @@ -29,7 +29,7 @@ test/helper.rb test/test_conversions.rb test/test_pandoc_ruby.rb - ) + ] s.homepage = 'http://github.com/alphabetum/pandoc-ruby' s.licenses = ['MIT'] s.require_paths = ['lib']
Use square brackets with `%w` to appease rubocop.
diff --git a/app/views/nodes/article_list.rss.builder b/app/views/nodes/article_list.rss.builder index abc1234..def5678 100644 --- a/app/views/nodes/article_list.rss.builder +++ b/app/views/nodes/article_list.rss.builder @@ -9,7 +9,7 @@ xml.item do xml.title(article.title) xml.category(article.category_list) unless article.categories.blank? - xml.description(article.body) + xml.description(article.description) xml.pubDate(article.published_at.rfc822) xml.link(node_url(article)) xml.guid(node_url(article))
Use description in RSS as description Body has too much html that could be invalid (ie Images JS etc)
diff --git a/panda_doc.gemspec b/panda_doc.gemspec index abc1234..def5678 100644 --- a/panda_doc.gemspec +++ b/panda_doc.gemspec @@ -16,7 +16,8 @@ spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - spec.bindir = "bin" + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] spec.required_ruby_version = "~> 2.2"
Change path to own executables
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,6 +14,9 @@ require 'rdf/spec' require 'rdf/isomorphic' +require 'i18n' +I18n.enforce_available_locales = false + RSpec.configure do |config| config.filter_run :focus => true config.run_all_when_everything_filtered = true
Set I18n.enforce_available_locales = false when running specs.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,7 +3,7 @@ SimpleCov.formatter = Coveralls::SimpleCov::Formatter SimpleCov.start do - add_filter 'lib' + add_filter 'spec' end require 'pry'
Add proper filter for coveralls, use spec not lib
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -14,6 +14,7 @@ source.filename =~ /lib\/agharta\/notifies/ || source.filename =~ /lib\/agharta\/stores/ end + add_group 'Extension', 'lib/agharta/core_ext' end end
Add extension group at simplecov.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,17 +2,15 @@ require 'rubygems' gem 'dm-core', '0.10.0' -gem 'randexp', '~>0.1.4' - require 'dm-core' -ROOT = Pathname(__FILE__).dirname.parent.expand_path +ROOT = Pathname(__FILE__).dirname.parent # use local dm-validations if running from dm-more directly -lib = ROOT.parent.join('dm-validations', 'lib').expand_path +lib = ROOT.parent / 'dm-validations' / 'lib' $LOAD_PATH.unshift(lib) if lib.directory? require 'dm-validations' -require ROOT + 'lib/dm-sweatshop' +require ROOT / 'lib' / 'dm-sweatshop' DataMapper.setup(:default, 'sqlite3::memory:')
[dm-more] Remove rubygems usage from libraries * No longer require dm-core inside the plugins. Expected usage is to require dm-core prior to requiring the plugin. * Updated pathname creation to using Pathname#/ where possible
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,8 +4,9 @@ # loaded once. # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration + RSpec.configure do |config| - config.treat_symbols_as_metadata_keys_with_true_values = true + config.raise_errors_for_deprecations! config.run_all_when_everything_filtered = true config.filter_run :focus
Update spec helper to get angry if you aren't using rspec 3 syntax
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,7 @@ require 'chefspec/berkshelf' RSpec.configure do |config| - config.color = true - config.log_level = :error + config.color = true # Use color in STDOUT + config.formatter = :documentation # Use the specified formatter + config.log_level = :error # Avoid deprecation notice SPAM end
Use doc output in our specs Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/spec/support/vcr.rb b/spec/support/vcr.rb index abc1234..def5678 100644 --- a/spec/support/vcr.rb +++ b/spec/support/vcr.rb @@ -0,0 +1,13 @@+# VCR config +require 'vcr' + +VCR.configure do |c| + c.configure_rspec_metadata! + c.hook_into :faraday + c.default_cassette_options = { + record: ENV['TRAVIS'] ? :none : :once + } + c.cassette_library_dir = 'spec/cassettes' +end + +VCR.turn_off! ignore_cassettes: true if ENV['TRAVIS']
Move VCR to spec support
diff --git a/config/initializers/rabl_init.rb b/config/initializers/rabl_init.rb index abc1234..def5678 100644 --- a/config/initializers/rabl_init.rb +++ b/config/initializers/rabl_init.rb @@ -1,4 +1,5 @@ Rabl.configure do |config| + config.json_engine = Oj config.cache_all_output = false config.cache_sources = Rails.env.production? config.include_json_root = false
Make sure Rabl is using Oj
diff --git a/devtools.gemspec b/devtools.gemspec index abc1234..def5678 100644 --- a/devtools.gemspec +++ b/devtools.gemspec @@ -14,6 +14,6 @@ gem.test_files = `git ls-files -- spec`.split("\n") gem.extra_rdoc_files = %w[TODO] - gem.add_dependency('rake', '~> 10.0') - gem.add_dependency('adamantium', '~> 0.0.3') + gem.add_dependency('rake', '~> 10.0.3') + gem.add_dependency('adamantium', '~> 0.0.4') end
Update gem dependencies in gemspec
diff --git a/ci_environment/php/recipes/extensions.rb b/ci_environment/php/recipes/extensions.rb index abc1234..def5678 100644 --- a/ci_environment/php/recipes/extensions.rb +++ b/ci_environment/php/recipes/extensions.rb @@ -18,7 +18,7 @@ node['php']['multi']['versions'].each do |php_version| bash "disable preinstalled PECL extensions for PHP #{php_version}" do - owner node['travis_build_environment']['user'] + user node['travis_build_environment']['user'] group node['travis_build_environment']['group'] environment( 'HOME' => node['travis_build_environment']['home']
Replace `owner` with `user` in bash resource
diff --git a/jekyll-redirect-from.gemspec b/jekyll-redirect-from.gemspec index abc1234..def5678 100644 --- a/jekyll-redirect-from.gemspec +++ b/jekyll-redirect-from.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "jekyll", "~> 2.0" + spec.add_runtime_dependency "jekyll", ">= 2.0" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake"
Add support for Jekyll 3.
diff --git a/Casks/picturelife.rb b/Casks/picturelife.rb index abc1234..def5678 100644 --- a/Casks/picturelife.rb +++ b/Casks/picturelife.rb @@ -4,7 +4,7 @@ url 'https://www.streamnation.com/uploader/osx/picturelife/Picturelife.dmg' name 'Picturelife Smartloader' - homepage 'http://picturelife.com' + homepage 'https://picturelife.com/home' license :gratis app 'Picturelife.app'
Fix homepage to use SSL in Picturelife Smartloader 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.
diff --git a/Casks/vlc-nightly.rb b/Casks/vlc-nightly.rb index abc1234..def5678 100644 --- a/Casks/vlc-nightly.rb +++ b/Casks/vlc-nightly.rb @@ -0,0 +1,9 @@+class VlcNightly < Cask + version 'latest' + sha256 :no_check + + url 'http://nightlies.videolan.org/build/macosx-intel/last' + homepage 'http://www.videolan.org/vlc/' + + link 'vlc-3.0.0-git/VLC.app' +end
Add VLC.app 3.0.0-git (nightly build)
diff --git a/iOS-FakeWeb.podspec b/iOS-FakeWeb.podspec index abc1234..def5678 100644 --- a/iOS-FakeWeb.podspec +++ b/iOS-FakeWeb.podspec @@ -0,0 +1,24 @@+Pod::Spec.new do |s| + s.name = "iOS-FakeWeb" + s.version = "0.1.1" + s.summary = "Simple HTTP request mocking/interception for testing module." + s.homepage = "https://github.com/dealforest/iOS-FakeWeb" + s.license = 'MIT' + s.author = { "Toshihiro Morimoto" => "dealforest.net@gmail.com" } + s.source = { :git => "https://github.com/dealforest/iOS-FakeWeb.git" } + s.platform = :ios + + s.requires_arc = true + + s.preferred_dependency = 'NSURLConnection' + + s.subspec 'NSURLConnection' do |ns| + ns.source_files = 'FakeWeb/FakeWeb*.{h,m}','FakeWeb/NSURLConnection+FakeWeb.{h,m}' + end + + s.subspec 'ASIHTTPRequest' do |as| + as.dependency 'ASIHTTPRequest' + as.source_files = 'FakeWeb/FakeWeb*.{h,m}','FakeWeb/ASIHTTPRequest+FakeWeb.{h,m}' + end + +end
Add podspec for development version
diff --git a/app/controllers/resources_controller.rb b/app/controllers/resources_controller.rb index abc1234..def5678 100644 --- a/app/controllers/resources_controller.rb +++ b/app/controllers/resources_controller.rb @@ -52,8 +52,7 @@ def resource_params params.require(:resource).permit(:title, :url, :description, :language_id, - :favorited, :course_ids => [], :topic_ids => [], - :topics_attributes => [:name]) + :favorited, :topic_ids => [], :topics_attributes => [:name]) end end
Remove course params from resource controller.
diff --git a/app/formatters/description_formatter.rb b/app/formatters/description_formatter.rb index abc1234..def5678 100644 --- a/app/formatters/description_formatter.rb +++ b/app/formatters/description_formatter.rb @@ -11,7 +11,7 @@ str.gsub!("!O!", "&deg;") str.gsub!("!>=!", "&ge;") str.gsub!("!<=!", "&le;") - str.gsub!("&", "&amp; ") + str.gsub!("& ", "&amp; ") str.gsub!("\n \n", "<br/>") str.gsub!("\n", "<br/>") str.gsub! /@(.)/ do
Convert to ampersand only if it is before whitespace.
diff --git a/config/initializers/browse_everything.rb b/config/initializers/browse_everything.rb index abc1234..def5678 100644 --- a/config/initializers/browse_everything.rb +++ b/config/initializers/browse_everything.rb @@ -1,14 +1,15 @@ Rails.application.config.to_prepare do - settings = if Settings.dropbox.google_drive - { 'google_drive' => { client_id: Settings.dropbox.google_drive.client_id, - client_secret: Settings.dropbox.google_drive.client_secret - } - } - elsif Settings.dropbox.path =~ %r{^s3://} + settings = {} + if Settings.dropbox.google_drive + settings['google_drive'] = { client_id: Settings.dropbox.google_drive.client_id, + client_secret: Settings.dropbox.google_drive.client_secret + } + end + if Settings.dropbox.path =~ %r{^s3://} obj = FileLocator::S3File.new(Settings.dropbox.path).object - { 's3' => { name: 'AWS S3 Dropbox', bucket: obj.bucket_name, base: obj.key, response_type: :s3_uri, region: obj.client.config.region } } + settings['s3'] = { name: 'AWS S3 Dropbox', bucket: obj.bucket_name, base: obj.key, response_type: :s3_uri, region: obj.client.config.region } else - { 'file_system' => { name: 'File Dropbox', home: Settings.dropbox.path } } + settings['file_system'] = { name: 'File Dropbox', home: Settings.dropbox.path } end BrowseEverything.configure(settings) end
Allow google drive to be enabled along with either s3 or filesystem
diff --git a/app/services/releases/create_service.rb b/app/services/releases/create_service.rb index abc1234..def5678 100644 --- a/app/services/releases/create_service.rb +++ b/app/services/releases/create_service.rb @@ -8,24 +8,30 @@ return error('Access Denied', 403) unless allowed? return error('Release already exists', 409) if release - new_tag = nil + tag = ensure_tag - unless tag_exist? - return error('Ref is not specified', 422) unless ref + return tag unless tag.is_a?(Gitlab::Git::Tag) - result = Tags::CreateService - .new(project, current_user) - .execute(tag_name, ref, nil) - - return result unless result[:status] == :success - - new_tag = result[:tag] - end - - create_release(existing_tag || new_tag) + create_release(tag) end private + + def ensure_tag + existing_tag || create_tag + end + + def create_tag + return error('Ref is not specified', 422) unless ref + + result = Tags::CreateService + .new(project, current_user) + .execute(tag_name, ref, nil) + + return result unless result[:status] == :success + + result[:tag] + end def allowed? Ability.allowed?(current_user, :create_release, project)
Resolve a Cognitive Complexity of 12
diff --git a/templates/refinery/installer.rb b/templates/refinery/installer.rb index abc1234..def5678 100644 --- a/templates/refinery/installer.rb +++ b/templates/refinery/installer.rb @@ -1,5 +1,5 @@ require 'rbconfig' -VERSION_BAND = '2.0.2' +VERSION_BAND = '2.0.0' # We want to ensure that you have an ExecJS runtime available! begin
Set VERSION_BAND back to 2.0.0 otherwise install fails because e.g. refinerycms-i18n has no version 2.0.2 available.