diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/webpacker/webpack_runner.rb b/lib/webpacker/webpack_runner.rb index abc1234..def5678 100644 --- a/lib/webpacker/webpack_runner.rb +++ b/lib/webpacker/webpack_runner.rb @@ -28,7 +28,6 @@ if @argv.delete "--debug-webpacker" cmd = ["node", "--inspect-brk"] + cmd - @argv.delete "--debug-webpacker" end if @argv.delete "--trace-deprecation"
Remove unnecessary call to @argv.delete
diff --git a/rails_script.gemspec b/rails_script.gemspec index abc1234..def5678 100644 --- a/rails_script.gemspec +++ b/rails_script.gemspec @@ -4,7 +4,7 @@ require 'rails_script/version' Gem::Specification.new do |spec| - spec.name = 'rails_script' + spec.name = 'rails-script' spec.version = RailsScript::VERSION spec.authors = ['Kevin Pheasey'] spec.email = ['kevin.pheasey@gmail.com']
Use the more standard dash instead of underscore in name
diff --git a/spec/minitest/sequel_spec.rb b/spec/minitest/sequel_spec.rb index abc1234..def5678 100644 --- a/spec/minitest/sequel_spec.rb +++ b/spec/minitest/sequel_spec.rb @@ -1,7 +1,23 @@ require 'spec_helper' -class Minitest::SequelTest < Minitest::Test - def test_that_it_has_a_version_number +module Minitest::Assertions + + # + def assert_returns_error(expected_msg, klass=Minitest::Assertion, &blk) + e = assert_raises(klass) do + yield + end + assert_equal expected_msg, e.message + end + + # + def assert_no_error(&blk) + e = assert_silent do + yield + end + end + +end refute_nil ::Minitest::Sequel::VERSION end
Add basic Minitest assertions to tets assertions Amazingly these seems to work well!
diff --git a/spec/models/contract_spec.rb b/spec/models/contract_spec.rb index abc1234..def5678 100644 --- a/spec/models/contract_spec.rb +++ b/spec/models/contract_spec.rb @@ -3,53 +3,45 @@ describe Contract do let!(:contract) { Contract.create id: 1, can_id: '123' } - context 'description starts with no caps "westconnex - "' do - before :each do - contract.update description: 'westconnex - Foo Service' + describe '#display_description' do + context 'description starts with no caps "westconnex - "' do + before :each do + contract.update description: 'westconnex - Foo Service' + end + + it { expect(contract.display_description).to eq 'Foo Service' } end - it '#display_description' do - expect(contract.display_description).to eq 'Foo Service' - end - end + context 'description starts with capticalised "WestConnex - "' do + before :each do + contract.update description: 'WestConnex - Foo Service' + end - context 'description starts with capticalised "WestConnex - "' do - before :each do - contract.update description: 'WestConnex - Foo Service' + it { expect(contract.display_description).to eq 'Foo Service' } end - it '#display_description' do - expect(contract.display_description).to eq 'Foo Service' - end - end + context 'description starts with "WDA - "' do + before :each do + contract.update description: 'WDA - Foo Service' + end - context 'description starts with "WDA - "' do - before :each do - contract.update description: 'WDA - Foo Service' + it { expect(contract.display_description).to eq 'Foo Service' } end - it '#display_description' do - expect(contract.display_description).to eq 'Foo Service' - end - end + context 'description contains but doesnt start with "WestConnex - "' do + before :each do + contract.update description: 'Foo Service WestConnex - ' + end - context 'description contains but doesnt start with "WestConnex - "' do - before :each do - contract.update description: 'Foo Service WestConnex - ' + it { expect(contract.display_description).to eq 'Foo Service WestConnex - ' } end - it '#display_description' do - expect(contract.display_description).to eq 'Foo Service WestConnex - ' - end - end + context 'description does not contain "WestConnex - " or "WDA - "' do + before :each do + contract.update description: 'Foo Service' + end - context 'description does not contain "WestConnex - " or "WDA - "' do - before :each do - contract.update description: 'Foo Service' - end - - it '#display_description' do - expect(contract.display_description).to eq 'Foo Service' + it { expect(contract.display_description).to eq 'Foo Service' } end end end
Use wrapping describe block to simplify tests (refactor only)
diff --git a/spec/models/spam_log_spec.rb b/spec/models/spam_log_spec.rb index abc1234..def5678 100644 --- a/spec/models/spam_log_spec.rb +++ b/spec/models/spam_log_spec.rb @@ -0,0 +1,11 @@+require 'spec_helper' + +describe SpamLog, models: true do + describe 'associations' do + it { is_expected.to belong_to(:user) } + end + + describe 'validations' do + it { is_expected.to validate_presence_of(:user) } + end +end
Add model spec for SpamLog
diff --git a/reclame_aqui.gemspec b/reclame_aqui.gemspec index abc1234..def5678 100644 --- a/reclame_aqui.gemspec +++ b/reclame_aqui.gemspec @@ -13,6 +13,7 @@ spec.description = 'A gem that verify the reputation of a company on ReclameAqui.' spec.homepage = 'https://github.com/givigier/reclame_aqui' spec.license = 'MIT' + spec.required_ruby_version = Gem::Requirement.new('>= 2.3') spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
Add ruby 2.3 as required version
diff --git a/figaro.gemspec b/figaro.gemspec index abc1234..def5678 100644 --- a/figaro.gemspec +++ b/figaro.gemspec @@ -11,10 +11,10 @@ gem.homepage = "https://github.com/laserlemon/figaro" gem.license = "MIT" - gem.add_dependency "bundler", "~> 1.0" gem.add_dependency "rails", ">= 3", "< 5" gem.add_dependency "thor", "~> 0.14" + gem.add_development_dependency "bundler", "~> 1.5" gem.add_development_dependency "rake", "~> 10.1" gem.files = `git ls-files`.split($\)
Remove the runtime dependency on Bundler
diff --git a/services/importer/spec/acceptance/cdb_importer_context.rb b/services/importer/spec/acceptance/cdb_importer_context.rb index abc1234..def5678 100644 --- a/services/importer/spec/acceptance/cdb_importer_context.rb +++ b/services/importer/spec/acceptance/cdb_importer_context.rb @@ -7,6 +7,9 @@ @db = pg_connection.connection @pg_options = pg_connection.pg_options @db.execute('CREATE SCHEMA IF NOT EXISTS cdb_importer') + + @db.execute('CREATE EXTENSION IF NOT EXISTS postgis') + @db.execute('CREATE EXTENSION IF NOT EXISTS postgis_topology') end after(:each) do
Install postgis and postgis_topology if they don't exist (in a cleaner way)
diff --git a/app/models/lot.rb b/app/models/lot.rb index abc1234..def5678 100644 --- a/app/models/lot.rb +++ b/app/models/lot.rb @@ -15,6 +15,6 @@ belongs_to :street def number_and_street - "#{self.number} #{self.street.name}" + "#{number} #{street.name}" end end
Remove redunant reference to self.
diff --git a/spec/itamae/plugin/resource/encrypted_remote_file_spec.rb b/spec/itamae/plugin/resource/encrypted_remote_file_spec.rb index abc1234..def5678 100644 --- a/spec/itamae/plugin/resource/encrypted_remote_file_spec.rb +++ b/spec/itamae/plugin/resource/encrypted_remote_file_spec.rb @@ -20,7 +20,7 @@ subject { resource.pre_action } it "should create decrypted file" do - expect(resource).to receive(:send_file) do |src, dst| + expect(resource).to receive_message_chain(:backend, :send_file) do |src, dst| expect(dst).to be_an_instance_of(String) expect(src).to be_an_instance_of(String)
Fix test failed : itamae 1.2.13 -> 1.2.14
diff --git a/lib/childprocess/jruby/process.rb b/lib/childprocess/jruby/process.rb index abc1234..def5678 100644 --- a/lib/childprocess/jruby/process.rb +++ b/lib/childprocess/jruby/process.rb @@ -30,13 +30,18 @@ private - def launch_process + def launch_process(&blk) pb = java.lang.ProcessBuilder.new(@args) env = pb.environment ENV.each { |k,v| env.put(k, v) } @process = pb.start + + if block_given? + blk.call(@process.getOutputStream.to_io) + end + setup_io end
Handle writing to stdin with JRuby.
diff --git a/lib/hanoi.rb b/lib/hanoi.rb index abc1234..def5678 100644 --- a/lib/hanoi.rb +++ b/lib/hanoi.rb @@ -7,4 +7,7 @@ [1, 2, 3] end end + + class Tower + end end
Test update now fails correctly
diff --git a/lib/frepl.rb b/lib/frepl.rb index abc1234..def5678 100644 --- a/lib/frepl.rb +++ b/lib/frepl.rb @@ -22,7 +22,7 @@ def initialize Frepl.compiler = 'gfortran' - Frepl.debug = true + Frepl.debug = false @classifier = Classifier.new @file = FortranFile.new @lines = []
Debug mode is off by default.
diff --git a/spec/classes/mod/wsgi_spec.rb b/spec/classes/mod/wsgi_spec.rb index abc1234..def5678 100644 --- a/spec/classes/mod/wsgi_spec.rb +++ b/spec/classes/mod/wsgi_spec.rb @@ -25,5 +25,12 @@ it { should include_class("apache::params") } it { should contain_apache__mod('wsgi') } it { should contain_package("mod_wsgi") } + + describe "with custom WSGISocketPrefix" do + let :params do + { :wsgi_socket_prefix => 'run/wsgi' } + end + it {should contain_file('wsgi.conf').with_content(/^ WSGISocketPrefix run\/wsgi$/)} + end end end
Add spec test for custom WSGISocketPrefix
diff --git a/db/migrate/20160531042449_remove_sub_splits.rb b/db/migrate/20160531042449_remove_sub_splits.rb index abc1234..def5678 100644 --- a/db/migrate/20160531042449_remove_sub_splits.rb +++ b/db/migrate/20160531042449_remove_sub_splits.rb @@ -1,7 +1,6 @@ class RemoveSubSplits < ActiveRecord::Migration def self.up - remove_foreign_key :split_times, :sub_split drop_table :sub_splits rename_column :split_times, :sub_split_id, :sub_split_key end
Delete foreign key remove command from remove_sub_splits migration (allows heroku to remove the table despite its not having a foreign key)
diff --git a/spec/support/child_benefit.rb b/spec/support/child_benefit.rb index abc1234..def5678 100644 --- a/spec/support/child_benefit.rb +++ b/spec/support/child_benefit.rb @@ -1,7 +1,7 @@ RSpec::Matchers::define :contain_child_benefit_value do |text| match do |page| within ".results" do - within :xpath, ".//div[contains(@class, 'results_estimate')][.//h2[.='Child Benefit received']]" do + within :xpath, ".//div[contains(@class, 'results_estimate')][.//h3[.='Child Benefit received']]" do page.should have_content(text) end end
Correct matcher to search for h3 rather than h2
diff --git a/lib/docs/scrapers/phalcon.rb b/lib/docs/scrapers/phalcon.rb index abc1234..def5678 100644 --- a/lib/docs/scrapers/phalcon.rb +++ b/lib/docs/scrapers/phalcon.rb @@ -1,8 +1,6 @@ module Docs class Phalcon < UrlScraper self.type = 'phalcon' - self.release = '3.0.0' - self.base_url = 'https://docs.phalconphp.com/en/latest/' self.root_path = 'index.html' self.links = { home: 'https://phalconphp.com/', @@ -21,5 +19,15 @@ &copy; 2011&ndash;2016 Phalcon Framework Team<br> Licensed under the Creative Commons Attribution License 3.0. HTML + + version '3' do + self.release = '3.0.1' + self.base_url = 'https://docs.phalconphp.com/en/latest/' + end + + version '2' do + self.release = '2.0.13' + self.base_url = 'https://docs.phalconphp.com/en/2.0.0/' + end end end
Update Phalcon documentation (3.0.1, 2.0.13)
diff --git a/app/models/cocoa_pod.rb b/app/models/cocoa_pod.rb index abc1234..def5678 100644 --- a/app/models/cocoa_pod.rb +++ b/app/models/cocoa_pod.rb @@ -13,9 +13,9 @@ def serializable_hash h = super - h['pushed_at'] = h['pushed_at'].to_s - h['created_at'] = h['created_at'].to_s - h['updated_at'] = h['updated_at'].to_s + h['pushed_at'] = h['pushed_at'].to_i + h['created_at'] = h['created_at'].to_i + h['updated_at'] = h['updated_at'].to_i h end end
Clean serializable hash for cocoa pod.
diff --git a/app/models/lab_group.rb b/app/models/lab_group.rb index abc1234..def5678 100644 --- a/app/models/lab_group.rb +++ b/app/models/lab_group.rb @@ -2,4 +2,5 @@ has_and_belongs_to_many :registered_courses has_many :labs, through: :lab_has_group has_many :submissions, through: :lab_has_group + accepts_nested_attributes_for :lab_has_groups end
Add nested attributes for labhasgroups
diff --git a/app/normalizers/base.rb b/app/normalizers/base.rb index abc1234..def5678 100644 --- a/app/normalizers/base.rb +++ b/app/normalizers/base.rb @@ -44,8 +44,10 @@ [] end + SEPARATOR = ' - '.freeze + def separator - ' - ' + SEPARATOR end def valid?
Replace string literal with a frozen constant To prevent new objects spawning.
diff --git a/app/tasks/fetch_feed.rb b/app/tasks/fetch_feed.rb index abc1234..def5678 100644 --- a/app/tasks/fetch_feed.rb +++ b/app/tasks/fetch_feed.rb @@ -21,10 +21,10 @@ new_entries_from(raw_feed).each do |entry| StoryRepository.add(entry, @feed) end + + FeedRepository.update_last_fetched(@feed, raw_feed.last_modified) + FeedRepository.set_status(:green, @feed) end - - FeedRepository.update_last_fetched(@feed, raw_feed.last_modified) - FeedRepository.set_status(:green, @feed) rescue Exception => ex FeedRepository.set_status(:red, @feed)
Revert "Obviously we should update last_fetched when nothing has changed" This reverts commit 25a603083cf613ace7bcb327bb4656ac113a8093. Actually we do not want this. We should only update that timestamp to what we get back from the feed.
diff --git a/bin/check_smtp.rb b/bin/check_smtp.rb index abc1234..def5678 100644 --- a/bin/check_smtp.rb +++ b/bin/check_smtp.rb @@ -11,7 +11,5 @@ ::CryptCheck::Tls::Smtp.analyze_file file, "output/#{name}.html" else ::CryptCheck::Logger.level = ENV['LOG'] || :info - ::CryptCheck::Tls::Smtp.analyze ARGV[0] + ::CryptCheck::Tls::Smtp.analyze_domain ARGV[0] end - -
Check for MX and not directly the IP for SMTP
diff --git a/amazon-drs.gemspec b/amazon-drs.gemspec index abc1234..def5678 100644 --- a/amazon-drs.gemspec +++ b/amazon-drs.gemspec @@ -4,10 +4,10 @@ require 'amazon-drs/version' Gem::Specification.new do |spec| - spec.name = "amazon-drs" + spec.name = 'amazon-drs' spec.version = AmazonDrs::VERSION - spec.authors = ["Code Ass"] - spec.email = ["aycabta@gmail.com"] + spec.authors = ['Code Ass'] + spec.email = ['aycabta@gmail.com'] spec.summary = %q{amazon-drs is for Amazon Dash Replenishment Service} spec.description = %Q{amazon-drs is for Amazon Dash Replenishment Service.\nYou can use this after authorized by Login with Amazon.\n}
Use single quote in .gemspec
diff --git a/amf_socket.gemspec b/amf_socket.gemspec index abc1234..def5678 100644 --- a/amf_socket.gemspec +++ b/amf_socket.gemspec @@ -4,7 +4,7 @@ Gem::Specification.new do |gem| gem.authors = ["Chad Remesch"] gem.email = ["chad@remesch.com"] - gem.description = %q{Ruby implementation of AMF Socket} + gem.description = %q{Ruby implementation of AMF Socket (https://github.com/chadrem/amf_socket)} gem.summary = %q{AMF Socket is a bi-directional RPC system for Adobe Flash (Actionscript) programs.} gem.homepage = ""
Add amf socket url to gemspec
diff --git a/lib/integrity.rb b/lib/integrity.rb index abc1234..def5678 100644 --- a/lib/integrity.rb +++ b/lib/integrity.rb @@ -17,7 +17,7 @@ DataMapper.setup(:default, config[:database_uri]) end - autoload :Models, 'models' + autoload :Project, 'project' autoload :Builder, 'builder' autoload :SCM, 'scm'
Fix autoload for Project, instead of Models
diff --git a/lib/io_actors.rb b/lib/io_actors.rb index abc1234..def5678 100644 --- a/lib/io_actors.rb +++ b/lib/io_actors.rb @@ -1,6 +1,6 @@ require "io_actors/version" -require 'concurrent' +require 'concurrent/actor' module IOActors SelectMessage = Struct.new(:actor)
Reduce the code dependency to just the actors code
diff --git a/lib/ruby-rets.rb b/lib/ruby-rets.rb index abc1234..def5678 100644 --- a/lib/ruby-rets.rb +++ b/lib/ruby-rets.rb @@ -1,3 +1,4 @@+require "rets/version" require "rets/exceptions" require "rets/client" require "rets/http"
Make sure we load rets/version.rb
diff --git a/lib/stoplight.rb b/lib/stoplight.rb index abc1234..def5678 100644 --- a/lib/stoplight.rb +++ b/lib/stoplight.rb @@ -11,33 +11,6 @@ module Stoplight VERSION = Gem::Version.new('0.0.0') - - module_function - - def data_store(data_store = nil) - @data_store = data_store if data_store - @data_store = DataStore::Memory.new unless defined?(@data_store) - @data_store - end - - def green?(name) - case data_store.state(name) - when DataStore::STATE_LOCKED_GREEN - true - when DataStore::STATE_LOCKED_RED - false - else - data_store.failures(name).size < threshold(name) - end - end - - def red?(name) - !green?(name) - end - - def threshold(name) - data_store.failure_threshold(name) || Light::DEFAULT_FAILURE_THRESHOLD - end class << self extend Forwardable @@ -53,5 +26,30 @@ set_state state ) + + def data_store(data_store = nil) + @data_store = data_store if data_store + @data_store = DataStore::Memory.new unless defined?(@data_store) + @data_store + end + + def green?(name) + case data_store.state(name) + when DataStore::STATE_LOCKED_GREEN + true + when DataStore::STATE_LOCKED_RED + false + else + data_store.failures(name).size < threshold(name) + end + end + + def red?(name) + !green?(name) + end + + def threshold(name) + data_store.failure_threshold(name) || Light::DEFAULT_FAILURE_THRESHOLD + end end end
Define module functions in class block
diff --git a/test/ubuntu12.rb b/test/ubuntu12.rb index abc1234..def5678 100644 --- a/test/ubuntu12.rb +++ b/test/ubuntu12.rb @@ -1,4 +1,7 @@ # Use a Linux image vagrant_box 'precise64' do - url 'http://files.vagrantup.com/precise64.box' + url 'http://files.vagrantup.com/precise64.box' + provisioner_options 'vagrant_config' => <<EOM + config.vm.synced_folder "../../..", "/mnt/host_src" +EOM end
Use vagrant mounting to install metal and metal-lxc from the host
diff --git a/Treasure.podspec b/Treasure.podspec index abc1234..def5678 100644 --- a/Treasure.podspec +++ b/Treasure.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Treasure' - s.version = '0.1.6' + s.version = '0.1.7' s.summary = 'A small set of tools for deserializing JSON API objects.' s.description = <<-DESC @@ -13,9 +13,9 @@ s.source = { :git => 'https://github.com/fishermenlabs/Treasure.git', :tag => s.version.to_s } s.ios.deployment_target = '8.0' - s.osx.deployment_target = "10.10" - s.tvos.deployment_target = "9.0" - s.watchos.deployment_target = "2.0" + s.osx.deployment_target = '10.10' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '2.0' s.source_files = 'Treasure/Classes/**/*' s.dependency 'ModelMapper', '~> 8.0.0'
Increase version number to 0.1.7
diff --git a/lib/everypolitician/popolo/collection.rb b/lib/everypolitician/popolo/collection.rb index abc1234..def5678 100644 --- a/lib/everypolitician/popolo/collection.rb +++ b/lib/everypolitician/popolo/collection.rb @@ -24,9 +24,7 @@ def where(attributes = {}) find_all do |object| - !attributes.collect do |k,v| - object.send(k) == v - end.include?(false) + attributes.all? { |k, v| object.send(k) == v } end end
Make method much simpler and readable
diff --git a/lib/arabic_conjugator/form.rb b/lib/arabic_conjugator/form.rb index abc1234..def5678 100644 --- a/lib/arabic_conjugator/form.rb +++ b/lib/arabic_conjugator/form.rb @@ -1,8 +1,3 @@-# encoding: utf-8 - -PAST_AFFIXES = { :I => "ت", :you_m => "ت", :you_f => "ت", :she => "ت" , :he =>'', :we => "نا", :you_pl => "تم", :they => "وا" } -PRESENT_AFFIXES = { :I => ["أ", ''], :you_m => ["ت", ''], :you_f => ["ت", "ين"], :he => ["ي", ""], :she => ["ت", ""], :we => ["ن", ''], :you_pl => ["ت", "ون"], :they => ["ي", "ون"] } - class Form attr_reader :base, :root1, :root2, :root3
Remove Affixes from Form class
diff --git a/lib/auto_set/active_record.rb b/lib/auto_set/active_record.rb index abc1234..def5678 100644 --- a/lib/auto_set/active_record.rb +++ b/lib/auto_set/active_record.rb @@ -1,15 +1,6 @@ module AutoSet module ActiveRecord extend ActiveSupport::Concern - - private - - def auto_set_parent_by_code(column, code) - if self.send(code).present? - reflection = self.class.reflections[column.to_s] - reflection.klass.where(code: self.send(code)).first if reflection.present? - end - end module ClassMethods def auto_set(column, parents, options = {})
Remove code that has been moved.
diff --git a/lib/droplr/errors/droplr_error.rb b/lib/droplr/errors/droplr_error.rb index abc1234..def5678 100644 --- a/lib/droplr/errors/droplr_error.rb +++ b/lib/droplr/errors/droplr_error.rb @@ -1,12 +1,13 @@ module Droplr class DroplrError < StandardError - attr_reader :message, :error_code, :http_status, :json_body + attr_reader :message, :error_code, :http_status, :json_body, :additional_info - def initialize(message = nil, error_code = nil, http_status = nil) - @message = message - @error_code = error_code - @http_status = http_status - @json_body = build_json_body + def initialize(message = nil, error_code = nil, http_status = nil, additional_info = nil) + @message = message + @error_code = error_code + @http_status = http_status + @json_body = build_json_body + @additional_info = additional_info end def to_s
Allow for additional info in an error message. This gives us the ability to pass back a theme when receiving a password-required error.
diff --git a/core/lib/generators/refinery/form/templates/spec/requests/refinery/plural_name/plural_name_requests_spec.rb b/core/lib/generators/refinery/form/templates/spec/requests/refinery/plural_name/plural_name_requests_spec.rb index abc1234..def5678 100644 --- a/core/lib/generators/refinery/form/templates/spec/requests/refinery/plural_name/plural_name_requests_spec.rb +++ b/core/lib/generators/refinery/form/templates/spec/requests/refinery/plural_name/plural_name_requests_spec.rb @@ -3,9 +3,11 @@ module Refinery module <%= namespacing %> - Refinery::<%= namespacing %>::Engine::load_seed + describe "<%= namespacing %> request specs" do - describe "<%= namespacing %> request specs" do + before(:each) do + Refinery::<%= namespacing %>::Engine.load_seed + end it "successfully gets the index path as redirection" do get("/<%= plural_name %>")
Call load_seed on every request spec - this was causing an intermittent test failure
diff --git a/lib/hookie/plugins/base_plugin.rb b/lib/hookie/plugins/base_plugin.rb index abc1234..def5678 100644 --- a/lib/hookie/plugins/base_plugin.rb +++ b/lib/hookie/plugins/base_plugin.rb @@ -5,7 +5,7 @@ @config = {} @framework.config.map do |k,v| - if k.start_with?("hooks.#{self.config_key}") + if k.start_with?("hookie.#{self.config_key}") @config[k.split(".")[2..-1].join("_").to_sym] = v end end
Change config key base read into plugin
diff --git a/lib/languages/norsk/past_tense.rb b/lib/languages/norsk/past_tense.rb index abc1234..def5678 100644 --- a/lib/languages/norsk/past_tense.rb +++ b/lib/languages/norsk/past_tense.rb @@ -0,0 +1,9 @@+# encoding: UTF-8 + +class NorskPastTense < NorskTense + @keys = "past", "fortid" + + def self.specific_conjugation(verb) + "STUB - CONJUGATION RULES NEEDED" + end + end
Add a stub past tense class. Needs conjugation rules, but will ensure we pass some of the failing tenses (for tense lists, etc.)
diff --git a/lib/modular/mst_rendering.rb b/lib/modular/mst_rendering.rb index abc1234..def5678 100644 --- a/lib/modular/mst_rendering.rb +++ b/lib/modular/mst_rendering.rb @@ -1,10 +1,12 @@ module Modular + class Template < ::Mustache + end + module MstRendering def render - path = Rails.root + "app/views/components/#{type}.mst" - template = File.open(path, "rb").read - - Mustache.render(template, @attributes).html_safe + Template.template_path = Rails.root + "app/views/components" + Template.template_extension = 'mst' + Template.render_file("./#{type}", @attributes).html_safe end end end
Rewrite some mustache-specific code to make contextual includes work
diff --git a/lib/quick_travel/resource.rb b/lib/quick_travel/resource.rb index abc1234..def5678 100644 --- a/lib/quick_travel/resource.rb +++ b/lib/quick_travel/resource.rb @@ -15,17 +15,6 @@ QuickTravel::ProductType.find(product_type_id) end - # this method is also duplicated in accommodation class. because now its room facilities are now also available in property show api call - def room_facilities - if @_room_facilities.blank? - @_room_facilities = [] - @room_facilities.each do |item| - @_room_facilities << RoomFacility.new(item['room_facility']) - end - end - @_room_facilities - end - def bed_requirements @_bed_requirements ||= Array.wrap(@bed_requirements).map do |bed_requirement| BedRequirement.new(bed_requirement)
Remove unused method (this is done in setter in accommodation.rb)
diff --git a/lib/rembrandt/highlighter.rb b/lib/rembrandt/highlighter.rb index abc1234..def5678 100644 --- a/lib/rembrandt/highlighter.rb +++ b/lib/rembrandt/highlighter.rb @@ -1,4 +1,4 @@-require './lib/rembrandt/engines/pygmentize' +require_relative 'engines/pygmentize' module Rembrandt class Highlighter
Fix relative path when used in other apps
diff --git a/tidy_ffi.gemspec b/tidy_ffi.gemspec index abc1234..def5678 100644 --- a/tidy_ffi.gemspec +++ b/tidy_ffi.gemspec @@ -18,5 +18,5 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency 'ffi', "~> 1.2.0" + s.add_dependency 'ffi', "~> 1.2" end
Allow wider range of FFI dependency The latest version of FFI for ruby 1.8.3 series is 1.9.6 (tests still pass using this newer FFI version).. This doesn't change anything for existing installs but will allow wider compatibility.
diff --git a/lib/upstream/tracker/init.rb b/lib/upstream/tracker/init.rb index abc1234..def5678 100644 --- a/lib/upstream/tracker/init.rb +++ b/lib/upstream/tracker/init.rb @@ -45,6 +45,7 @@ File.open(path, "w+") do |file| file.puts(html[:data]) end + html end end
Return html data and charset as hash
diff --git a/lib/podio/models/item_diff.rb b/lib/podio/models/item_diff.rb index abc1234..def5678 100644 --- a/lib/podio/models/item_diff.rb +++ b/lib/podio/models/item_diff.rb @@ -4,6 +4,7 @@ property :type, :string property :external_id, :string property :label, :string + property :config, :hash property :from, :array property :to, :array
Add config to item diff model
diff --git a/spec/nio/selector_spec.rb b/spec/nio/selector_spec.rb index abc1234..def5678 100644 --- a/spec/nio/selector_spec.rb +++ b/spec/nio/selector_spec.rb @@ -8,18 +8,44 @@ monitor.should be_a NIO::Monitor end - it "selects objects for readiness" do - unready_pipe, _ = IO.pipe - ready_pipe, ready_writer = IO.pipe + context "IO object support" do + context "pipes" do + it "selects for read readiness" do + unready_pipe, _ = IO.pipe + ready_pipe, ready_writer = IO.pipe - # Give ready_pipe some data so it's ready - ready_writer << "hi there" + # Give ready_pipe some data so it's ready + ready_writer << "hi there" - unready_monitor = subject.register(unready_pipe, :r) - ready_monitor = subject.register(ready_pipe, :r) + unready_monitor = subject.register(unready_pipe, :r) + ready_monitor = subject.register(ready_pipe, :r) - ready_monitors = subject.select - ready_monitors.should include ready_monitor - ready_monitors.should_not include unready_monitor + ready_monitors = subject.select + ready_monitors.should include ready_monitor + ready_monitors.should_not include unready_monitor + end + end + + context "TCPSockets" do + it "selects for read readiness" do + port = 12345 + server = TCPServer.new("localhost", port) + + ready_socket = TCPSocket.open("localhost", port) + ready_writer = server.accept + + # Give ready_socket some data so it's ready + ready_writer << "hi there" + + unready_socket = TCPSocket.open("localhost", port) + + unready_monitor = subject.register(unready_socket, :r) + ready_monitor = subject.register(ready_socket, :r) + + ready_monitors = subject.select + ready_monitors.should include ready_monitor + ready_monitors.should_not include unready_monitor + end + end end end
Break apart specs for different types of IO objects
diff --git a/app/models/stop.rb b/app/models/stop.rb index abc1234..def5678 100644 --- a/app/models/stop.rb +++ b/app/models/stop.rb @@ -22,7 +22,7 @@ end def self.near(location) - Stop.geo_near(location).max_distance(0.00098) + Stop.geo_near(location).max_distance(0.01) end end
Adjust radius for near method
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,8 +11,8 @@ has_many :active_friends, -> { where(friendships: { approved: true }) }, through: :friendships, source: :friend has_many :passive_friends, -> { where(friendships: { approved: true }) }, through: :passive_friendships, source: :user - has_many :pending_friends, -> { where(friendships: { approved: false }) }, through: :friendships, source: :friend - has_many :pending_requests, -> { where(friendships: { approved: false }) }, through: :passive_friendships, source: :user + has_many :outgoing_requests, -> { where(friendships: { approved: false }) }, through: :friendships, source: :friend + has_many :incoming_requests, -> { where(friendships: { approved: false }) }, through: :passive_friendships, source: :user def friends active_friends | passive_friends
Rename association names to make it more clear
diff --git a/plugin.rb b/plugin.rb index abc1234..def5678 100644 --- a/plugin.rb +++ b/plugin.rb @@ -22,6 +22,7 @@ class DiscourseTranslator::TranslatorController < ::ApplicationController def translate raise PluginDisabled if !SiteSetting.translator_enabled + RateLimiter.new(current_user, "translate_post", 3, 1.minute).performed! unless current_user.staff? params.require(:post_id) post = Post.find(params[:post_id].to_i)
Add rate limiter for translation.
diff --git a/rails/init.rb b/rails/init.rb index abc1234..def5678 100644 --- a/rails/init.rb +++ b/rails/init.rb @@ -1,6 +1,6 @@ require File.join(File.dirname(__FILE__), *%w{ .. lib geos_extensions }) -require File.join(File.dirname(__FILE__), *%w{ .. lib active_record_extensions connection_adapters postgresql_adapter }) -require File.join(File.dirname(__FILE__), *%w{ .. lib active_record_extensions geometry_columns }) -require File.join(File.dirname(__FILE__), *%w{ .. lib active_record_extensions geospatial_scopes }) +require File.join(GEOS_EXTENSIONS_BASE, *%w{ .. lib active_record_extensions connection_adapters postgresql_adapter }) +require File.join(GEOS_EXTENSIONS_BASE, *%w{ .. lib active_record_extensions geometry_columns }) +require File.join(GEOS_EXTENSIONS_BASE, *%w{ .. lib active_record_extensions geospatial_scopes })
Use constant to pull in files.
diff --git a/spec/unit/printer_spec.rb b/spec/unit/printer_spec.rb index abc1234..def5678 100644 --- a/spec/unit/printer_spec.rb +++ b/spec/unit/printer_spec.rb @@ -11,4 +11,11 @@ cmd = TTY::Command.new(printer: :progress) expect(cmd.printer).to be_an_instance_of(TTY::Command::Printers::Progress) end + + it "uses printer based on class name" do + output = StringIO.new + printer = TTY::Command::Printers::Pretty + cmd = TTY::Command.new(output: output, printer: printer) + expect(cmd.printer).to be_an_instance_of(TTY::Command::Printers::Pretty) + end end
Test passing printer class name.
diff --git a/activerecord/test/cases/adapters/postgresql/case_insensitive_test.rb b/activerecord/test/cases/adapters/postgresql/case_insensitive_test.rb index abc1234..def5678 100644 --- a/activerecord/test/cases/adapters/postgresql/case_insensitive_test.rb +++ b/activerecord/test/cases/adapters/postgresql/case_insensitive_test.rb @@ -9,18 +9,18 @@ column = Default.columns_hash["char1"] comparison = connection.case_insensitive_comparison table, :char1, column, nil - assert_match /lower/i, comparison.to_sql + assert_match(/lower/i, comparison.to_sql) column = Default.columns_hash["char2"] comparison = connection.case_insensitive_comparison table, :char2, column, nil - assert_match /lower/i, comparison.to_sql + assert_match(/lower/i, comparison.to_sql) column = Default.columns_hash["char3"] comparison = connection.case_insensitive_comparison table, :char3, column, nil - assert_match /lower/i, comparison.to_sql + assert_match(/lower/i, comparison.to_sql) column = Default.columns_hash["multiline_default"] comparison = connection.case_insensitive_comparison table, :multiline_default, column, nil - assert_match /lower/i, comparison.to_sql + assert_match(/lower/i, comparison.to_sql) end end
Fix `warning: ambiguous first argument` ``` test/cases/adapters/postgresql/case_insensitive_test.rb:12: warning: ambiguous first argument; put parentheses or a space even after `/' operator test/cases/adapters/postgresql/case_insensitive_test.rb:16: warning: ambiguous first argument; put parentheses or a space even after `/' operator test/cases/adapters/postgresql/case_insensitive_test.rb:20: warning: ambiguous first argument; put parentheses or a space even after `/' operator test/cases/adapters/postgresql/case_insensitive_test.rb:24: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
diff --git a/tests/hp/requests/compute/security_group_rule_tests.rb b/tests/hp/requests/compute/security_group_rule_tests.rb index abc1234..def5678 100644 --- a/tests/hp/requests/compute/security_group_rule_tests.rb +++ b/tests/hp/requests/compute/security_group_rule_tests.rb @@ -0,0 +1,54 @@+Shindo.tests('Fog::Compute[:hp] | security group requests', ['hp']) do + + @security_group_rule_format = { + 'from_port' => Integer, + 'group' => Fog::Nullable::Hash, + 'ip_protocol' => String, + 'to_port' => Integer, + 'parent_group_id' => Integer, + 'ip_range' => { + 'cidr' => String + }, + 'id' => Integer + } + + tests('success') do + @security_group = Fog::Compute[:hp].security_groups.create(:name => 'fog_security_group', :description => 'tests group') + + tests("tcp #create_security_group_rule('#{@security_group.id}', 'tcp', '80', '80', '0.0.0.0/0'}')").formats({'security_group_rule' => @security_group_rule_format}) do + data = Fog::Compute[:hp].create_security_group_rule(@security_group.id, 'tcp', '80', '80', '0.0.0.0/0').body + @sec_group_rule_id_1 = data['security_group_rule']['id'] + data + end + + tests("icmp #create_security_group_rule('#{@security_group.id}', 'icmp', '-1', '-1', '0.0.0.0/0'}')").formats({'security_group_rule' => @security_group_rule_format}) do + data = Fog::Compute[:hp].create_security_group_rule(@security_group.id, 'icmp', '-1', '-1', '0.0.0.0/0').body + @sec_group_rule_id_2 = data['security_group_rule']['id'] + data + end + + tests("tcp #delete_security_group_rule('#{@sec_group_rule_id_1}')").succeeds do + Fog::Compute[:hp].delete_security_group_rule(@sec_group_rule_id_1).body + end + + tests("icmp #delete_security_group_rule('#{@sec_group_rule_id_2}')").succeeds do + Fog::Compute[:hp].delete_security_group_rule(@sec_group_rule_id_2).body + end + + @security_group.destroy + + end + + tests('failure') do + + tests("#create_security_group_rule(0, 'tcp', '80', '80', '0.0.0.0/0'}')").raises(Fog::Compute::HP::NotFound) do + Fog::Compute[:hp].create_security_group_rule(0, 'tcp', '80', '80', '0.0.0.0/0') + end + + tests("#delete_security_group_rule(0)").raises(Fog::Compute::HP::NotFound) do + Fog::Compute[:hp].delete_security_group_rule(0) + end + + end + +end
Add tests for security group rules.
diff --git a/roles/web-backend.rb b/roles/web-backend.rb index abc1234..def5678 100644 --- a/roles/web-backend.rb +++ b/roles/web-backend.rb @@ -7,6 +7,9 @@ :worker => { :max_requests_per_child => 10000 } + }, + :apt => { + :sources => ["openstreetmap-cgimap"] }, :logstash => { :forwarder => {
Add cgimap PPA repo on backends.
diff --git a/mtif.gemspec b/mtif.gemspec index abc1234..def5678 100644 --- a/mtif.gemspec +++ b/mtif.gemspec @@ -21,4 +21,5 @@ spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec" + spec.add_development_dependency "simplecov" end
Add coverage to guide testing
diff --git a/app/controllers/storytime/subscriptions_controller.rb b/app/controllers/storytime/subscriptions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/storytime/subscriptions_controller.rb +++ b/app/controllers/storytime/subscriptions_controller.rb @@ -5,8 +5,9 @@ before_action :set_subscription, only: [:destroy] def create - @subscription = Storytime::Subscription.new(permitted_attributes) - + @subscription = Storytime::Subscription.find_by(permitted_attributes) || Storytime::Subscription.new(permitted_attributes) + @subscription.subscribed = true if @subscription.subscribed == false + if @subscription.save flash[:notice] = I18n.t('flash.subscriptions.create.success') else
Allow an usubscribed user to resubscribe
diff --git a/app/decorators/container_service_decorator.rb b/app/decorators/container_service_decorator.rb index abc1234..def5678 100644 --- a/app/decorators/container_service_decorator.rb +++ b/app/decorators/container_service_decorator.rb @@ -5,7 +5,7 @@ def single_quad { - :fileicon => fileicon + :fonticon => fonticon } end end
Fix missing single_quad for container services
diff --git a/features/step_definitions/authentication_steps.rb b/features/step_definitions/authentication_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/authentication_steps.rb +++ b/features/step_definitions/authentication_steps.rb @@ -1,3 +1,19 @@ Given /^I am registered$/ do @registered_user = Factory(:user, :email => "john@doe.com") end + +Given /^I am admin$/ do + @registered_user.make_admin +end + +Given /^I am logged in as admin$/ do + steps %Q{ + Given I am registered + And I am admin + And I am on the homepage + When I follow "Sign in" + And I fill in "Email" with "john@doe.com" + And I fill in "Password" with "password" + And I press "Sign in" + } +end
Add 'I am admin' & 'I am logged in as admin' steps.
diff --git a/mrblib/pi.rb b/mrblib/pi.rb index abc1234..def5678 100644 --- a/mrblib/pi.rb +++ b/mrblib/pi.rb @@ -1,36 +1,48 @@ class Pi class Pin - attr:@pin_num + attr:pin_num def initialize(num, mode ="in") @pin_num = num File.open("/sys/class/gpio/export","w"){|f| f.write("#{@pin_num}") } - File.open("/sys/class/gpio/gpio#{pin}/direction","w"){|f| + File.open("/sys/class/gpio/gpio#{@pin_num}/direction","w"){|f| f.write(mode) } self end def read - File.open("/sys/class/gpio/gpio#{pin}/value","r"){|f| + File.open("/sys/class/gpio/gpio#{@pin_num}/value","r"){|f| f.read } end def write(str) - File.open("/sys/class/gpio/gpio#{pin}/value","w"){|f| + File.open("/sys/class/gpio/gpio#{@pin_num}/value","w"){|f| f.write(str) } end def toggle - File.open("/sys/class/gpio/gpio#{pin}/value","w+"){|f| + File.open("/sys/class/gpio/gpio#{@pin_num}/value","w+"){|f| val = f.read.to_i f.write("#{1 - val}") } end + + def up + File.open("/sys/class/gpio/gpio#{@pin_num}/direction","w"){|f| + f.write("high") + } + end + + def close + File.open("/sys/class/gpio/unexport","w"){|f| + f.write("#{@pin_num}") + } + end end end
Add up and close methods
diff --git a/app/policies/form_answer_attachment_policy.rb b/app/policies/form_answer_attachment_policy.rb index abc1234..def5678 100644 --- a/app/policies/form_answer_attachment_policy.rb +++ b/app/policies/form_answer_attachment_policy.rb @@ -1,15 +1,14 @@ class FormAnswerAttachmentPolicy < ApplicationPolicy - # TODO: needs clarification - def create? - true + admin_or_lead_or_assigned?(record.form_answer) end def show? - true + admin_or_lead_or_assigned?(record.form_answer) end def destroy? - admin? && record.created_by_admin? + admin? && record.created_by_admin? || + assessor? && record.attachable == subject end end
Clarify the form answer attachment policy
diff --git a/app/uploaders/campaign_hero_image_uploader.rb b/app/uploaders/campaign_hero_image_uploader.rb index abc1234..def5678 100644 --- a/app/uploaders/campaign_hero_image_uploader.rb +++ b/app/uploaders/campaign_hero_image_uploader.rb @@ -0,0 +1,15 @@+class CampaignHeroImageUploader < CarrierWave::Uploader::Base + + include CarrierWave::MiniMagick + + DISPLAY_WIDTH = 1440 + DISPLAY_HEIGHT = 488 + + def store_dir + "files/#{model.class.to_s.underscore}/#{model.id}/hero" + end + + version :resized do + process resize_to_fill: [DISPLAY_WIDTH, DISPLAY_HEIGHT] + end +end
Add uploader for campaign hero images
diff --git a/motion/test_suite_delegate.rb b/motion/test_suite_delegate.rb index abc1234..def5678 100644 --- a/motion/test_suite_delegate.rb +++ b/motion/test_suite_delegate.rb @@ -4,6 +4,7 @@ def application(application, didFinishLaunchingWithOptions:launchOptions) @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) @window.rootViewController = UIViewController.alloc.init + @window.makeKeyAndVisible true end end
Make window visible during tests Some functional tests don't work without it
diff --git a/buildr-jaxb-xjc.gemspec b/buildr-jaxb-xjc.gemspec index abc1234..def5678 100644 --- a/buildr-jaxb-xjc.gemspec +++ b/buildr-jaxb-xjc.gemspec @@ -0,0 +1,23 @@+require File.expand_path(File.dirname(__FILE__) + '/lib/buildr/jaxb_xjc/version') + +Gem::Specification.new do |spec| + spec.name = 'buildr-jaxb-xjc' + spec.version = Buildr::JaxbXjc::Version::STRING + spec.authors = ['Mark Petrovic', 'Peter Donald'] + spec.email = ["mspetrovic@gmail.com","peter@realityforge.org"] + spec.homepage = "http://github.com/realityforge/buildr-jaxb-xjc" + spec.summary = "Buildr extension to execute the XJC binding compiler" + spec.description = <<-TEXT +This is a buildr extension that tasks to execute the XJC binding compiler. + TEXT + + spec.files = Dir['{lib,spec}/**/*', '*.gemspec'] + + ['LICENSE', 'NOTICE', 'README.rdoc', 'CHANGELOG', 'Rakefile'] + spec.require_paths = ['lib'] + + spec.has_rdoc = true + spec.extra_rdoc_files = 'README.rdoc', 'LICENSE', 'NOTICE', 'CHANGELOG' + spec.rdoc_options = '--title', "#{spec.name} #{spec.version}", '--main', 'README.rdoc' + + spec.post_install_message = "Thanks for installing the JAXB XJC extension for Buildr" +end
Add in a minimalistic gemspec
diff --git a/test/test_shell_command.rb b/test/test_shell_command.rb index abc1234..def5678 100644 --- a/test/test_shell_command.rb +++ b/test/test_shell_command.rb @@ -40,4 +40,17 @@ end end + context 'run!' do + it 'must raise a exception when a command fails.' do + proc { + ShellCommand.run! "ls /opskddiofjfsiodjf" + }.must_raise(ShellCommand::Exception) + end + + it 'must give a Command when a command is successful.' do + command = ShellCommand.run! "ls" + command.must_be_instance_of(ShellCommand::Command) + end + end + end
Add some tests for ShellCommand.run!(…).
diff --git a/itamae.gemspec b/itamae.gemspec index abc1234..def5678 100644 --- a/itamae.gemspec +++ b/itamae.gemspec @@ -18,13 +18,13 @@ spec.require_paths = ["lib"] spec.add_runtime_dependency "thor" - spec.add_runtime_dependency "specinfra", "2.0.0" + spec.add_runtime_dependency "specinfra", "~> 2.1.0" spec.add_runtime_dependency "hashie" spec.add_runtime_dependency "ansi" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec", "~> 3.0" - spec.add_development_dependency "serverspec", "2.0.0" + spec.add_development_dependency "serverspec", "~> 2.1.0" spec.add_development_dependency "pry-byebug" end
Use specinfra and serverspec ~> 2.1.0.
diff --git a/spec/dummy/config/initializers/mongoid.rb b/spec/dummy/config/initializers/mongoid.rb index abc1234..def5678 100644 --- a/spec/dummy/config/initializers/mongoid.rb +++ b/spec/dummy/config/initializers/mongoid.rb @@ -1,7 +1,7 @@ require 'mongoid' Mongoid.configure do |config| - name = "dummy_development" + name = "dummy_#{Rails.env}" host = "localhost" config.master = Mongo::Connection.new.db(name) end
Change datables based on ENV
diff --git a/spec/rubocop/cop/lint/else_layout_spec.rb b/spec/rubocop/cop/lint/else_layout_spec.rb index abc1234..def5678 100644 --- a/spec/rubocop/cop/lint/else_layout_spec.rb +++ b/spec/rubocop/cop/lint/else_layout_spec.rb @@ -54,12 +54,12 @@ end it 'handles ternary ops' do - inspect_source(cop, ['x ? a : b']) + inspect_source(cop, 'x ? a : b') expect(cop.offences).to be_empty end it 'handles modifier forms' do - inspect_source(cop, ['x if something']) + inspect_source(cop, 'x if something') expect(cop.offences).to be_empty end end
Simplify a couple of inspect_source invocations in specs
diff --git a/lib/boxen/preflight/rvm.rb b/lib/boxen/preflight/rvm.rb index abc1234..def5678 100644 --- a/lib/boxen/preflight/rvm.rb +++ b/lib/boxen/preflight/rvm.rb @@ -2,8 +2,8 @@ class Boxen::Preflight::RVM < Boxen::Preflight def run - warn "You have an rvm installed in ~/.rvm.", - "The Setup uses rbenv to install ruby, so consider `rvm implode`ing" + abort "You have an rvm installed in ~/.rvm.", + "The Setup uses rbenv to install ruby, so please `rvm implode`" end def ok?
Abort if RVM is found
diff --git a/0_code_wars/time_converter.rb b/0_code_wars/time_converter.rb index abc1234..def5678 100644 --- a/0_code_wars/time_converter.rb +++ b/0_code_wars/time_converter.rb @@ -0,0 +1,5 @@+# http://www.codewars.com/kata/56b8b0ae1d36bb86b2000eaa/ +# --- iteration 1 --- +def convert(time) + time.strftime("%H:%M:%S,%L") +end
Add code wars (7) time converter
diff --git a/tablebuilder.gemspec b/tablebuilder.gemspec index abc1234..def5678 100644 --- a/tablebuilder.gemspec +++ b/tablebuilder.gemspec @@ -11,6 +11,7 @@ s.homepage = "" s.summary = %q{A simple but flexible table builder for Rails 3} s.description = %q{Provides a table builder for your Rails views that creates tables for a collection of objects in a DRY way.} + s.licenses = ['MIT'] s.rubyforge_project = "tablebuilder"
Set license in gemspec to MIT
diff --git a/bin/tic_tac_toe.ru b/bin/tic_tac_toe.ru index abc1234..def5678 100644 --- a/bin/tic_tac_toe.ru +++ b/bin/tic_tac_toe.ru @@ -1,3 +1,4 @@ require 'tic_tac_toe' +use Rack::Static, :urls => ["/css", "/images"], :root => "public" run TicTacToe::RackShell.new_shell
Configure my app to serve static css and image files
diff --git a/lib/console_game_engine.rb b/lib/console_game_engine.rb index abc1234..def5678 100644 --- a/lib/console_game_engine.rb +++ b/lib/console_game_engine.rb @@ -7,6 +7,7 @@ def initialize(args) @gametype = args.fetch(:gametype, nil) @rules = args.fetch(:rules, nil) + @first_player = args.fetch(:first_player, nil) @comp_player = args.fetch(:comp_player, nil) @ui = args.fetch(:ui, nil) end
Add instance variable for firstplayer
diff --git a/refinerycms-testimonials.gemspec b/refinerycms-testimonials.gemspec index abc1234..def5678 100644 --- a/refinerycms-testimonials.gemspec +++ b/refinerycms-testimonials.gemspec @@ -3,7 +3,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'refinerycms-testimonials' - s.version = '2.0.1 MySQL' + s.version = '2.0.1' s.description = 'Ruby on Rails Testimonials extension for Refinery CMS' s.date = '2013-09-25' s.summary = 'Testimonials extension for Refinery CMS'
Remove String from Gemspec version
diff --git a/lib/generators/tolaria/install/templates/administrators_migration.rb b/lib/generators/tolaria/install/templates/administrators_migration.rb index abc1234..def5678 100644 --- a/lib/generators/tolaria/install/templates/administrators_migration.rb +++ b/lib/generators/tolaria/install/templates/administrators_migration.rb @@ -3,7 +3,7 @@ create_table :administrators, force:true do |t| - t.timestamps + t.timestamps null:false # The email used to log into this account t.string :email, null:false, index:true
Set null:false for the timestamps column to prevent Rails warning
diff --git a/konjak.gemspec b/konjak.gemspec index abc1234..def5678 100644 --- a/konjak.gemspec +++ b/konjak.gemspec @@ -18,6 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.add_dependency 'nokogiri' spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake" end
Add nokogiri to gem dependency
diff --git a/yubioath.gemspec b/yubioath.gemspec index abc1234..def5678 100644 --- a/yubioath.gemspec +++ b/yubioath.gemspec @@ -11,9 +11,8 @@ spec.homepage = 'https://github.com/jamesottaway/yubioath' spec.license = 'MIT' - spec.files = `git ls-files -z`.split("\x0") - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] spec.add_dependency 'bindata', '~> 2.1'
Update the gemspec to match the latest Bundler template
diff --git a/utils/wrapper.rb b/utils/wrapper.rb index abc1234..def5678 100644 --- a/utils/wrapper.rb +++ b/utils/wrapper.rb @@ -12,6 +12,7 @@ @@count = 0 def handle_valid_record(record, data_type) if ENV['RUN_TYPE'] == "draft" && @@count > MAX_DRAFT_ROWS + sleep 5 # allow some time for OS to flush bufferse interrupt else record[:data_type] = data_type
Allow early-terminating run to flush buffer before terminating. Without this, we would get a broken pipe.
diff --git a/lib/promise.rb b/lib/promise.rb index abc1234..def5678 100644 --- a/lib/promise.rb +++ b/lib/promise.rb @@ -58,10 +58,10 @@ end end - def reject(reason = nil, backtrace = nil) + def reject(reason = Error, backtrace = nil) dispatch(backtrace) do @state = :rejected - @reason = reason || Error + @reason = reason end end
Set default reason in arglist, previously counted as ControlParameter
diff --git a/app/helpers/access_helper.rb b/app/helpers/access_helper.rb index abc1234..def5678 100644 --- a/app/helpers/access_helper.rb +++ b/app/helpers/access_helper.rb @@ -7,7 +7,7 @@ end def flash_msg - flash[:error] = "This #{current_role_name.downcase} is not allowed to #{params[:action]} this #{params[:controller]}" + flash[:error] = "This #{current_role_name.try(:downcase)} is not allowed to #{params[:action]} this #{params[:controller]}" end def all_actions_allowed?
Fix the error message reported by Airbrake: Error Message: NoMethodError: undefined method `downcase' for nil:NilClass Where: submitted_content#edit [PROJECT_ROOT]/app/helpers/access_helper.rb, line 10
diff --git a/lib/taskmapper-basecamp.rb b/lib/taskmapper-basecamp.rb index abc1234..def5678 100644 --- a/lib/taskmapper-basecamp.rb +++ b/lib/taskmapper-basecamp.rb @@ -1,4 +1,21 @@ require File.dirname(__FILE__) + '/basecamp/basecamp.rb' + +# Monkey patch for backward compatibility issue with type cast on xml response +class Hash + class << self + alias_method :from_xml_original, :from_xml + + def from_xml(xml) + scrubbed = scrub_attributes(xml) + from_xml_original(scrubbed) + end + + def scrub_attributes(xml) + xml.gsub(/<stories.*>/, "<stories + type=\"array\">") + end + end +end %w{ basecamp ticket project comment }.each do |f| require File.dirname(__FILE__) + '/provider/' + f + '.rb';
Add a monkey patch to deal wth the current version of actire resource xml parsing lib
diff --git a/lib/tasks/osm_rubocop.rake b/lib/tasks/osm_rubocop.rake index abc1234..def5678 100644 --- a/lib/tasks/osm_rubocop.rake +++ b/lib/tasks/osm_rubocop.rake @@ -11,11 +11,7 @@ root = defined?(::Rails.root) ? ::Rails.root : Dir.pwd target = File.join(root, '.git', 'hooks', 'pre-commit') - # rubocop:disable Rails/SkipsModelValidations - # There's a false positive rubocop violation here. See bug at: - # https://github.com/bbatsov/rubocop/issues/4260 FileUtils.touch target - # rubocop:enable Rails/SkipsModelValidations FileUtils.chmod '+x', target source_content = File.read source
Remove a rubocop:disable comment that was a workaround for a bug that is now fixed
diff --git a/app/models/duckrails/mock.rb b/app/models/duckrails/mock.rb index abc1234..def5678 100644 --- a/app/models/duckrails/mock.rb +++ b/app/models/duckrails/mock.rb @@ -1,4 +1,7 @@ class Duckrails::Mock < ActiveRecord::Base + BODY_TYPE_EMBEDDED_RUBY = 'embedded_ruby' + BODY_TYPE_STATIC = 'static' + has_many :headers has_one :body @@ -6,9 +9,12 @@ validates :method, presence: true validates :route_path, presence: true validates :name, presence: true - validates :body_type, inclusion: { in: %w(static dynamic) } + validates :body_type, inclusion: { in: [BODY_TYPE_STATIC, + BODY_TYPE_EMBEDDED_RUBY], + allow_blank: true }, + presence: true def dynamic? - body_type == 'dynamic' + body_type != BODY_TYPE_STATIC end end
Use constants for possible body types.
diff --git a/lib/travis/notification.rb b/lib/travis/notification.rb index abc1234..def5678 100644 --- a/lib/travis/notification.rb +++ b/lib/travis/notification.rb @@ -9,7 +9,7 @@ attr_accessor :publishers def setup(options = { instrumentation: true }) - Travis::Instrumentation.setup if options[:instrumentation] && Travis.config.metrics[:reporter] + Travis::Instrumentation.setup if options[:instrumentation] && Travis.config.metrics.reporter publishers << Publisher::Log.new publishers << Publisher::Redis.new if Travis::Features.feature_active?(:notifications_publisher_redis) end
Revert "fix code accessing Travis.config.metrics" This reverts commit 35ce47154089c9ad71809a4fabad1e4e13fb6bf8.
diff --git a/lib/vagrant-list/plugin.rb b/lib/vagrant-list/plugin.rb index abc1234..def5678 100644 --- a/lib/vagrant-list/plugin.rb +++ b/lib/vagrant-list/plugin.rb @@ -23,7 +23,7 @@ control of vagrant boxes. DESC - command(:list) do + command "list" do require_relative 'command' Command end
Use string for command instead of symbol
diff --git a/lib/generators/data_migration/templates/data_migration.rb b/lib/generators/data_migration/templates/data_migration.rb index abc1234..def5678 100644 --- a/lib/generators/data_migration/templates/data_migration.rb +++ b/lib/generators/data_migration/templates/data_migration.rb @@ -1,5 +1,6 @@ class <%= migration_class_name %> < ActiveRecord::Migration def self.up + # Add migration code here end def self.down
Comment where to put migration code in the template
diff --git a/cookbooks/travis_docker/attributes/default.rb b/cookbooks/travis_docker/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/travis_docker/attributes/default.rb +++ b/cookbooks/travis_docker/attributes/default.rb @@ -1,4 +1,4 @@-default['travis_docker']['version'] = '1.9.1-0~trusty' +default['travis_docker']['version'] = '1.10.3-0~trusty' default['travis_docker']['users'] = %w(travis) -default['travis_docker']['compose']['url'] = 'https://github.com/docker/compose/releases/download/1.4.2/docker-compose-Linux-x86_64' -default['travis_docker']['compose']['sha256sum'] = 'd5fca08d54f59649b93b66a781b22998955f2bd701244fcfd650c00daa9e948c' +default['travis_docker']['compose']['url'] = 'https://github.com/docker/compose/releases/download/1.6.2/docker-compose-Linux-x86_64' +default['travis_docker']['compose']['sha256sum'] = '7c453a3e52fb97bba34cf404f7f7e7913c86e2322d612e00c71bd1588587c91e'
Update Docker to 1.10.3 and Docker Compose to 1.6.2
diff --git a/spec/base.rb b/spec/base.rb index abc1234..def5678 100644 --- a/spec/base.rb +++ b/spec/base.rb @@ -5,7 +5,6 @@ Encoding.default_internal = Encoding.default_external = "ASCII-8BIT" if is_ruby_19? require 'rubygems' -require 'spec' begin require "ruby-debug"
Remove "require 'spec'" for rspec 2 compatability.
diff --git a/db/migrate/20120307152935_create_sentences.rb b/db/migrate/20120307152935_create_sentences.rb index abc1234..def5678 100644 --- a/db/migrate/20120307152935_create_sentences.rb +++ b/db/migrate/20120307152935_create_sentences.rb @@ -5,6 +5,8 @@ t.string :name, :null => false t.text :text, :null => false t.string :range + t.boolean :is_definition, :null => false, :default => false + t.boolean :is_axiom, :null => false, :default => false t.integer :comments_count, :null => false, :default => 0 t.timestamps :null => false
Add columns to sentence tables
diff --git a/src/app/models/cloud_account_observer.rb b/src/app/models/cloud_account_observer.rb index abc1234..def5678 100644 --- a/src/app/models/cloud_account_observer.rb +++ b/src/app/models/cloud_account_observer.rb @@ -1,7 +1,31 @@ class CloudAccountObserver < ActiveRecord::Observer def after_create(account) + # FIXME: new boxgrinder doesn't create bucket for amis automatically, + # for now we create bucket from conductor + # remove this hotfix when fixed on boxgrinder side + if account.provider.cloud_type == 'ec2' + create_bucket(account) + end if key = account.generate_auth_key account.update_attribute(:instance_key, InstanceKey.create!(:pem => key.pem, :name => key.id, :instance_key_owner => account)) + end + end + + private + + def create_bucket(account) + client = account.connect + bucket_name = "#{account.account_number}-imagefactory-amis" + # TODO (jprovazn): getting particular bucket takes long time (core fetches all + # buckets from provider), so we call directly create_bucket, if bucket exists, + # exception should be thrown (actually existing bucket is returned - this + # bug should be fixed soon) + #client.create_bucket(:name => bucket_name) unless client.bucket(bucket_name) + begin + client.create_bucket(:name => bucket_name) + rescue Exception => e + Rails.logger.error e.message + Rails.logger.error e.backtrace.join("\n ") end end end
Create bucket for images on cloud provider side The newer boxgrinder uses euca2ools instead of ec2-ami-tools to build and upload ec2 images. Ec2-ami-tools used to automatically create a amazon s3 bucket where images are uploaded, euca2ools doesn't. In future boxgrinder should take care of creation bucket but this will take time, so hotfix is to create bucket from conductor when cloudaccount is created.
diff --git a/0_code_wars/left_and_right.rb b/0_code_wars/left_and_right.rb index abc1234..def5678 100644 --- a/0_code_wars/left_and_right.rb +++ b/0_code_wars/left_and_right.rb @@ -0,0 +1,18 @@+# http://www.codewars.com/kata/left$-and-right$/ +# --- iteration 1 --- +def left(str, i = nil) + if i.nil? + return str[0] + elsif i.is_a?(String) + return str.split(i).first + elsif i > 0 + return str[0...i] + elsif i < 0 + return str[0...(str.size + i)] + end + "" +end + +def right(str, i = nil) + left(str.reverse, (i.is_a?(String) ? i.reverse : i)).reverse +end
Add code wars (7) left and right
diff --git a/vmdb/db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb b/vmdb/db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb index abc1234..def5678 100644 --- a/vmdb/db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb +++ b/vmdb/db/migrate/20141126161823_convert_show_refresh_button_and_load_values_on_init_to_real_columns_for_dialog_fields.rb @@ -8,18 +8,22 @@ add_column :dialog_fields, :show_refresh_button, :boolean add_column :dialog_fields, :load_values_on_init, :boolean - DialogField.all.each do |dialog_field| - dialog_field.show_refresh_button = dialog_field.options.delete(:show_refresh_button) - dialog_field.load_values_on_init = dialog_field.options.delete(:load_values_on_init) - dialog_field.save + say_with_time("Converting options[:show_refresh_button] and options[:load_values_on_init] to column fields") do + DialogField.all.each do |dialog_field| + dialog_field.show_refresh_button = dialog_field.options.delete(:show_refresh_button) + dialog_field.load_values_on_init = dialog_field.options.delete(:load_values_on_init) + dialog_field.save + end end end def down - DialogField.all.each do |dialog_field| - dialog_field.options[:load_values_on_init] = dialog_field.load_values_on_init - dialog_field.options[:show_refresh_button] = dialog_field.show_refresh_button - dialog_field.save + say_with_time("Converting column fields show_refresh_button and load_values_on_init back to options") do + DialogField.all.each do |dialog_field| + dialog_field.options[:load_values_on_init] = dialog_field.load_values_on_init + dialog_field.options[:show_refresh_button] = dialog_field.show_refresh_button + dialog_field.save + end end remove_column :dialog_fields, :load_values_on_init
Add say_with_time for benchmarking conversion of options to columns
diff --git a/blacklight_hierarchy.gemspec b/blacklight_hierarchy.gemspec index abc1234..def5678 100644 --- a/blacklight_hierarchy.gemspec +++ b/blacklight_hierarchy.gemspec @@ -17,6 +17,6 @@ s.test_files = Dir["test/**/*"] s.add_dependency "rails", "~> 3.2.0" - s.add_dependency "blacklight", "~> 3.2.0" + s.add_dependency "blacklight", "~> 3.2" s.add_development_dependency "sqlite3" end
Update dependencies to work with Blacklight ~>3.2
diff --git a/spec/views/capital_projects/_index_table.html.haml_spec.rb b/spec/views/capital_projects/_index_table.html.haml_spec.rb index abc1234..def5678 100644 --- a/spec/views/capital_projects/_index_table.html.haml_spec.rb +++ b/spec/views/capital_projects/_index_table.html.haml_spec.rb @@ -6,6 +6,7 @@ test_proj = create(:capital_project, :fy_year => 2010) assign(:projects, [test_proj]) assign(:organization_list, [test_proj.organization]) + controller.request.path_parameters[:action] = 'index' render end end
Update capital projects table view spec to fix broken test.
diff --git a/Casks/maciasl.rb b/Casks/maciasl.rb index abc1234..def5678 100644 --- a/Casks/maciasl.rb +++ b/Casks/maciasl.rb @@ -1,13 +1,21 @@ cask :v1 => 'maciasl' do - version '1.4' - sha256 '24c0dbaa9a13231b8c8e364ef0e6d60656718320ce69d8bb23aa5bc27e82e87d' + if MacOS.release == :lion + version '1.3' + sha256 '6ba1eafbdf8d954f3c72fc4d5d9e06e15b101522ac253772a06c8579c45675de' - url "http://downloads.sourceforge.net/sourceforge/maciasl/#{version}/MaciASL.zip" + url "http://downloads.sourceforge.net/sourceforge/maciasl/#{version}/MaciASL_Lion.zip" + else + version '1.4' + sha256 '24c0dbaa9a13231b8c8e364ef0e6d60656718320ce69d8bb23aa5bc27e82e87d' + + url "http://downloads.sourceforge.net/sourceforge/maciasl/#{version}/MaciASL.zip" + end + name 'MaciASL' homepage 'http://sourceforge.net/projects/maciasl/' license :gpl app 'MaciASL.app' - depends_on :macos => '>= :mountain_lion' + depends_on :macos => '>= :lion' end
Improve MaciASL.app version check for Mac OS X Lion
diff --git a/spec/integration/upload_spec.rb b/spec/integration/upload_spec.rb index abc1234..def5678 100644 --- a/spec/integration/upload_spec.rb +++ b/spec/integration/upload_spec.rb @@ -14,7 +14,7 @@ attach_file('File', File.expand_path('spec/assets/chicken_rice.jpg')) click_button 'Upload image' - current_path.should_be image_path + current_path.should eq(image_path(1)) expect(page).to have_content 'Image uploaded successfully' end
Use eq instead of should_be, fix expected value
diff --git a/app/controllers/named_routes_controller.rb b/app/controllers/named_routes_controller.rb index abc1234..def5678 100644 --- a/app/controllers/named_routes_controller.rb +++ b/app/controllers/named_routes_controller.rb @@ -1,10 +1,11 @@ class NamedRoutesController < ActionController::Base - caches_page :generate - self.view_paths = File.join(File.dirname(__FILE__), '../views/named_routes') layout nil def generate + # Cache the output for 1 year. The cache gets flushed when Heroku redeploys, + # so new versions will still get displayed on deployment. + response.headers['Cache-Control'] = 'public, max-age=1314000' if Rails.env.production? respond_to do |format| format.js { render :template => 'generate' } end
Change page caching to HTTP caching for Heroku
diff --git a/spec/will-paginate-i18n_spec.rb b/spec/will-paginate-i18n_spec.rb index abc1234..def5678 100644 --- a/spec/will-paginate-i18n_spec.rb +++ b/spec/will-paginate-i18n_spec.rb @@ -3,6 +3,6 @@ Dir.glob('locales/*.yml').each do |locale_file| describe 'a locale file' do it_behaves_like 'a valid locale file', locale_file - it { locale_file.should be_a_subset_of 'locales/en-US.yml' } + it { locale_file.should be_a_subset_of 'locales/en.yml' } end -end+end
Use en as the source locale (instead of en-US)
diff --git a/balanced.gemspec b/balanced.gemspec index abc1234..def5678 100644 --- a/balanced.gemspec +++ b/balanced.gemspec @@ -10,7 +10,7 @@ gem.summary = %q{https://docs.balancedpayments.com/} gem.homepage = "https://www.balancedpayments.com" - gem.add_dependency("faraday", ['>= 0.8.6', '< 0.10']) + gem.add_dependency("faraday", ['>= 0.8.6', '<= 0.9.0']) gem.add_dependency("faraday_middleware", '~> 0.9.0') gem.add_dependency("addressable", '~> 2.3.5')
Reduce upper Faraday bounds to <= 0.9.0
diff --git a/gateway/sqlite_gateway.rb b/gateway/sqlite_gateway.rb index abc1234..def5678 100644 --- a/gateway/sqlite_gateway.rb +++ b/gateway/sqlite_gateway.rb @@ -26,13 +26,30 @@ to_transaction @db[:transactions][:id => id] end - def save(debit) + def save(o) + case o + when Debit + save_debit o + when Transaction + save_transaction o + end + end + + def save_debit(debit) @db[:debits].insert :transaction_id => debit.transaction_id, :category => debit.category, :amount => debit.amount + end + + def save_transaction(transaction) + @db[:transactions].insert :account_id => transaction.account_id, :fit_id => transaction.fit_id, :description => transaction.description, :amount => transaction.amount, :amount_in_pennies => transaction.amount_in_pennies, :nick_name => transaction.nick_name, :posted_at => transaction.posted_at, :type => transaction.type.to_s end def account_by_name(name) @db[:accounts][:name => name] Account.new r[:id], r[:name], r[:balance] + end + + def transactions_by_account_id(account_id) + @db[:transactions][:account_id => account_id].map { |r| to_transaction r } end private
Add methods to gateway to support importing transactions
diff --git a/templates/chromedriver.rb b/templates/chromedriver.rb index abc1234..def5678 100644 --- a/templates/chromedriver.rb +++ b/templates/chromedriver.rb @@ -15,3 +15,13 @@ end Capybara.javascript_driver = :headless_chrome + +RSpec.configure do |config| + config.before(:each, type: :system) do + driven_by :rack_test + end + + config.before(:each, type: :system, js: true) do + driven_by Capybara.javascript_driver + end +end
Configure System Test drivers with `driven_by` According to the documentation from [`rspec-rails`][rspec-rails]: > RSpec **does not** use your `ApplicationSystemTestCase` helper. > Instead it uses the default `driven_by(:selenium)` from Rails. If you > want to override this behaviour you can call `driven_by` manually in a > test. This commit introduces an [`RSpec.configure`][configure] block which sets the default driver for `type: :system` tests by invoking [`driven_by`][driven_by] with [`:rack_test`][rack_test]. To opt into JavaScript-enabled tests, set the `js: true` (or `:js`) metadata on a `describe`, `context`, or `it` block. [driven_by]: https://api.rubyonrails.org/v6.0/classes/ActionDispatch/SystemTestCase.html#method-c-driven_by [rspec-rails]: https://relishapp.com/rspec/rspec-rails/v/3-9/docs/system-specs/system-spec [configure]: https://relishapp.com/rspec/rspec-core/docs/configuration/custom-settings#simple-setting-(with-defaults) [rack_test]: https://github.com/rack-test/rack-test
diff --git a/lib/ghtorrent/migrations/025_add_updated_at_projects.rb b/lib/ghtorrent/migrations/025_add_updated_at_projects.rb index abc1234..def5678 100644 --- a/lib/ghtorrent/migrations/025_add_updated_at_projects.rb +++ b/lib/ghtorrent/migrations/025_add_updated_at_projects.rb @@ -18,12 +18,12 @@ puts 'Adding default value to updated_at' self.transaction(:rollback => :reraise, :isolation => :repeatable) do - if defined?(Sequel::MySQL) - self << "update projects set updated_at = now();" + if defined?(Sequel::SQLite) + self << "update projects set updated_at = CURRENT_TIMESTAMP;" elsif defined?(Sequel::Postgres) self << "update projects set updated_at = now();" - elsif defined?(Sequel::SQLite) - self << "update projects set updated_at = CURRENT_TIMESTAMP;" + elsif defined?(Sequel::MySQL) + self << "update projects set updated_at = now();" else raise StandardError("Don't know how to set default value") end
Change order to fix failing tests
diff --git a/spec/bug_report_templates_spec.rb b/spec/bug_report_templates_spec.rb index abc1234..def5678 100644 --- a/spec/bug_report_templates_spec.rb +++ b/spec/bug_report_templates_spec.rb @@ -1,13 +1,15 @@ require 'spec_helper' +require 'open3' RSpec.describe 'bug_report_templates' do subject do Bundler.with_clean_env do Dir.chdir(chdir_path) do - system({'ACTIVE_ADMIN_PATH' => active_admin_root}, - Gem.ruby, - template_path, - out: File::NULL) + Open3.capture2e( + {'ACTIVE_ADMIN_PATH' => active_admin_root}, + Gem.ruby, + template_path + )[1] end end end
Fix bug report spec to not print stuff on jruby And an associated warning: the `out:` argument to `system` is unsupported there.