diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/week-4/basic-math.rb b/week-4/basic-math.rb index abc1234..def5678 100644 --- a/week-4/basic-math.rb +++ b/week-4/basic-math.rb @@ -0,0 +1,84 @@+# Solution Below + +num1 = 26 +num2 = 94 +sum = num1+num2 +difference = num1-num2 +quotient = num1.to_f/num2.to_f +product = num2 * num1 +modulus = num1 % num2 + +puts quotient + +# RSpec Tests. They are included in this file because the local variables you are creating are not accessible across files. If we try to run these files as a separate file per normal operation, the local variable checks will return nil. + + +describe 'num1' do + it "is defined as a local variable" do + expect(defined?(num1)).to eq 'local-variable' + end + + it "is an integer" do + expect(num1).to be_a Fixnum + end +end + +describe 'num2' do + it "is defined as a local variable" do + expect(defined?(num2)).to eq 'local-variable' + end + + it "is an integer" do + expect(num2).to be_a Fixnum + end +end + +describe 'sum' do + it "is defined as a local variable" do + expect(defined?(sum)).to eq 'local-variable' + end + + it "is assigned the value of num1 + num2" do + expect(sum).to eq num1 + num2 + end +end + +describe 'difference' do + it "is defined as a local variable" do + expect(defined?(difference)).to eq 'local-variable' + end + + it "is assigned the value of num1 - num2" do + expect(difference).to eq num1 - num2 + end +end + +describe 'product' do + it "is defined as a local variable" do + expect(defined?(product)).to eq 'local-variable' + end + + it "is assigned the value of num1 * num2" do + expect(product).to eq num1 * num2 + end +end + +describe 'quotient' do + it "is defined as a local variable" do + expect(defined?(quotient)).to eq 'local-variable' + end + + it "is assigned the value of num1 / num2" do + expect(quotient).to eq num1.to_f / num2.to_f + end +end + +describe 'modulus' do + it "is defined as a local variable" do + expect(defined?(modulus)).to eq 'local-variable' + end + + it "is assigned the value of num1 % num2" do + expect(modulus).to eq num1.to_f % num2.to_f + end +end
Add completed 4.2.3 local variables and basic arithmetic.
diff --git a/share/fathead/made_how/parse.rb b/share/fathead/made_how/parse.rb index abc1234..def5678 100644 --- a/share/fathead/made_how/parse.rb +++ b/share/fathead/made_how/parse.rb @@ -35,8 +35,17 @@ File.open("download/#{file}", 'r') do |f| item = nil f.each_line do |line| - if item && (m = line.match(/<p>(.+?\.).+<\/p>/)) - item.desc = m[1] + if item && (line =~ /<p>.+<\/p>/) + # Use at most 3 sentences. + contents = line.match(/<p>(.+)<\/p>/)[1] + md = contents.scan(/(.+?\.)(\s|$)/) + + sentences = [] + md.each do |m| + sentences << m[0] + end + + item.desc = sentences[0..2].join(" ") items << item item = nil next
Use at most 3 sentences from each synopsis.
diff --git a/config/environments/test.rb b/config/environments/test.rb index abc1234..def5678 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -4,7 +4,7 @@ # # More details: # https://guides.rubyonrails.org/caching_with_rails.html#activesupport-cache-memcachestore - config.cache_store = :mem_cache_store + config.cache_store = :dalli_store, nil, { namespace: :finder_frontend, compress: true } config.cache_classes = true config.eager_load = false
Use Dalli to manage memcached in CI env This will ensure that Test is closer to the live environments.
diff --git a/config/unicorn.rb b/config/unicorn.rb index abc1234..def5678 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -4,7 +4,7 @@ if ENV['PX_DYNO'] worker_processes 18 else - worker_processes 3 + worker_processes 2 end # Requests with more than 30 sec will be killed
Change unicord process count to 2
diff --git a/oxblood.gemspec b/oxblood.gemspec index abc1234..def5678 100644 --- a/oxblood.gemspec +++ b/oxblood.gemspec @@ -16,6 +16,7 @@ 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.required_ruby_version = '>= 1.9.3' spec.add_dependency 'connection_pool' spec.add_development_dependency 'bundler', '~> 1.11'
Set min supported ruby version
diff --git a/gems/manageiq-providers-amazon/app/models/manageiq/providers/amazon/network_manager/refresher.rb b/gems/manageiq-providers-amazon/app/models/manageiq/providers/amazon/network_manager/refresher.rb index abc1234..def5678 100644 --- a/gems/manageiq-providers-amazon/app/models/manageiq/providers/amazon/network_manager/refresher.rb +++ b/gems/manageiq-providers-amazon/app/models/manageiq/providers/amazon/network_manager/refresher.rb @@ -2,7 +2,7 @@ class Amazon::NetworkManager::Refresher < ManageIQ::Providers::BaseManager::Refresher include ::EmsRefresh::Refreshers::EmsRefresherMixin - def parse_inventory(ems, _targets) + def parse_legacy_inventory(ems) ManageIQ::Providers::Amazon::NetworkManager::RefreshParser.ems_inv_to_hashes(ems, refresher_options) end
Fix amazon refersher to use legacy refresh
diff --git a/lib/abnormal.rb b/lib/abnormal.rb index abc1234..def5678 100644 --- a/lib/abnormal.rb +++ b/lib/abnormal.rb @@ -9,15 +9,15 @@ def self.ab_test(identity, test_name, alternatives, conversions) db['tests'].update( {:name => test_name}, - {:$set => {:alternatives => alternatives, :id => Digest::MD5.hexdigest(test_name)}}, + {:$set => {:alternatives => alternatives, :hash => Digest::MD5.hexdigest(test_name)}}, :upsert => true ) chose_alternative(identity, test_name, alternatives) end - def self.get_test(test_id) - db['tests'].find_one(:id => test_id) + def self.get_test(test_hash) + db['tests'].find_one(:hash => test_hash) end def self.tests
Call it test_hash instead of test_id
diff --git a/jschema.gemspec b/jschema.gemspec index abc1234..def5678 100644 --- a/jschema.gemspec +++ b/jschema.gemspec @@ -1,21 +1,20 @@ Gem::Specification.new do |s| - s.name = "jschema" - s.version = "0.0.0" - s.date = "2013-11-11" - s.summary = "JSON Schema implementation" - s.description = "Implementation of JSON Schema Draft 4" - s.license = "MIT" - s.homepage = "http://github.com/Soylent/jschema" - s.authors = "Konstantin Papkovskiy" - s.email = "[email protected]" + s.name = 'jschema' + s.version = '0.0.0' + s.date = '2013-11-11' + s.summary = 'JSON Schema implementation' + s.description = 'Implementation of JSON Schema Draft 4' + s.license = 'MIT' + s.homepage = 'http://github.com/Soylent/jschema' + s.authors = 'Konstantin Papkovskiy' + s.email = '[email protected]' - s.platform = Gem::Platform::RUBY - s.required_ruby_version = ">= 1.9.3" + s.required_ruby_version = '>= 1.9.3' - s.files = Dir["lib/**/*.rb"] - s.test_files = Dir["test/**/*.rb"] + s.files = Dir['lib/**/*.rb'] + s.test_files = Dir['test/**/*.rb'] - s.require_path = "lib" + s.require_path = 'lib' - s.add_development_dependency "minitest" + s.add_development_dependency 'minitest' end
Delete platform attribute from gemspec
diff --git a/spec/factories/email_factory.rb b/spec/factories/email_factory.rb index abc1234..def5678 100644 --- a/spec/factories/email_factory.rb +++ b/spec/factories/email_factory.rb @@ -2,5 +2,6 @@ factory :email do type :university address { Faker::Internet.email } + primary false end end
Set email factory primary to false by default
diff --git a/spec/functions/filename_spec.rb b/spec/functions/filename_spec.rb index abc1234..def5678 100644 --- a/spec/functions/filename_spec.rb +++ b/spec/functions/filename_spec.rb @@ -7,7 +7,7 @@ Puppet::Parser::Functions.function("pget_filename").should == "function_pget_filename" end it "should return msi file" do - ["c:/Program Files/puppet-3.4.1.msi","http://downloads.puppetlabs.com/windows/puppet-3.4.1.msi","puppet://extra_files/puppet-3.4.1.msi"].each {|item| + ["c:/Program Files/puppet-3.4.1.msi","http://downloads.puppetlabs.com/windows/puppet-3.4.1.msi","puppet://extra_files/puppet-3.4.1.msi", "http://downloads.puppetlabs.com/windows/puppet-3.4.1.msi?parameter1=value1&parameter2=value2"].each {|item| result = scope.function_pget_filename([item]) result.should(eq("puppet-3.4.1.msi")) }
Add test for URI with parameters
diff --git a/spec/vm/opcodes/test_op_pick.rb b/spec/vm/opcodes/test_op_pick.rb index abc1234..def5678 100644 --- a/spec/vm/opcodes/test_op_pick.rb +++ b/spec/vm/opcodes/test_op_pick.rb @@ -3,14 +3,14 @@ class VM describe 'op_pick' do - let(:vm){ VM.new 0, [] } - - subject{ - vm.op_pick - vm.stack.last - } + let(:vm){ VM.new 0, [], ProgList::Blocking.new(ProgList.new) } context 'when a scheduled Prog exists' do + + subject{ + vm.op_pick + vm.stack.last + } before do @puid0 = vm.proglist.save(Prog.new(:progress => false)) @@ -30,20 +30,25 @@ context 'when a no scheduled Prog exists' do + subject{ + called = false + Thread.new(vm.proglist){|l| + sleep(0.01) until called + l.save l.fetch(@puid1).tap{|p| p.progress = true} + } + vm.op_pick{ called = true } + vm.stack.last + } + before do @puid0 = vm.proglist.save(Prog.new(:progress => false)) @puid1 = vm.proglist.save(Prog.new(:progress => false)) end - it 'returns a Prog' do - pending{ subject.should be_a(Prog) } - end - it 'returns a scheduled Prog' do - pending{ - subject.progress.should be_true - subject.puid.should eq(@puid1) - } + subject.should be_a(Prog) + subject.progress.should be_true + subject.puid.should eq(@puid1) end end
Complete the +pick+ opcode test in multithread env.
diff --git a/spec/features/home_page_spec.rb b/spec/features/home_page_spec.rb index abc1234..def5678 100644 --- a/spec/features/home_page_spec.rb +++ b/spec/features/home_page_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" RSpec.describe "Home page" do - scenario "visit" do + scenario "can access" do visit root_path expect(page).to have_content "Welcome to Ruby Taiwan"
Change home page scenario description
diff --git a/subdomain_locale.gemspec b/subdomain_locale.gemspec index abc1234..def5678 100644 --- a/subdomain_locale.gemspec +++ b/subdomain_locale.gemspec @@ -5,7 +5,7 @@ spec.version = "0.1.1" spec.authors = ["Semyon Perepelitsa"] spec.email = ["[email protected]"] - spec.description = "Moves current locale into subdomain in your Rails app" + spec.summary = "Set I18n locale based on subdomain" spec.homepage = "https://github.com/semaperepelitsa/subdomain_locale" spec.license = "MIT"
Replace description with summary (required)
diff --git a/mute.gemspec b/mute.gemspec index abc1234..def5678 100644 --- a/mute.gemspec +++ b/mute.gemspec @@ -21,6 +21,7 @@ spec.add_development_dependency 'bundler', '~> 1.5' spec.add_development_dependency 'cane', '~> 2.6.1' spec.add_development_dependency 'cane-hashcheck', '~> 1.2.0' + spec.add_development_dependency 'pry', '~> 0.9.12' spec.add_development_dependency 'rake', '~> 10.1.1' spec.add_development_dependency 'rspec', '~> 2.14.1' end
Add pry as development dependency
diff --git a/core/db/migrate/20201012091259_add_filterable_column_to_spree_option_types.rb b/core/db/migrate/20201012091259_add_filterable_column_to_spree_option_types.rb index abc1234..def5678 100644 --- a/core/db/migrate/20201012091259_add_filterable_column_to_spree_option_types.rb +++ b/core/db/migrate/20201012091259_add_filterable_column_to_spree_option_types.rb @@ -1,6 +1,10 @@ class AddFilterableColumnToSpreeOptionTypes < ActiveRecord::Migration[6.0] def change - add_column :spree_option_types, :filterable, :boolean, default: true, null: false - add_index :spree_option_types, :filterable + unless column_exists?(:spree_option_types, :filterable) + add_column :spree_option_types, :filterable, :boolean, default: true, null: false + end + unless index_exists?(:spree_option_types, :filterable) + add_index :spree_option_types, :filterable + end end end
Check column and index presence in db in filtrable for option types migration
diff --git a/asana.gemspec b/asana.gemspec index abc1234..def5678 100644 --- a/asana.gemspec +++ b/asana.gemspec @@ -9,7 +9,7 @@ gem.homepage = "http://github.com/rbright/asana" gem.license = 'MIT' - gem.add_dependency 'activeresource', '~> 3.2.3' + gem.add_dependency 'activeresource', '>= 3.2.3' gem.add_development_dependency 'guard-minitest', '~> 1.0.0' gem.add_development_dependency 'minitest', '~> 2.12.1'
Update dependencies to work with rails4
diff --git a/qunited.gemspec b/qunited.gemspec index abc1234..def5678 100644 --- a/qunited.gemspec +++ b/qunited.gemspec @@ -6,7 +6,7 @@ s.name = "qunited" s.version = QUnited::VERSION s.authors = ["Aaron Royer"] - s.email = ["[email protected]"] + s.email = ["[email protected]", "[email protected]"] s.homepage = "https://github.com/aaronroyer/qunited" s.summary = %q{QUnit tests in your build} s.description = %q{QUnited runs headless QUnit tests as part of your normal build}
Add myself to authors in gemspec
diff --git a/lib/construi.rb b/lib/construi.rb index abc1234..def5678 100644 --- a/lib/construi.rb +++ b/lib/construi.rb @@ -1,9 +1,11 @@-require 'construi/config' -require 'construi/runner' require 'yaml' module Construi + require 'construi/config' + require 'construi/runner' + + String.disable_colorization = false def self.run(targets)
Fix require order to avoid NameError
diff --git a/lib/ditty/db.rb b/lib/ditty/db.rb index abc1234..def5678 100644 --- a/lib/ditty/db.rb +++ b/lib/ditty/db.rb @@ -18,7 +18,7 @@ ) DB.sql_log_level = (ENV['SEQUEL_LOGGING_LEVEL'] || :debug).to_sym - DB.loggers << Ditty::Services::Logger.instance + DB.loggers << Ditty::Services::Logger.instance if ENV['DB_DEBUG'].to_i == 1 DB.extension(:pagination) Sequel::Model.plugin :validation_helpers
chore: Allow DB logging to be turned off
diff --git a/web/lib/assets/umakadata/lib/umakadata/sparql_helper.rb b/web/lib/assets/umakadata/lib/umakadata/sparql_helper.rb index abc1234..def5678 100644 --- a/web/lib/assets/umakadata/lib/umakadata/sparql_helper.rb +++ b/web/lib/assets/umakadata/lib/umakadata/sparql_helper.rb @@ -0,0 +1,33 @@+require 'umakadata/my_sparql_client' +require 'umakadata/logging/sparql_log' + +module Umakadata + module SparqlHelper + + def prepare(uri) + @client = Umakadata::MySparqlClient.new(uri, {'read_timeout': 5 * 60}) if @uri == uri && @client == nil + @uri = uri + end + + def set_client(client) + @client = client + end + + def query(uri, query, logger:nil) + self.prepare(uri) + + sparql_log = Umakadata::Logging::SparqlLog.new(uri, query) + logger.push sparql_log unless logger.nil? + begin + response = @client.query(query) + sparql_log.request = @client.request_data + sparql_log.response = response + rescue => e + sparql_log.error = 'Empty triples' + return nil + end + return response + end + + end +end
Create sparql helper module to use custom SPARQL::Client class.
diff --git a/spec/web_test.rb b/spec/web_test.rb index abc1234..def5678 100644 --- a/spec/web_test.rb +++ b/spec/web_test.rb @@ -31,7 +31,7 @@ expect(page).to have_content 'Your shortened URL is' end - it 'disallows custom URLs under 5 characters' do + it 'disallows custom urls under 5 characters' do within '#urlform' do fill_in 'url', :with => Faker::Internet.http_url fill_in 'customurl', :with => Faker.numerify('##') @@ -39,5 +39,13 @@ find_button('submit').click expect(page).to have_content 'Error' end + + it 'successfully generates a random url' do + within '#urlform' do + fill_in 'url', :with => Faker::Internet.http_url + end + find_button('submit').click + expect(page).to have_content 'Your shortened URL is' + end end end
Test for randomly generated url
diff --git a/cookbooks/postgresql/recipes/pgdg.rb b/cookbooks/postgresql/recipes/pgdg.rb index abc1234..def5678 100644 --- a/cookbooks/postgresql/recipes/pgdg.rb +++ b/cookbooks/postgresql/recipes/pgdg.rb @@ -4,9 +4,9 @@ apt_repository 'pgdg' do uri 'http://apt.postgresql.org/pub/repos/apt/' distribution "#{node['lsb']['codename']}-pgdg" - # 9.4 component is needed to install related libpq5 dependencies + # For beta releases, the corresponding 9.x component is needed to install related libpq5 dependencies # See https://wiki.postgresql.org/wiki/Apt/FAQ#I_want_to_try_the_beta_version_of_the_next_PostgreSQL_release - components ['main', '9.4'] + components ['main', '9.5'] key 'http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc' action :add
Make PostgreSQL 9.5 Beta apt packages available This change is a little helper for users interested to install 9.5 on the build fly. The pre-installation of 9.5 on Travis machine/container images will only come after general availability (which is currently planned for end 2015). Note: '9.4' apt component is no longer necessary (final releases are in 'main' component)
diff --git a/tilde/bin/brew-leaves.rb b/tilde/bin/brew-leaves.rb index abc1234..def5678 100644 --- a/tilde/bin/brew-leaves.rb +++ b/tilde/bin/brew-leaves.rb @@ -0,0 +1,7 @@+require 'formula' +deps_graph = Formula.get_used_by +formulas = HOMEBREW_CELLAR.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s } +formulas.each do |name| + deps = deps_graph[name] || [] + puts name if !deps.any? { |dep| formulas.include?(dep) } +end
Add function to get homebrew installed leaves Leaves are formula without a dependent parent
diff --git a/lib/gem_search/commands/base.rb b/lib/gem_search/commands/base.rb index abc1234..def5678 100644 --- a/lib/gem_search/commands/base.rb +++ b/lib/gem_search/commands/base.rb @@ -11,14 +11,14 @@ def puts_abort(args) puts args - abort + exit 1 end def unexpected_error(e) puts "\nAn unexpected #{e.class} has occurred." puts e.message puts e.backtrace if ENV["DEBUG"] - abort + exit 1 end end end
Remove stacktrace in occuring http error
diff --git a/lib/girepository/irepository.rb b/lib/girepository/irepository.rb index abc1234..def5678 100644 --- a/lib/girepository/irepository.rb +++ b/lib/girepository/irepository.rb @@ -1,7 +1,13 @@ module GIRepository class IRepository + @@singleton = nil + def self.default - @@singleton ||= new(Lib::g_irepository_get_default) + if @@singleton.nil? + Helper::GType.init + @@singleton = new(Lib::g_irepository_get_default) + end + @@singleton end def get_n_infos namespace
Make sure GType is always initialized
diff --git a/lib/hpcloud/commands/servers.rb b/lib/hpcloud/commands/servers.rb index abc1234..def5678 100644 --- a/lib/hpcloud/commands/servers.rb +++ b/lib/hpcloud/commands/servers.rb @@ -23,7 +23,7 @@ if servers.empty? display "You currently have no servers, use `#{selfname} servers:add <name>` to create one." else - servers.table([:id, :availability_zone, :groups, :key_name, :flavor_id, :image_id, :created_at, :private_ip_address, :public_ip_address, :state]) + servers.table([:id, :name, :key_name, :flavor_id, :image_id, :created_at, :private_ip_address, :public_ip_address, :state]) end rescue Excon::Errors::Forbidden => error display_error_message(error)
Add name to the table listing.
diff --git a/spinners.gemspec b/spinners.gemspec index abc1234..def5678 100644 --- a/spinners.gemspec +++ b/spinners.gemspec @@ -30,5 +30,5 @@ # Gems Dependencies s.add_dependency("sass", ["~> 3.2"]) - s.add_dependency("compass", ["~> 0.12.2"]) + s.add_dependency("compass", ["~> 1.0.0.alpha"]) end
Update required Compass version for gem
diff --git a/lib/rubikon/application/base.rb b/lib/rubikon/application/base.rb index abc1234..def5678 100644 --- a/lib/rubikon/application/base.rb +++ b/lib/rubikon/application/base.rb @@ -21,9 +21,7 @@ # @since 0.2.0 class Base - class << self - include Rubikon::Application::ClassMethods - end + extend Rubikon::Application::ClassMethods include Rubikon::Application::DSLMethods include Rubikon::Application::InstanceMethods
Use a more direct syntax to include ClassMethods
diff --git a/lib/rubocop/cop/rails/output.rb b/lib/rubocop/cop/rails/output.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/rails/output.rb +++ b/lib/rubocop/cop/rails/output.rb @@ -6,7 +6,7 @@ # This cop checks for the use of output calls like puts and print class Output < Cop MSG = 'Do not write to stdout. ' \ - 'Use Rails\' logger if you want to log.'.freeze + "Use Rails's logger if you want to log.".freeze def_node_matcher :output?, <<-PATTERN (send nil {:ap :p :pp :pretty_print :print :puts} $...)
Fix the possessive spelling of Rails's
diff --git a/config/environments/development.rb b/config/environments/development.rb index abc1234..def5678 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -27,6 +27,7 @@ # number of complex assets. config.assets.debug = true + config.assets.digest = true # Adds additional error checking when serving assets at runtime. # Checks for improperly declared sprockets dependencies. # Raises helpful error messages.
Set asset digest to true.
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index abc1234..def5678 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -9,7 +9,7 @@ config.storage = :azure config.azure_storage_account_name = ENV['AZURE_ASSETS_STORAGE_BLOG_ACCOUNT_NAME'] config.azure_storage_access_key = ENV['AZURE_ASSETS_STORAGE_BLOG_ACCOUNT_KEY'] - config.azure_container = ENV['AZURE_ASSETS_STORAGE_BLOG_ACCOUNT_CONTAINER'] + config.azure_container = ENV['AZURE_ASSETS_STORAGE_BLOG_CONTAINER'] config.asset_host = ENV['AZURE_ASSETS_STORAGE_BLOG_URL'] end end
Remove account from azure asset container var
diff --git a/locobot.gemspec b/locobot.gemspec index abc1234..def5678 100644 --- a/locobot.gemspec +++ b/locobot.gemspec @@ -8,9 +8,9 @@ spec.version = Locobot::VERSION spec.authors = ['Rafaël Gonzalez'] spec.email = ['[email protected]'] - spec.summary = %q{TODO: Write a short summary. Required.} - spec.description = %q{TODO: Write a longer description. Optional.} - spec.homepage = '' + spec.summary = %q{Ruby gem of a crazy robot and a benevolent table that keeps watching over it.} + spec.description = %q{Issue commands to control the robot. The table will keep you from making it fall, you monster!} + spec.homepage = 'https://github.com/rafaelgonzalez/locobot' spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0")
Update gem spec homepage, summary and description
diff --git a/spec/fake-aws/s3/resource_spec_spec.rb b/spec/fake-aws/s3/resource_spec_spec.rb index abc1234..def5678 100644 --- a/spec/fake-aws/s3/resource_spec_spec.rb +++ b/spec/fake-aws/s3/resource_spec_spec.rb @@ -8,6 +8,8 @@ let(:s3) { described_class.new } + let(:existing_bucket_name) { "fake-aws-sdk-s3-test" } + it_behaves_like "Aws::S3::Resource" end
Validate behaviour against a real bucket.
diff --git a/spec/features/admin_edits_user_spec.rb b/spec/features/admin_edits_user_spec.rb index abc1234..def5678 100644 --- a/spec/features/admin_edits_user_spec.rb +++ b/spec/features/admin_edits_user_spec.rb @@ -0,0 +1,22 @@+require 'spec_helper' + +RSpec.feature 'Admin goes to user page', :WebDriver => true do + before do + login_as('admin') + visit users_path + end + + scenario 'Admin can view user page', js: true do + expect(current_path).to eq '/users' + expect(page.body).to match(%r{#{'Show/Hide User Descriptions'}}i) + end + + scenario 'Admin can edit a user', js: true do + first('.action_menu_header_right .menu .menu').click_link('edit') + expect(current_path).to eq '/users/1/edit' + find(:xpath, "//input[@id='user_first_name']").set "Jim" + click_button('Save') + expect(current_path).to eq '/users' + expect(page.body).to match(%r{#{'successfully updated'}}i) + end +end
Add feature test for admin editing user.
diff --git a/spec/requests/feeds_controller_spec.rb b/spec/requests/feeds_controller_spec.rb index abc1234..def5678 100644 --- a/spec/requests/feeds_controller_spec.rb +++ b/spec/requests/feeds_controller_spec.rb @@ -5,9 +5,7 @@ fixtures :all before :each do - # The PHP app uses cache tables for rankings that aren't part of our fixtures - # whereas the Rails app dynamically generates these rankings so we need to update - # those caches before we run these tests + # FIXME: PHP cache calculation is still needed for the below tests `cd #{::Rails.root}/php/loader && ./calc_caches.php` end
Update comment - we acutally do need this in Rails, not just PHP
diff --git a/spec/views/games/show.html.erb_spec.rb b/spec/views/games/show.html.erb_spec.rb index abc1234..def5678 100644 --- a/spec/views/games/show.html.erb_spec.rb +++ b/spec/views/games/show.html.erb_spec.rb @@ -3,6 +3,8 @@ RSpec.describe "games/show", type: :view do before(:each) do @game = assign(:game, Game.create!(number_of_players: 2)) + user = assign(:current_user, User.create!(username: "testing")) + @game.players.create!(user: user, piece: :wheelbarrow) end it "renders attributes in <p>" do
Add specs to pass game view
diff --git a/db/migrate/20090626143038_convert_versioned_association_from_hash_to_object.rb b/db/migrate/20090626143038_convert_versioned_association_from_hash_to_object.rb index abc1234..def5678 100644 --- a/db/migrate/20090626143038_convert_versioned_association_from_hash_to_object.rb +++ b/db/migrate/20090626143038_convert_versioned_association_from_hash_to_object.rb @@ -3,8 +3,11 @@ Version.find(:all).each do |version| attributes = YAML::load(version.yaml) if attributes["parts"] - attributes["parts"].collect! do |part| - PagePart.new(part) + attributes["parts"].collect! do |part_attributes| + part = PagePart.find_by_page_id_and_name(version.versionable_id, part_attributes["name"]) + part_attributes.delete("page_id") + part.attributes = part_attributes + part end version.update_attributes( :yaml => attributes.to_yaml ) end
Fix migration so you don't get duplicate parts.
diff --git a/lib/rom/yaml.rb b/lib/rom/yaml.rb index abc1234..def5678 100644 --- a/lib/rom/yaml.rb +++ b/lib/rom/yaml.rb @@ -1,4 +1,4 @@-require 'rom' +require 'rom-core' require 'rom/yaml/version' require 'rom/yaml/gateway'
Change require rom to rom-core only
diff --git a/core/app/models/spree/prototype.rb b/core/app/models/spree/prototype.rb index abc1234..def5678 100644 --- a/core/app/models/spree/prototype.rb +++ b/core/app/models/spree/prototype.rb @@ -1,10 +1,5 @@ class Spree::Prototype < ActiveRecord::Base -<<<<<<< HEAD has_and_belongs_to_many :properties, :class_name => 'Spree::Property', :join_table => "spree_properties_prototypes" has_and_belongs_to_many :option_types, :class_name => 'Spree::OptionType', :join_table => "spree_option_types_prototypes" -======= - has_and_belongs_to_many :properties, :class_name => 'Spree::Property' - has_and_belongs_to_many :option_types, :class_name => 'Spree::OptionType' ->>>>>>> [core] add class_name to model association validates :name, :presence => true end
Remove accidental conflict in Prototype model
diff --git a/minidoc.gemspec b/minidoc.gemspec index abc1234..def5678 100644 --- a/minidoc.gemspec +++ b/minidoc.gemspec @@ -13,8 +13,8 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "activesupport", ">= 3.0.0" - spec.add_dependency "activemodel", ">= 3.0.0" + spec.add_dependency "activesupport", ">= 3.0.0", "< 5" + spec.add_dependency "activemodel", ">= 3.0.0", "< 5" spec.add_dependency "virtus", "~> 1.0.0" spec.add_dependency "mongo", "~> 1" spec.add_development_dependency "minitest"
Add upper bounds to avoid Rails 5 libraries
diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index abc1234..def5678 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -10,10 +10,6 @@ require "rails/generators/test_case" require "active_support/testing/autorun" - -if defined?(Capybara) && defined?(Puma) - require "action_dispatch/system_test_case" -end if defined?(ActiveRecord::Base) ActiveRecord::Migration.maintain_test_schema! @@ -48,12 +44,3 @@ super end end - -if defined?(Capybara) && defined?(Puma) - class ActionDispatch::SystemTestCase - def before_setup # :nodoc: - @routes = Rails.application.routes - super - end - end -end
Remove unnecessary system test code It turns out that we don't need to require system tests in the railties test helper so we can remove it. If you're using system tests they will be loaded by inheriting from ActionDispatch::SystemTestCase and the routes will be loaded by ActionDispatch::IntegrationTest.
diff --git a/spec/integration/navigation_spec.rb b/spec/integration/navigation_spec.rb index abc1234..def5678 100644 --- a/spec/integration/navigation_spec.rb +++ b/spec/integration/navigation_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe "Navigation" do - include Capybara + include Capybara::DSL it "should be a valid app" do ::Rails.application.should be_a(Dummy::Application)
Include Capybara::DSL instead of deprecated Capybara in integration spec.
diff --git a/app/helpers/application_helper/toolbar/configuration_manager_provider_center.rb b/app/helpers/application_helper/toolbar/configuration_manager_provider_center.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper/toolbar/configuration_manager_provider_center.rb +++ b/app/helpers/application_helper/toolbar/configuration_manager_provider_center.rb @@ -31,19 +31,4 @@ ] ), ]) - button_group('configuration_manager_policy', [ - select( - :configuration_manager_policy_choice, - 'fa fa-shield fa-lg', - t = N_('Policy'), - t, - :items => [ - button( - :configuration_manager_provider_tag, - 'pficon pficon-edit fa-lg', - N_('Edit Tags for this Ansible Tower Providers'), - N_('Edit Tags')) - ] - ) - ]) end
Remove the Tagging menu for the configuration profiles list - as this feature is not yet added
diff --git a/spec/default_spec.rb b/spec/default_spec.rb index abc1234..def5678 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -15,4 +15,67 @@ it 'does install packages' do expect(subject).to install_package('curl') end + + it 'should create group' do + expect(subject).to create_group('ndenv').with( + members: [] + ) + end + + it 'should create user' do + expect(subject).to create_user('ndenv').with( + shell: '/bin/bash', + group: 'ndenv', + supports: { manage_home: true }, + home: '/home/ndenv' + ) + end + + it 'should prepare directory' do + expect(subject).to create_directory('/opt/ndenv').with( + user: 'ndenv', + group: 'ndenv', + mode: '0755', + recursive: true + ) + end + + it 'should clone ndenv repository' do + expect(subject).to sync_git('/opt/ndenv').with( + user: 'ndenv', + group: 'ndenv', + repository: 'https://github.com/riywo/ndenv.git', + reference: 'master' + ) + end + + it 'should prepare plugins directory' do + expect(subject).to create_directory('/opt/ndenv/plugins').with( + user: 'ndenv', + group: 'ndenv', + mode: '0755', + recursive: true + ) + end + + it 'should clone node-build repository' do + expect(subject).to sync_git('/opt/ndenv/plugins/node-build').with( + user: 'ndenv', + group: 'ndenv', + repository: 'https://github.com/riywo/node-build.git', + reference: 'master' + ) + end + + it 'should create profile directory' do + expect(subject).to_not create_directory('/etc/profile.d') + end + + it 'should copy ndenv profile file' do + expect(subject).to create_template('/etc/profile.d/ndenv.sh').with( + owner: 'ndenv', + group: 'ndenv', + mode: '0644' + ) + end end
Add more tests for chefspec
diff --git a/spec/request_spec.rb b/spec/request_spec.rb index abc1234..def5678 100644 --- a/spec/request_spec.rb +++ b/spec/request_spec.rb @@ -42,8 +42,10 @@ end end - context "and" do - it { is_expected.to document_all_paths } + context 'and' do + it 'tests all documented routes' do + expect(subject).to document_all_paths + end end end
Replace short form with descriptive test
diff --git a/spec/timecop_spec.rb b/spec/timecop_spec.rb index abc1234..def5678 100644 --- a/spec/timecop_spec.rb +++ b/spec/timecop_spec.rb @@ -17,4 +17,14 @@ Timecop.return end + + it 'when stub Time' do + allow(Time).to receive(:now).and_return(time_1) + + expect(Time.now).to eq time_1 + + allow(Time).to receive(:now).and_return(time_2) + + expect(Time.now).to eq time_2 + end end
Add tests to see how knapsack_pro handle case then someone stub Time.now
diff --git a/react-native-pdf.podspec b/react-native-pdf.podspec index abc1234..def5678 100644 --- a/react-native-pdf.podspec +++ b/react-native-pdf.podspec @@ -12,4 +12,5 @@ s.source = { :git => 'https://github.com/wonday/react-native-pdf.git' } s.platform = :ios, '8.0' s.source_files = "ios/**/*.{h,m}" + s.dependency 'React' end
Add React dependency to podspec Add React dependency to podspec to support CocoaPods 1.5.0 CocoaPods 1.5.0 does no longer add all header search paths for each xcconfig generated and instead, it only adds the header search paths for the dependencies of the pod as stated in http://blog.cocoapods.org/CocoaPods-1.5.0/ As a result, implicit dependencies are no longer working.
diff --git a/app/controllers/brands.rb b/app/controllers/brands.rb index abc1234..def5678 100644 --- a/app/controllers/brands.rb +++ b/app/controllers/brands.rb @@ -1,9 +1,9 @@ get '/contribute' do - erb :'/contribute' + erb :'/brands/contribute' end get '/brands/new' do - erb :'/new_brand' + erb :'brands/new_brand' end post 'brands' do
Fix bug on path to erb views
diff --git a/actionpack/test/template/erb/tag_helper_test.rb b/actionpack/test/template/erb/tag_helper_test.rb index abc1234..def5678 100644 --- a/actionpack/test/template/erb/tag_helper_test.rb +++ b/actionpack/test/template/erb/tag_helper_test.rb @@ -3,9 +3,6 @@ module ERBTest class TagHelperTest < BlockTestCase - - extend ActiveSupport::Testing::Declarative - test "percent equals works for content_tag and does not require parenthesis on method call" do assert_equal "<div>Hello world</div>", render_content("content_tag :div", "Hello world") end
Remove AS declarative extension from erb tag test The extension was removed in 22bc12ec374b8bdeb3818ca0a3eb787dd3ce39d8, making "test" an alias for minitest's "it".
diff --git a/actionview/lib/action_view/testing/resolvers.rb b/actionview/lib/action_view/testing/resolvers.rb index abc1234..def5678 100644 --- a/actionview/lib/action_view/testing/resolvers.rb +++ b/actionview/lib/action_view/testing/resolvers.rb @@ -36,10 +36,11 @@ end end - class NullResolver < PathResolver - def query(path, exts, _, locals, cache:) - handler, format, variant = extract_handler_and_format_and_variant(path) - [ActionView::Template.new("Template generated by Null Resolver", path.virtual, handler, virtual_path: path.virtual, format: format, variant: variant, locals: locals)] + class NullResolver < Resolver + def find_templates(name, prefix, partial, details, locals = []) + path = Path.build(name, prefix, partial) + handler = ActionView::Template::Handlers::Raw + [ActionView::Template.new("Template generated by Null Resolver", path.virtual, handler, virtual_path: path.virtual, format: nil, variant: nil, locals: locals)] end end end
Reimplement NullResolver on base resolver
diff --git a/Casks/handbrakecli-nightly.rb b/Casks/handbrakecli-nightly.rb index abc1234..def5678 100644 --- a/Casks/handbrakecli-nightly.rb +++ b/Casks/handbrakecli-nightly.rb @@ -1,6 +1,6 @@ cask :v1 => 'handbrakecli-nightly' do - version '6937svn' - sha256 '90b9a33ea8e87c3a0a7ce1bb68bc71a63973800cfe373e5a67960ea573db3877' + version '6945svn' + sha256 '303289b4ed14f9053d1ccaf01bd440d33418a8303cdf9c69e0116d45cec5b9e3' url "http://download.handbrake.fr/nightly/HandBrake-#{version}-MacOSX.6_CLI_x86_64.dmg" homepage 'http://handbrake.fr'
Update HandbrakeCLI Nightly to v6945svn HandBrakeCLI Nightly v6945svn built 2015-02-28.
diff --git a/db/data_migration/20121119163057_remove_reverted_detailed_guides_from_search.rb b/db/data_migration/20121119163057_remove_reverted_detailed_guides_from_search.rb index abc1234..def5678 100644 --- a/db/data_migration/20121119163057_remove_reverted_detailed_guides_from_search.rb +++ b/db/data_migration/20121119163057_remove_reverted_detailed_guides_from_search.rb @@ -0,0 +1,25 @@+require 'csv' + +# We are explicitly loading the file from the migration that caused the original issue +data = CSV.read( + File.dirname(__FILE__) + '/20121008103408_revert_detailed_guides_to_draft.csv', + headers: false) + +data.each do |row| + guide = Document.at_slug(DetailedGuide, row[0]) + + + if guide + unless guide.published? + any_edition = Edition.unscoped.where(document_id: guide.id).first + if any_edition + puts "Removing guide #{guide.slug} from search index" + any_edition.remove_from_search_index + end + end + else + # The guide might have been in the old CSV - just remove it anyway + puts "Guide #{row[0]} not in DB; attempting to remove anyway" + Rummageable.delete("/#{row[0]}", Whitehall.detailed_guidance_search_index_name) + end +end
Make sure we remove old guides that may not exist There are 4 guides from the previous version of this migration that don't appear to exist in the DB anymore, but some of them exist in the search index. This tries to de-index the documents from ElasticSearch even if they don't exist in the DB. https://www.pivotaltracker.com/story/show/39608745
diff --git a/db/data_migration/20170914142009_unpublish_seed_enterprise_investment_scheme.rb b/db/data_migration/20170914142009_unpublish_seed_enterprise_investment_scheme.rb index abc1234..def5678 100644 --- a/db/data_migration/20170914142009_unpublish_seed_enterprise_investment_scheme.rb +++ b/db/data_migration/20170914142009_unpublish_seed_enterprise_investment_scheme.rb @@ -15,4 +15,4 @@ unpublisher.perform! PublishingApiDocumentRepublishingWorker.new.perform(document_id) -) +end
Fix missing `end` in data migration A syntax error is preventing the data migration from running. Fix this by adding the missing `end` for the `if` construct.
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,12 +1,12 @@ admin = User.get_from_ENV -block_list = BlockList.create( - :name => 'Testing12', +block_list = BlockList.find_or_create_by(name: 'Testing12') +block_list.update_attributes( :description => 'for testing, maintenence, etc', :expires => nil, ) -Admin.create( +Admin.find_or_create_by( :block_list => block_list, :user => admin, )
Allow successive calls to rake db:seed
diff --git a/app/controllers/admin/after_create_controller.rb b/app/controllers/admin/after_create_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/after_create_controller.rb +++ b/app/controllers/admin/after_create_controller.rb @@ -1,20 +1,14 @@ class Admin::AfterCreateController < Admin::AdminController include Wicked::Wizard - steps :guide, :privacy, :logo, :events, :invitations, :done + steps :guide, :privacy, :logo, :events, :done def show - case step - when :invitations - skip_step if current_organization.auto_verify - else - end - render_wizard end def update skip_step if current_organization.update_attributes(params[:organization]) - + render_wizard end
Remove invitations step for now
diff --git a/spec/lib/wechat/helpers_spec.rb b/spec/lib/wechat/helpers_spec.rb index abc1234..def5678 100644 --- a/spec/lib/wechat/helpers_spec.rb +++ b/spec/lib/wechat/helpers_spec.rb @@ -15,7 +15,7 @@ end it '#wechat_config_js' do - controller.request = ActionController::TestRequest.create + controller.request = ActionController::TestRequest.create ActionController::TestRequest::DEFAULT_ENV controller.request.host = 'test.host' expect(controller.wechat.jsapi_ticket).to receive(:signature) .with('http://test.host').and_return(js_hash_result) @@ -29,7 +29,7 @@ end it 'called with trusted_domain' do - controller.request = ActionController::TestRequest.create + controller.request = ActionController::TestRequest.create ActionController::TestRequest::DEFAULT_ENV controller.request.host = 'test.host' expect(controller.wechat.jsapi_ticket).to receive(:signature) .with('http://trusted.host').and_return(js_hash_result)
Fix Rails 5.1 ActionController::TestRequest.create expect at least 1 argument problem.
diff --git a/routes/solve.rb b/routes/solve.rb index abc1234..def5678 100644 --- a/routes/solve.rb +++ b/routes/solve.rb @@ -13,7 +13,7 @@ end get "/solve/:id" do - @solve = ReconDatabase::Solve.where(id: params[:id]).first + @solve = ReconDatabase::Solve.first(id: params[:id]) erb :solve end @@ -35,14 +35,14 @@ get "/solve/edit/:id" do authenticate! - @solve = ReconDatabase::Solve.where(id: params["id"]).first + @solve = ReconDatabase::Solve.first(id: params["id"]) erb :edit_solve end post "/solve/update/:id" do authenticate! id = params["id"] - @solve = ReconDatabase::Solve.where(id: id).first + @solve = ReconDatabase::Solve.first(id: id) @solve.update(params["solve"]) redirect "/solve/#{id}" end
Switch from .where(...).first to .first(...)
diff --git a/lib/greeve/eve/alliance_list.rb b/lib/greeve/eve/alliance_list.rb index abc1234..def5678 100644 --- a/lib/greeve/eve/alliance_list.rb +++ b/lib/greeve/eve/alliance_list.rb @@ -17,11 +17,6 @@ attribute :start_date, xpath: "@startDate", type: :datetime end - rowset :member_corporations, xpath: "eveapi/result/rowset[@name='memberCorporations']" do - attribute :character_id, xpath: "@characterID", type: :integer - attribute :start_date, xpath: "@startDate", type: :datetime - end - # @param version [Integer] EVE Alliance List def initialize(version, opts = {}) raise ArgumentError, "not implemented, use version=1" if version == 0
Remove unused memberCorporations rowset from Eve::AllianceList.
diff --git a/lib/rack/link_headers/helper.rb b/lib/rack/link_headers/helper.rb index abc1234..def5678 100644 --- a/lib/rack/link_headers/helper.rb +++ b/lib/rack/link_headers/helper.rb @@ -17,8 +17,8 @@ links << {:url => url.to_s, :params => params} self["Link"] = links.to_a.map do |link| - "<#{link[:url]}>" + link[:params].to_a.map do |k, v| - "; #{k}=\"#{v}\"" + "<#{link[:url]}>" + link[:params].keys.sort.map do |k| + "; #{k}=\"#{link[:params][k]}\"" end.join end.join(', ') end
Sort params keys before mapping to force order.
diff --git a/lib/simplest_photo/has_photo.rb b/lib/simplest_photo/has_photo.rb index abc1234..def5678 100644 --- a/lib/simplest_photo/has_photo.rb +++ b/lib/simplest_photo/has_photo.rb @@ -1,7 +1,7 @@ module SimplestPhoto module HasPhoto - def has_photo(name, required: false) + def has_photo(name, options = {}) has_one :"#{name}_attachment", -> { where(attachable_name: name) }, as: :attachable, @@ -12,8 +12,8 @@ through: "#{name}_attachment", source: :photo - if required - validates name, presence: true + if options.delete(:required) + validates name, options.merge(presence: true) end foreign_key = "#{name}_id"
Allow users to pass through additional validation options - Like `on: :update`
diff --git a/exe/gmail-slack-notifier.rb b/exe/gmail-slack-notifier.rb index abc1234..def5678 100644 --- a/exe/gmail-slack-notifier.rb +++ b/exe/gmail-slack-notifier.rb @@ -2,4 +2,4 @@ require 'gmail/slack/notifier' -Gmail::Slack::Notifier.new.run! +Gmail::Slack::Notifier.new.run
Update exe to remove bang off run method
diff --git a/lib/vidibus/watch_folder/job.rb b/lib/vidibus/watch_folder/job.rb index abc1234..def5678 100644 --- a/lib/vidibus/watch_folder/job.rb +++ b/lib/vidibus/watch_folder/job.rb @@ -31,7 +31,7 @@ end def delete_all(uuid, event, path) - regex = /Vidibus::WatchFolder::Job\nuuid: #{uuid}\nevent: #{event}\npath: #{path}\n/ + regex = /Vidibus::WatchFolder::Job\s*\nuuid: #{uuid}\nevent: #{event}\npath: #{path}\n/ Delayed::Backend::Mongoid::Job.delete_all(:handler => regex) end end
Allow white space after class name for Ruby 1.8.7
diff --git a/Casks/vivaldi-snapshot.rb b/Casks/vivaldi-snapshot.rb index abc1234..def5678 100644 --- a/Casks/vivaldi-snapshot.rb +++ b/Casks/vivaldi-snapshot.rb @@ -1,6 +1,6 @@ cask :v1 => 'vivaldi-snapshot' do - version '1.0.209.3' - sha256 '07067b11414f7dffff6fb03deb832fdd23bef64cfc67c27911f2c131842d8641' + version '1.0.219.51' + sha256 '2178e6d814e7feea3d1b58033135511061a4559d79884c7ca47ccb1bf36daf07' url "https://vivaldi.com/download/snapshot/Vivaldi.#{version}.dmg" name 'Vivaldi'
Upgrade Vivaldi.app (Snapshot) to v1.0.219.51
diff --git a/ffi.gemspec b/ffi.gemspec index abc1234..def5678 100644 --- a/ffi.gemspec +++ b/ffi.gemspec @@ -9,6 +9,7 @@ s.files = %w(ffi.gemspec History.txt LICENSE COPYING COPYING.LESSER README.md Rakefile) + Dir.glob("{ext,gen,lib,spec,libtest}/**/*").reject { |f| f =~ /lib\/1\.[89]/} s.extensions << 'ext/ffi_c/extconf.rb' s.has_rdoc = false + s.rdoc_options = %w[--exclude=ext/ffi_c/.*\.o$ --exclude=ffi_c\.(bundle|so)$] s.license = 'LGPL-3' s.require_paths << 'ext/ffi_c' s.required_ruby_version = '>= 1.8.7'
Exclude object files from rdoc
diff --git a/arproxy-query_caller_location_annotator.gemspec b/arproxy-query_caller_location_annotator.gemspec index abc1234..def5678 100644 --- a/arproxy-query_caller_location_annotator.gemspec +++ b/arproxy-query_caller_location_annotator.gemspec @@ -20,7 +20,7 @@ spec.require_paths = ['lib'] spec.add_dependency 'arproxy' + spec.add_dependency 'rails' spec.add_development_dependency 'bundler', '~> 1.12' - spec.add_development_dependency 'rails' spec.add_development_dependency 'rake', '~> 10.0' end
Move rails dependency to runtime one
diff --git a/app/models/alert_types/bad_work_alert.rb b/app/models/alert_types/bad_work_alert.rb index abc1234..def5678 100644 --- a/app/models/alert_types/bad_work_alert.rb +++ b/app/models/alert_types/bad_work_alert.rb @@ -46,7 +46,8 @@ private def set_default_values - self.message = "BadWorkAlert for #{article.title}\n#{message}" + link = "\n<a href='#{url}'>#{article.title}</a>" + self.message = "BadWorkAlert for #{article.title}\n#{message}#{link}" self.target_user_id = content_experts.first&.id end end
Add link to article to notification message
diff --git a/app/models/spree/avatax_configuration.rb b/app/models/spree/avatax_configuration.rb index abc1234..def5678 100644 --- a/app/models/spree/avatax_configuration.rb +++ b/app/models/spree/avatax_configuration.rb @@ -4,7 +4,7 @@ preference :company_code, :string, default: ENV['AVATAX_COMPANY_CODE'] preference :account, :string, default: ENV['AVATAX_ACCOUNT'] preference :license_key, :string, default: ENV['AVATAX_LICENSE_KEY'] - preference :environment, :string, default: -> { default_environment } + preference :environment, :string, default: -> { Spree::AvataxConfiguration.default_environment } preference :log, :boolean, default: true preference :log_to_stdout, :boolean, default: false preference :address_validation, :boolean, default: true @@ -24,7 +24,7 @@ %w(company_code account license_key environment) end - def default_environment + def self.default_environment if ENV['AVATAX_ENVIRONMENT'].present? ENV['AVATAX_ENVIRONMENT'] else
Make default_environment a class method As instance methods are deprecated since this PR[0]. [0] `https://github.com/solidusio/solidus/pull/4064`
diff --git a/torasup.gemspec b/torasup.gemspec index abc1234..def5678 100644 --- a/torasup.gemspec +++ b/torasup.gemspec @@ -11,7 +11,7 @@ gem.description = %q{"Retuns metadata about a phone number such as operator, area code and more"} gem.summary = %q{"Retuns metadata about a phone number such as operator, area code and more"} gem.homepage = "https://github.com/dwilkie/torasup/" - spec.license = 'MIT' + gem.license = 'MIT' gem.files = `git ls-files`.split($/) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Fix syntax error in gemspec
diff --git a/migrate/20190801141446_add_nr_fields_to_country_statistics.rb b/migrate/20190801141446_add_nr_fields_to_country_statistics.rb index abc1234..def5678 100644 --- a/migrate/20190801141446_add_nr_fields_to_country_statistics.rb +++ b/migrate/20190801141446_add_nr_fields_to_country_statistics.rb @@ -0,0 +1,8 @@+class AddNrFieldsToCountryStatistics < ActiveRecord::Migration + def change + add_column :country_statistics, :percentage_nr_land_cover, :float + add_column :country_statistics, :percentage_nr_marine_cover, :float + add_column :country_statistics, :nr_version, :integer + add_column :country_statistics, :nr_report_url, :string + end +end
Add NR stats to country statistics
diff --git a/app/workers/notification_email_worker.rb b/app/workers/notification_email_worker.rb index abc1234..def5678 100644 --- a/app/workers/notification_email_worker.rb +++ b/app/workers/notification_email_worker.rb @@ -6,6 +6,7 @@ max_in_interval: 10, min_delay: 5.minutes, reject_with: :reschedule, + track_rejected: false, key: ->(user_id, digest) { "user_#{ user_id }_notification_emails" }
Disable rate-limiter rejection tracking on notification email worker
diff --git a/lib/amazon-drs.rb b/lib/amazon-drs.rb index abc1234..def5678 100644 --- a/lib/amazon-drs.rb +++ b/lib/amazon-drs.rb @@ -1,4 +1,5 @@ require 'amazon-drs/version' +require 'amazon-drs/client' module AmazonDrs # Your code goes here...
Add require Client on top
diff --git a/lib/engineyard.rb b/lib/engineyard.rb index abc1234..def5678 100644 --- a/lib/engineyard.rb +++ b/lib/engineyard.rb @@ -1,7 +1,7 @@ module EY require 'engineyard/ruby_ext' - VERSION = "0.3.0" + VERSION = "0.3.1.pre" autoload :Account, 'engineyard/account' autoload :API, 'engineyard/api'
Add .pre for next release Change-Id: I52cd42b0bbd79d676ed6164803886e7b5384b935 Reviewed-on: http://review.engineyard.com/261 Reviewed-by: Sam Merritt <[email protected]> Tested-by: Sam Merritt <[email protected]>
diff --git a/lib/s3_storage.rb b/lib/s3_storage.rb index abc1234..def5678 100644 --- a/lib/s3_storage.rb +++ b/lib/s3_storage.rb @@ -4,7 +4,11 @@ NotConfiguredError = Class.new(StandardError) def self.build(bucket_name) - bucket_name.present? ? new(bucket_name) : Null.new + if bucket_name.present? + new(bucket_name) + else + Null.new + end end def initialize(bucket_name)
Convert ternary expression into if/else in S3Storage.build I'm about to make this logic more complicated and I think it will be easier to see the changes if I make this change first.
diff --git a/test/fakie/spot_test.rb b/test/fakie/spot_test.rb index abc1234..def5678 100644 --- a/test/fakie/spot_test.rb +++ b/test/fakie/spot_test.rb @@ -0,0 +1,30 @@+require 'test_helper' + +module Fakie + class SpotTest < TestCase + def test_fr + phone_number = PhoneNumber.parse('+33 06 61 25 00 00') + assert_equal 'FR', phone_number.region_code + end + + def test_hk + phone_number = PhoneNumber.parse('+852 9160 0000') + assert_equal 'HK', phone_number.region_code + end + + def test_at + phone_number = PhoneNumber.parse('+43 680 233 0000') + assert_equal 'AT', phone_number.region_code + end + + def test_ch + phone_number = PhoneNumber.parse('+41 79 667 00 00') + assert_equal 'CH', phone_number.region_code + end + + def test_es + phone_number = PhoneNumber.parse('+34693600000') + assert_equal 'ES', phone_number.region_code + end + end +end
Add some tests for numbers that weren't working with Phonie
diff --git a/lib/saxon/xslt.rb b/lib/saxon/xslt.rb index abc1234..def5678 100644 --- a/lib/saxon/xslt.rb +++ b/lib/saxon/xslt.rb @@ -4,10 +4,6 @@ $CLASSPATH << File.expand_path('../../../vendor/saxonica/saxon9-unpack.jar', __FILE__) java_import javax.xml.transform.stream.StreamSource - -module JavaIO - include_package "java.io" -end module Saxon module S9API @@ -22,17 +18,17 @@ def initialize(xslt_path) @processor = S9API::Processor.new(false) @compiler = @processor.newXsltCompiler() - @xslt = @compiler.compile(StreamSource.new(JavaIO::File.new(xslt_path))) + @xslt = @compiler.compile(StreamSource.new(java.io.File.new(xslt_path))) end def transform(xml_path) serializer = @processor.newSerializer() - output = JavaIO::StringWriter.new() + output = java.io.StringWriter.new() serializer.setOutputWriter(output) - xml = @processor.newDocumentBuilder().build(StreamSource.new(JavaIO::File.new(xml_path))) + xml = @processor.newDocumentBuilder().build(StreamSource.new(java.io.File.new(xml_path))) transformer = @xslt.load transformer.setInitialContextNode(xml) - transformer.setDestination(output) + transformer.setDestination(serializer) transformer.transform output.toString end
Fix bug; make use of basic java.io.* classes more JRuby-ish
diff --git a/test/spec/posts_spec.rb b/test/spec/posts_spec.rb index abc1234..def5678 100644 --- a/test/spec/posts_spec.rb +++ b/test/spec/posts_spec.rb @@ -0,0 +1,17 @@+require 'minitest_helper' + +# MediumSpec is used to test the main Medium SDK Client +module MediumSpec + describe 'Medium Posts Client', 'The Medium SDK Gem Posts Resource Client' do + before do + auth = { integration_token: ENV['integration_token'] } + @client = Medium::Client.new auth + @posts_client = @client.posts + end + + it 'should initialize the correct type of client object' do + expect(@posts_client).must_be_instance_of Medium::Posts + end + end +end +
Add boilerplate to begin testing Posts
diff --git a/test/cli_test.rb b/test/cli_test.rb index abc1234..def5678 100644 --- a/test/cli_test.rb +++ b/test/cli_test.rb @@ -3,20 +3,37 @@ class CliTest < MiniTest::Test def test_list - cli = Cheatly::CLI.new([], nopaginate: true, test: true) - cli.list + begin + cli = Cheatly::CLI.new([], nopaginate: true, test: true) + cli.list + rescue Exception => e + raise "#{e.message}" + end - cli = Cheatly::CLI.new([], local: true, nopaginate: true, test: true) - cli.list + begin + cli = Cheatly::CLI.new([], local: true, nopaginate: true, test: true) + cli.list + rescue Exception => e + raise "#{e.message}" + end + end def test_show - cli = Cheatly::CLI.new([], nopaginate: true, test: true) - cli.show "markdown" + begin + cli = Cheatly::CLI.new([], nopaginate: true, test: true) + cli.show "markdown" + rescue Exception => e + raise "#{e.message}" + end end def test_help - cli = Cheatly::CLI.new([], nopaginate: true, test: true) - cli.help + begin + cli = Cheatly::CLI.new([], nopaginate: true, test: true) + cli.help + rescue Exception => e + raise "#{e.message}" + end end end
Add exceptions to CLI test
diff --git a/view_markdown.rb b/view_markdown.rb index abc1234..def5678 100644 --- a/view_markdown.rb +++ b/view_markdown.rb @@ -1,9 +1,10 @@ #!/usr/bin/env ruby # Quick script for viewing getting at kramdown's view of a markdown file -require 'kramdown' +require 'mdl/doc' require 'pry' -doc = Kramdown::Document.new(File.read(ARGV[0])) -children = doc.root.children + +doc = MarkdownLint::Doc.new_from_file(ARGV[0]) +children = doc.parsed.root.children binding.pry
Change the quick test script to use a doc object This allows using markdownlint's doc object methods as used in rules when troubleshooting a document.
diff --git a/test/target/file_target_test.rb b/test/target/file_target_test.rb index abc1234..def5678 100644 --- a/test/target/file_target_test.rb +++ b/test/target/file_target_test.rb @@ -3,7 +3,7 @@ class Tumugi::Target::FileTargetTest < Test::Unit::TestCase sub_test_case '#exist?' do setup do - @file = Tempfile.new + @file = Tempfile.open('file_target_test') end teardown do
Fix test for ruby <= 2.2
diff --git a/pessimize.gemspec b/pessimize.gemspec index abc1234..def5678 100644 --- a/pessimize.gemspec +++ b/pessimize.gemspec @@ -10,9 +10,9 @@ gem.email = ["[email protected]"] gem.description = %q{Add the pessimistic constraint operator to all gems in your Gemfile, restricting the maximum update version. -This is for people who work with projects that use bundler, such as rails projects. The pessimistic constraint operator (~>) allows you to specify the maximum version that a gem can be updated, and reduces potential breakages when running `bundle update`.} +This is for people who work with projects that use bundler, such as rails projects. The pessimistic constraint operator (~>) allows you to specify the maximum version that a gem can be updated, and reduces potential breakages when running `bundle update`. Pessimize automatically retrieves the current versions of your gems, then adds them to your Gemfile (so you don't have to do it by hand).} gem.summary = %q{Add the pessimistic constraint operator to all gems in your Gemfile, restricting the maximum update version.} - gem.homepage = "" + gem.homepage = "https://github.com/joonty/pessimize" gem.add_development_dependency 'rspec', '~> 2.13.0' gem.add_development_dependency 'rake', '~> 10.0.3'
Improve description and add homepage
diff --git a/phantomjs.gemspec b/phantomjs.gemspec index abc1234..def5678 100644 --- a/phantomjs.gemspec +++ b/phantomjs.gemspec @@ -10,6 +10,7 @@ gem.license = 'MIT' gem.add_development_dependency 'poltergeist' + gem.add_development_dependency 'capybara', '~> 2.0.0' gem.add_development_dependency 'rspec', ">= 2.11.0" gem.add_development_dependency 'simplecov' gem.add_development_dependency 'rake'
Enforce Capybara ~> 2.0, since Poltergeist fails with 2.1
diff --git a/shameless.gemspec b/shameless.gemspec index abc1234..def5678 100644 --- a/shameless.gemspec +++ b/shameless.gemspec @@ -5,8 +5,8 @@ Gem::Specification.new do |spec| spec.name = "shameless" spec.version = Shameless::VERSION - spec.authors = ["Olek Janiszewski"] - spec.email = ["[email protected]"] + spec.authors = ["Olek Janiszewski", "Chas Lemley", "Marek Rosa"] + spec.email = ["[email protected]", "[email protected]", "[email protected]"] spec.summary = %q{Scalable distributed append-only data store} spec.homepage = "https://github.com/hoteltonight/shameless"
Add Chas and Marek as contributors
diff --git a/lib/cowsay.rb b/lib/cowsay.rb index abc1234..def5678 100644 --- a/lib/cowsay.rb +++ b/lib/cowsay.rb @@ -10,7 +10,7 @@ end def character_classes - @character_classes ||= Character.constants - [:Base, :Template] + @character_classes ||= Character.constants.map { |c| c.to_sym } - [:Base, :Template] end def say(message)
Make character_classes compatible with Ruby 1.8.
diff --git a/lib/hanvox.rb b/lib/hanvox.rb index abc1234..def5678 100644 --- a/lib/hanvox.rb +++ b/lib/hanvox.rb @@ -4,4 +4,5 @@ module Hanvox -end+end +
Add space at bottom of file
diff --git a/lib/mactag.rb b/lib/mactag.rb index abc1234..def5678 100644 --- a/lib/mactag.rb +++ b/lib/mactag.rb @@ -9,7 +9,7 @@ autoload :Rails, 'rails' def self.warn(message) - $stderr.puts(message) + STDERR.puts(message) end end
Use constant instead of global variable.
diff --git a/lib/runner.rb b/lib/runner.rb index abc1234..def5678 100644 --- a/lib/runner.rb +++ b/lib/runner.rb @@ -24,7 +24,7 @@ EM.run do player = Spotbot::Player.new($logger) player.run - Thin::Server.start Spotbot::Web.new(player), '0.0.0.0', 3000 + Thin::Server.start Spotbot::Web.new(player), '0.0.0.0', ENV['SERVER_PORT'] end end end
Read server port from ENV
diff --git a/lib/ruzai2.rb b/lib/ruzai2.rb index abc1234..def5678 100644 --- a/lib/ruzai2.rb +++ b/lib/ruzai2.rb @@ -15,12 +15,10 @@ ) end - def banned?(user_id, hoge_id, fuga_id) + def banned?(id_params) RuzaiList.where( - user_id: user_id, - hoge_id: hoge_id, - fuga_id: fuga_id, - ).where("expired_at < ?", Time.now).exist? + id_params + ).where("expired_at > ?", Time.now).exists? end end end
Fix production code for passing test.
diff --git a/spec/factories/organs.rb b/spec/factories/organs.rb index abc1234..def5678 100644 --- a/spec/factories/organs.rb +++ b/spec/factories/organs.rb @@ -3,12 +3,12 @@ FactoryGirl.define do factory :organ do - factory :tasa_arvotyoryhma, :class => Organ do + factory :tasa_arvotyoryhma do name 'Tasa-arvotyöryhmä' _id "4f6b1edf91bc2b3301010101" association :organization, :factory => :kemian_laitos end - factory :kirjakerho, :class => Organ do + factory :kirjakerho do name 'Kirjakerho' _id "4f6b1edf91bc2b3302010101" association :organization, :factory => :kirjasto
Remove unnecessary class specification from factory
diff --git a/test/integration_test_helper.rb b/test/integration_test_helper.rb index abc1234..def5678 100644 --- a/test/integration_test_helper.rb +++ b/test/integration_test_helper.rb @@ -3,6 +3,7 @@ require 'webmock' DatabaseCleaner.strategy = :transaction +WebMock.disable_net_connect! class ActionDispatch::IntegrationTest include Capybara::DSL
Disable connections in integration tests
diff --git a/spec/moovy/movie_spec.rb b/spec/moovy/movie_spec.rb index abc1234..def5678 100644 --- a/spec/moovy/movie_spec.rb +++ b/spec/moovy/movie_spec.rb @@ -0,0 +1,9 @@+require 'spec_helper' + +describe Moovy::Movie do + it 'allows me to search for a movie title' do + movies = Moovy::Movie.search('Frozen') + expect(movies).to_not eql([]) + expect(movies.first).to be_kind_of(Moovy::Movie) + end +end
Add moovy spec directory and movie spec
diff --git a/nobrainer.gemspec b/nobrainer.gemspec index abc1234..def5678 100644 --- a/nobrainer.gemspec +++ b/nobrainer.gemspec @@ -15,7 +15,7 @@ s.description = "ORM for RethinkDB" s.license = 'MIT' - s.add_dependency "rethinkdb", "~> 1.10.0" + s.add_dependency "rethinkdb", "~> 1.11.0.1" s.add_dependency "activemodel", ">= 3.2.0", "< 5" s.add_dependency "middleware", "~> 0.1.0"
Update to latest rethinkdb library (v1.11.0.1)
diff --git a/ci_environment/kerl/attributes/source.rb b/ci_environment/kerl/attributes/source.rb index abc1234..def5678 100644 --- a/ci_environment/kerl/attributes/source.rb +++ b/ci_environment/kerl/attributes/source.rb @@ -1,2 +1,2 @@-default[:kerl][:releases] = %w(R14B02 R14B03 R14B04 R15B R15B01 R15B02 R15B03 R16B R16B01 R16B02 R16B03 R16B03-1) +default[:kerl][:releases] = %w(R14B02 R14B03 R14B04 R15B R15B01 R15B02 R15B03 R16B R16B01 R16B02 R16B03 R16B03-1 17.0-rc1) default[:kerl][:path] = "/usr/local/bin/kerl"
Support Erlang 17.0-rc1 with kerl
diff --git a/powerpack.gemspec b/powerpack.gemspec index abc1234..def5678 100644 --- a/powerpack.gemspec +++ b/powerpack.gemspec @@ -17,7 +17,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 1.3' + spec.add_development_dependency 'bundler', '>= 1.3', "< 3.0" spec.add_development_dependency 'rake' spec.add_development_dependency('rspec') spec.add_development_dependency('yard', '~> 0.9')
Update gemspec to allow bundler 2.x
diff --git a/test/test_parameter_renaming.rb b/test/test_parameter_renaming.rb index abc1234..def5678 100644 --- a/test/test_parameter_renaming.rb +++ b/test/test_parameter_renaming.rb @@ -31,4 +31,15 @@ assert_equal 666, ExecJS.exec( shuffled ) end + + def test_references_updated + assert_nothing_raised do @shuffler = JsShuffle::Shuffler.new use: :parameter_renaming end + assert_no_match /parameter/, + @shuffler.shuffle( js: %Q( + function double(parameter) { + return parameter*2; + } + return double(333); + )) + end end
Add last test, which already passes
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'] = '5cb0ecc1c813bc5619e0f708b8015a4596a37d6c' +node.default['versions']['bash_it'] = '8bf641baec4316cebf1bc1fd2757991f902506dc'
Update bash-it sha to latest for chruby support * existing version is from Aug 2012 * changes: https://github.com/revans/bash-it/compare/5cb0ecc...8bf641b
diff --git a/spree_log_viewer.gemspec b/spree_log_viewer.gemspec index abc1234..def5678 100644 --- a/spree_log_viewer.gemspec +++ b/spree_log_viewer.gemspec @@ -16,5 +16,5 @@ s.require_path = 'lib' s.requirements << 'none' - s.add_dependency('spree_core', '>= 0.60.4') + s.add_dependency('spree_core', '>= 0.70.0') end
Revert "Retains compatibility with 0.60.4" This reverts commit 8a4f12d0f09626d9ada0bf76f20c417597cd034e.
diff --git a/yubioath.gemspec b/yubioath.gemspec index abc1234..def5678 100644 --- a/yubioath.gemspec +++ b/yubioath.gemspec @@ -6,7 +6,7 @@ spec.name = 'yubioath' spec.version = '0.0.1' spec.authors = ['James Ottaway'] - spec.email = ['[email protected]'] + spec.email = ['[email protected]'] spec.summary = 'Securely manage your 2FA tokens using your Yubikey NEO' spec.homepage = 'https://github.com/jamesottaway/yubioath' spec.license = 'MIT'
Update my email address in the gemspec
diff --git a/exercises/crypto-square/.meta/solutions/crypto_square.rb b/exercises/crypto-square/.meta/solutions/crypto_square.rb index abc1234..def5678 100644 --- a/exercises/crypto-square/.meta/solutions/crypto_square.rb +++ b/exercises/crypto-square/.meta/solutions/crypto_square.rb @@ -37,3 +37,7 @@ chunks.transpose.map{ |s| s.join('') } end end + +module BookKeeping + VERSION = 1 +end
Include BookKeeping version in crypto-square example solution
diff --git a/app/interactors/pavlov/search_helper.rb b/app/interactors/pavlov/search_helper.rb index abc1234..def5678 100644 --- a/app/interactors/pavlov/search_helper.rb +++ b/app/interactors/pavlov/search_helper.rb @@ -7,8 +7,8 @@ raise Pavlov::AccessDenied unless authorized? return [] if filtered_keywords.length == 0 - page = @options[:page] || 1 - row_count = @options[:row_count] || 20 + page = @page || 1 + row_count = @row_count || 20 results = Pavlov.query query_name, filtered_keywords, page, row_count results.keep_if { |result| valid_result? result}
Use Pavlov syntax for search interactor
diff --git a/rb_tuntap.gemspec b/rb_tuntap.gemspec index abc1234..def5678 100644 --- a/rb_tuntap.gemspec +++ b/rb_tuntap.gemspec @@ -26,4 +26,5 @@ spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rake-compiler" end
Add rake-compiler to development dependencies.