diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/bamboo-client.rb b/lib/bamboo-client.rb index abc1234..def5678 100644 --- a/lib/bamboo-client.rb +++ b/lib/bamboo-client.rb @@ -1,5 +1,6 @@ require "uri" require "restclient" +require "time" require "bamboo-client/version" require "bamboo-client/http"
Make sure 'time' is required.
diff --git a/lib/magnum/client.rb b/lib/magnum/client.rb index abc1234..def5678 100644 --- a/lib/magnum/client.rb +++ b/lib/magnum/client.rb @@ -20,5 +20,20 @@ @api_key = api_key @debug = false end + + # Send commit payload data to magnum + # + # @param [String] project API token + # @param [String] provider name (github, bitbucket, gitlab, etc) + # @param [Hash] payload data + # + def self.send_payload(project_token, provider, data) + response = Faraday.post("https://magnum-ci.com/api/v1/payload/#{provider}", + token: project_token, + payload: data + ) + + response.success? + end end end
Add method to send payload to api
diff --git a/lib/metadata_sync.rb b/lib/metadata_sync.rb index abc1234..def5678 100644 --- a/lib/metadata_sync.rb +++ b/lib/metadata_sync.rb @@ -19,7 +19,7 @@ logger.debug "Denormalised metadata, saving publication" success = publication.save if success - logger.into "Updated metadata for publication #{publication.id}" + logger.info "Updated metadata for publication #{publication.id}" else logger.error "Couldn't save updated metadata for publication #{publication.id}" end
Fix another of craig's typos ;-)
diff --git a/config/initializers/rollbar.rb b/config/initializers/rollbar.rb index abc1234..def5678 100644 --- a/config/initializers/rollbar.rb +++ b/config/initializers/rollbar.rb @@ -4,13 +4,4 @@ config.access_token = ENV['ROLLBAR_ACCESS_TOKEN'] config.enabled = false unless Rails.env.production? config.environment = ENV['ROLLBAR_ENV'].presence || Rails.env - - config.js_enabled = true if Rails.env.production? - config.js_options = { - accessToken: ENV['ROLLBAR_ACCESS_TOKEN'], - captureUncaught: true, - payload: { - environment: ENV['ROLLBAR_ENV'].presence || Rails.env - } - } end
Disable Rollbaar JavaScript catch feature
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index abc1234..def5678 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,9 +1,14 @@ require "sidekiq/throttled" Sidekiq::Throttled.setup! -if ENV["REDISCLOUD_URL"] +# The app could be provisioned with Redis cloud or with Heroku Redis, +# they use a different env variable, so check them both, and use the +# one that's there. +redis_url = ENV["REDISCLOUD_URL"] || ENV["REDIS_URL"] + +if redis_url Sidekiq.configure_server do |config| - config.redis = { url: ENV["REDISCLOUD_URL"] } + config.redis = { url: redis_url } poolsize = ( ENV["SIDEKIQ_DB_POOL_SIZE"] || ENV["SIDEKIQ_CONCURRENCY"] || "10").to_i ActiveRecord::Base.configurations[Rails.env]["pool"] = poolsize ActiveRecord::Base.establish_connection @@ -11,6 +16,6 @@ end Sidekiq.configure_client do |config| - config.redis = { url: ENV["REDISCLOUD_URL"] } + config.redis = { url: redis_url } end end
Allow Heroku Redis resource as well
diff --git a/lib/sprig/helpers.rb b/lib/sprig/helpers.rb index abc1234..def5678 100644 --- a/lib/sprig/helpers.rb +++ b/lib/sprig/helpers.rb @@ -2,10 +2,6 @@ module Helpers def seed_directory Sprig.configuration.directory - end - - def sprig_environment - Rails.env #TODO: make customizable end def sprig(directive_definitions)
Remove unused helper method and todo Will add todo as an issue in the repo
diff --git a/lib/tasks/specs.rake b/lib/tasks/specs.rake index abc1234..def5678 100644 --- a/lib/tasks/specs.rake +++ b/lib/tasks/specs.rake @@ -19,6 +19,7 @@ engine_name = engine_name_for_engine(engine_path) namespace engine_name do + desc "Run RSpec tests for engine \"#{engine_name}\"" task :rspec do success = execute_rspec_for_engine(engine_path) abort "Failure when running tests for engine \"#{engine_name}\"" unless success @@ -27,6 +28,7 @@ end namespace :all do + desc "Run RSpec tests for all engines" task :rspec do success = true @@ -38,6 +40,7 @@ end end + desc "Alias for openfoodnetwork:specs:engines:all:rspec" task rspec: "all:rspec" end end
Add description for Rake tasks
diff --git a/recipes/client.rb b/recipes/client.rb index abc1234..def5678 100644 --- a/recipes/client.rb +++ b/recipes/client.rb @@ -18,13 +18,6 @@ # limitations under the License. # -if node['platform_version'].to_f == 6.1 - windows_feature 'NetFx3' do - action :install - install_method :windows_feature_powershell - end -end - %w( native_client command_line_utils clr_types smo ps_extensions ).each do |pkg| package node['sql_server'][pkg]['package_name'] do source node['sql_server'][pkg]['url']
Remove .NET 3 installation on win2k8 No need for this anymore Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/Casks/unity.rb b/Casks/unity.rb index abc1234..def5678 100644 --- a/Casks/unity.rb +++ b/Casks/unity.rb @@ -1,6 +1,6 @@ cask :v1 => 'unity' do - version '4.6.0' - sha256 'ceeff727f8e66ebe00bd805468da27aa996bfcd5b3a455fe65516d9a2075a395' + version '4.6.1' + sha256 '3db6871de79794e272f64ae22c99ada0d481b5904ebab30318b57452fc987182' url "http://netstorage.unity3d.com/unity/unity-#{version}.dmg" homepage 'http://unity3d.com/unity/'
Upgrade Unity to version 4.6.1
diff --git a/lib/generators/styleguide/install/install_generator.rb b/lib/generators/styleguide/install/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/styleguide/install/install_generator.rb +++ b/lib/generators/styleguide/install/install_generator.rb @@ -10,7 +10,7 @@ end def create_route - route "match 'styleguide' => 'styleguide#index' if Rails.env.development?" + route "get 'styleguide' => 'styleguide#index' if Rails.env.development?" end def create_views
Use get instead of match to be compatible with Rails 4
diff --git a/ruby_life.gemspec b/ruby_life.gemspec index abc1234..def5678 100644 --- a/ruby_life.gemspec +++ b/ruby_life.gemspec @@ -3,22 +3,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'ruby_life/version' -Gem::Specification.new do |spec| - spec.name = "ruby_life" - spec.version = RubyLife::VERSION - spec.authors = ["Eno Compton 4"] - spec.email = ["eno4@ecom.com"] - spec.description = %q{A command line version of Conway's Game of Life} - spec.summary = %q{Observe cells as they live and die on the CLI.} - spec.homepage = "http://github.com/enocom/ruby_life" - spec.license = "MIT" +Gem::Specification.new do |gem| + gem.name = "ruby_life" + gem.version = RubyLife::VERSION + gem.authors = ["Eno Compton 4"] + gem.email = ["eno4@ecom.com"] + gem.description = %q{A command line version of Conway's Game of Life} + gem.summary = %q{Observe cells as they live and die on the CLI.} + gem.homepage = "http://github.com/enocom/ruby_life" + gem.license = "MIT" - spec.files = `git ls-files`.split($/) - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ["lib"] + gem.files = `git ls-files`.split($/) + gem.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } + gem.test_files = spec.files.grep(%r{^(test|spec|features)/}) + gem.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rake" - spec.add_development_dependency "rspec" + gem.add_development_dependency "bundler", "~> 1.3" + gem.add_development_dependency "rake" + gem.add_development_dependency "rspec" end
Change block variable name in gemspec
diff --git a/app/helpers/component_helper.rb b/app/helpers/component_helper.rb index abc1234..def5678 100644 --- a/app/helpers/component_helper.rb +++ b/app/helpers/component_helper.rb @@ -11,15 +11,15 @@ end if policy(ApiUser).index? - items << { text: 'APIs', href: api_users_path, active: is_current?(users_path) } + items << { text: 'APIs', href: api_users_path, active: is_current?(api_users_path) } end if policy(Doorkeeper::Application).index? - items << { text: 'Apps', href: doorkeeper_applications_path, active: is_current?(users_path) } + items << { text: 'Apps', href: doorkeeper_applications_path, active: is_current?(doorkeeper_applications_path) } end if policy(Organisation).index? - items << { text: 'Orgs', href: organisations_path, active: is_current?(users_path) } + items << { text: 'Orgs', href: organisations_path, active: is_current?(organisations_path) } end end
Fix bug in highlighting the active menu item
diff --git a/lita-excuses.gemspec b/lita-excuses.gemspec index abc1234..def5678 100644 --- a/lita-excuses.gemspec +++ b/lita-excuses.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = "lita-excuses" - spec.version = "0.0.5" + spec.version = "0.0.6" spec.authors = ["Mitch Dempsey"] spec.email = ["mrdempsey@gmail.com"] spec.description = %q{Adds a Lita handler to provide developer excuses} @@ -13,12 +13,12 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "lita", "~> 2.2" + spec.add_runtime_dependency "lita", ">= 2.2" spec.add_runtime_dependency "nokogiri" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" - spec.add_development_dependency "rspec", ">= 2.14" + spec.add_development_dependency "rspec", ">= 3.0.0.beta2" spec.add_development_dependency "simplecov" spec.add_development_dependency "coveralls"
Update gemspec for Lita 3.0 compatibility.
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,6 +1,6 @@ case node['platform'] when 'debian', 'ubuntu' - default['augeas']['packages'] = %w(libaugeas-dev ruby1.9.1-dev libxml2-dev pkg-config) + default['augeas']['packages'] = %w(libaugeas-dev pkg-config) else default['augeas']['packages'] = %w(augeas-devel) end
Remove packages not needed with omnibus chef
diff --git a/app/models/etsource/scenario.rb b/app/models/etsource/scenario.rb index abc1234..def5678 100644 --- a/app/models/etsource/scenario.rb +++ b/app/models/etsource/scenario.rb @@ -8,7 +8,7 @@ base_dir = "#{@etsource.export_dir}/presets" presets = [] - Dir.glob("#{base_dir}/*.yml").each do |f| + Dir.glob("#{base_dir}/**/*.yml").each do |f| attributes = YAML::load_file(f).with_indifferent_access presets << Preset.new(attributes) end
Load presets recursively from subfolders Adjusted loading of presets such that presets can be organized in subfolders
diff --git a/app/models/project/pull_repo.rb b/app/models/project/pull_repo.rb index abc1234..def5678 100644 --- a/app/models/project/pull_repo.rb +++ b/app/models/project/pull_repo.rb @@ -18,7 +18,8 @@ end def self.perform_async project_id - update_column :pull_in_progress, true + project = Project.find project_id + project.update_column :pull_in_progress, true Job.create! :project_id => project_id, :visible => false, :notes => 'PullRepo' end
Fix bug with pull in progress
diff --git a/docker/base/dockerfile_spec.rb b/docker/base/dockerfile_spec.rb index abc1234..def5678 100644 --- a/docker/base/dockerfile_spec.rb +++ b/docker/base/dockerfile_spec.rb @@ -18,6 +18,7 @@ expect(package("python")).to be_installed end + def os_version command("lsb_release -a").stdout end
Make change to test trigger
diff --git a/spec/eval_spec.rb b/spec/eval_spec.rb index abc1234..def5678 100644 --- a/spec/eval_spec.rb +++ b/spec/eval_spec.rb @@ -10,35 +10,33 @@ expect(Lasp::execute("(+ 1 (+ 2 2))")).to eq 5 end - describe "special forms" do - it "def defines values in the environment" do - Lasp::execute("(def five 5)") + it "def defines values in the environment" do + Lasp::execute("(def five 5)") - expect(Lasp::global_env[:five]).to eq 5 - end + expect(Lasp::global_env[:five]).to eq 5 + end - it "fn creates a function" do - expect(Lasp::execute("((fn (x) (+ x 1)) 10)")).to eq 11 - end + it "fn creates a function" do + expect(Lasp::execute("((fn (x) (+ x 1)) 10)")).to eq 11 + end - it "def can define functions" do - Lasp::execute("(def inc (fn (x) (+ x 1)))") - expect(Lasp::execute("(inc 1)")).to eq 2 - end + it "def can define functions" do + Lasp::execute("(def inc (fn (x) (+ x 1)))") + expect(Lasp::execute("(inc 1)")).to eq 2 + end - it "begin executes multiple statements" do - allow(STDOUT).to receive(:puts) - Lasp::execute("(begin (println 1) (println 2))") + it "begin executes multiple statements" do + allow(STDOUT).to receive(:puts) + Lasp::execute("(begin (println 1) (println 2))") - expect(STDOUT).to have_received(:puts).with(1).ordered - expect(STDOUT).to have_received(:puts).with(2).ordered - end + expect(STDOUT).to have_received(:puts).with(1).ordered + expect(STDOUT).to have_received(:puts).with(2).ordered + end - it "if evaluates only the correct form" do - expect(Lasp::execute("(if (= 1 1) true false)")).to eq true - expect(Lasp::execute("(if (= 1 2) true false)")).to eq false - expect(Lasp::execute("(if (= 1 2) true)")).to eq nil - end + it "if evaluates only the correct form" do + expect(Lasp::execute("(if (= 1 1) true false)")).to eq true + expect(Lasp::execute("(if (= 1 2) true false)")).to eq false + expect(Lasp::execute("(if (= 1 2) true)")).to eq nil end end end
Remove extra describe block in test
diff --git a/spec/find_spec.rb b/spec/find_spec.rb index abc1234..def5678 100644 --- a/spec/find_spec.rb +++ b/spec/find_spec.rb @@ -8,7 +8,8 @@ sims = simctl.usable_simulators os_names = sims.map(&:os_name).uniq.sort - expect(sims.count).to eq 15 + # This check is silly, but I am too lazy to come up with sth better + expect(sims.count).to eq (ENV['TRAVIS'] == 'true') ? 73 : 15 expect(sims.first.name).to eq 'iPhone 4s' expect(sims.first.os_name).to eq 'iOS' expect(sims.last.name).to eq 'Apple Watch - 42mm'
Add Travis sim count as alternative
diff --git a/spec/team_spec.rb b/spec/team_spec.rb index abc1234..def5678 100644 --- a/spec/team_spec.rb +++ b/spec/team_spec.rb @@ -29,4 +29,13 @@ expect(t.player_count).to eql 2 end end + describe 'Team#add_player' do + it "Should throw an error if player is already added." do + t = Team.new 'Devils' + + t.add_player 'Angie', 0 + + expect {t.add_player 'Angie', 0}.to raise_error + end + end end
Add should throw an error if player is already added.
diff --git a/split-api.gemspec b/split-api.gemspec index abc1234..def5678 100644 --- a/split-api.gemspec +++ b/split-api.gemspec @@ -21,6 +21,6 @@ gem.add_development_dependency 'bundler', '~> 1.0' gem.add_development_dependency 'rspec', '~> 2.6.0' - gem.add_development_dependency 'rack-test', '~> 0.6' + gem.add_development_dependency 'rack-test', '~> 1.1' gem.add_development_dependency 'rake', '~> 12.0' end
Update rack-test requirement from ~> 0.6 to ~> 1.1 Updates the requirements on [rack-test](https://github.com/rack-test/rack-test) to permit the latest version. - [Release notes](https://github.com/rack-test/rack-test/releases) - [Changelog](https://github.com/rack-test/rack-test/blob/master/History.md) - [Commits](https://github.com/rack-test/rack-test/commits/v1.1.0) Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/lib/abyss-navigation-rails.rb b/lib/abyss-navigation-rails.rb index abc1234..def5678 100644 --- a/lib/abyss-navigation-rails.rb +++ b/lib/abyss-navigation-rails.rb @@ -1 +1,3 @@+$:.unshift(File.expand_path('..', __FILE__)) unless $:.include? File.expand_path('..', __FILE__) + require "abyss/navigation"
Add the lib directory to the load path
diff --git a/lib/app/helpers/esi_helper.rb b/lib/app/helpers/esi_helper.rb index abc1234..def5678 100644 --- a/lib/app/helpers/esi_helper.rb +++ b/lib/app/helpers/esi_helper.rb @@ -11,7 +11,7 @@ env = ENV['RAILS_ENV'] # If we were passed a url... - if resource =~ /^(http:\/\/)?[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu)[a-zA-Z0-9\-\.\/]+$/i + if resource =~ /^(http:\/\/)?[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu)[a-zA-Z0-9\-\.\/]*$/i # ...fetch and render an external resource... case env when 'production'
Fix a bug where url is not recognized.
diff --git a/cama_meta_tag.gemspec b/cama_meta_tag.gemspec index abc1234..def5678 100644 --- a/cama_meta_tag.gemspec +++ b/cama_meta_tag.gemspec @@ -9,7 +9,7 @@ s.version = CamaMetaTag::VERSION s.authors = ["Owen Peredo"] s.email = ["owenperedo@gmail.com"] - s.homepage = "" + s.homepage = "https://github.com/owen2345/camaleon-cms-seo" s.summary = "Permit to manage the seo attributes for each page of Camaleon CMS." s.description = "Permit to manage the seo attributes for each page of Camaleon CMS." s.license = "MIT"
Add repo url to gemspec
diff --git a/lib/compath/yaml_formatter.rb b/lib/compath/yaml_formatter.rb index abc1234..def5678 100644 --- a/lib/compath/yaml_formatter.rb +++ b/lib/compath/yaml_formatter.rb @@ -31,7 +31,7 @@ lambda do |yaml| lines = yaml.lines.map do |line| if m = QUOTED_KEY_REGEXP.match(line) - "#{m[:key]}: #{m[:value]}" + "#{m[:key]}: #{m[:value]}".rstrip else line.chomp end
Remove trailing space from a filter generated line
diff --git a/lib/hn_history/jobs/photos.rb b/lib/hn_history/jobs/photos.rb index abc1234..def5678 100644 --- a/lib/hn_history/jobs/photos.rb +++ b/lib/hn_history/jobs/photos.rb @@ -1,27 +1,35 @@ module HnHistory - Clockwork.every(5.minutes, 'photos.new') do - current_time = Time.now.utc + module Jobs + class << self + def get_photo + current_time = Time.now.utc - puts "Photo for: #{current_time.xmlschema(3)}" + puts "Photo for: #{current_time.xmlschema(3)}" - entries = RubyHackernews::Entry.all.select(&:id) + entries = RubyHackernews::Entry.all.select(&:id) - return if entries.length == 0 + return if entries.length == 0 - photo = HnHistory::Models::Photo.new - photo.created_at = current_time.to_i - photo.save + photo = HnHistory::Models::Photo.new + photo.created_at = current_time.to_i + photo.save - entries.map do |e| - entry = HnHistory::Models::Entry.new - entry.entry_id = e.id - entry.title = e.link.title - entry.link = e.link.href - entry.site = e.link.site - entry.upvotes = e.voting.score - entry.position = e.number - entry.photo = photo - entry.save + entries.map do |e| + entry = HnHistory::Models::Entry.new + entry.entry_id = e.id + entry.title = e.link.title + entry.link = e.link.href + entry.site = e.link.site + entry.upvotes = e.voting.score + entry.position = e.number + entry.photo = photo + entry.save + end + end end end end + +Clockwork.every(5.minutes, 'photos.new') do + HnHistory::Jobs.get_photo +end
Call method for job, easier to debug
diff --git a/lib/loga/revision_strategy.rb b/lib/loga/revision_strategy.rb index abc1234..def5678 100644 --- a/lib/loga/revision_strategy.rb +++ b/lib/loga/revision_strategy.rb @@ -1,4 +1,6 @@ # rubocop:disable Style/SpecialGlobalVars +require 'active_support/core_ext/object/blank' + module Loga class RevisionStrategy DEFAULT_REVISION = 'unknown.sha'.freeze @@ -7,7 +9,7 @@ def call(service_version = :git) if service_version == :git fetch_from_git || read_from_file || DEFAULT_REVISION - elsif service_version.empty? + elsif service_version.blank? DEFAULT_REVISION else service_version.strip
Use .blank? instead of .empty?
diff --git a/lib/spinning_cursor/parser.rb b/lib/spinning_cursor/parser.rb index abc1234..def5678 100644 --- a/lib/spinning_cursor/parser.rb +++ b/lib/spinning_cursor/parser.rb @@ -24,7 +24,7 @@ # Getter and setter for the action block # def action(&block) - @action = block unless block.nil? + @action = block if block @action end
Remove unecessary 'nil?' test on 'block'
diff --git a/lita-send_with_option.gemspec b/lita-send_with_option.gemspec index abc1234..def5678 100644 --- a/lita-send_with_option.gemspec +++ b/lita-send_with_option.gemspec @@ -3,9 +3,9 @@ spec.version = "0.0.1" spec.authors = ["Shu Sugimoto"] spec.email = ["shu@su.gimo.to"] - spec.description = %q{TODO: Add a description} - spec.summary = %q{TODO: Add a summary} - spec.homepage = "TODO: Add a homepage" + spec.description = %q{Lita extension to add send_with_option capability} + spec.summary = %q{This extension will modify core classes and adds send_with_option capability can be used with adapters.} + spec.homepage = "https://github.com/s2ugimot/lita-send_with_option" spec.license = "MIT" spec.metadata = { "lita_plugin_type" => "extension" }
Resolve bundler warnings in gemspec file
diff --git a/graphql-client.gemspec b/graphql-client.gemspec index abc1234..def5678 100644 --- a/graphql-client.gemspec +++ b/graphql-client.gemspec @@ -13,6 +13,8 @@ s.add_dependency "graphql", "~> 1.2" s.add_development_dependency "actionpack", ">= 3.2.22", "< 6.0" + s.add_development_dependency "erubi", "~> 1.6" + s.add_development_dependency "erubis", "~> 2.7" s.add_development_dependency "minitest", "~> 5.9" s.add_development_dependency "rake", "~> 11.2" s.add_development_dependency "rubocop-github", "~> 0.3"
Add erubi as development dependency
diff --git a/graphql-client.gemspec b/graphql-client.gemspec index abc1234..def5678 100644 --- a/graphql-client.gemspec +++ b/graphql-client.gemspec @@ -8,11 +8,10 @@ s.files = Dir["README.md", "LICENSE", "lib/**/*.rb"] - # TODO: Make Rails dependencies optional - s.add_dependency "actionpack", ">= 3.0", "< 6.0" s.add_dependency "activesupport", ">= 3.0", "< 6.0" s.add_dependency "graphql", "~> 0.18" + s.add_development_dependency "actionpack", ">= 3.0", "< 6.0" s.add_development_dependency "minitest", "~> 5.9" s.add_development_dependency "rake", "~> 11.2"
Make action pack dependency optional
diff --git a/rom-http.gemspec b/rom-http.gemspec index abc1234..def5678 100644 --- a/rom-http.gemspec +++ b/rom-http.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_runtime_dependency 'rom', '~> 0.8', '>= 0.8.0' + spec.add_runtime_dependency 'rom', '0.9.0.beta1' spec.add_runtime_dependency 'equalizer', '~> 0.0', '>= 0.0.9' spec.add_runtime_dependency 'thread_safe'
Update rom dependency to 0.9.0.beta1
diff --git a/spec/nark/plugin_spec.rb b/spec/nark/plugin_spec.rb index abc1234..def5678 100644 --- a/spec/nark/plugin_spec.rb +++ b/spec/nark/plugin_spec.rb @@ -15,8 +15,6 @@ it "should not include instance_methods" do Nark.available_plugins.should_not include 'instance_methods' end - - it "provides a list of all available plugins" it "automatically includes a defined module" do Nark::Plugin.define :requests, &requests
Remove pending spec, we'll deal with that later
diff --git a/spec/unit/errors_spec.rb b/spec/unit/errors_spec.rb index abc1234..def5678 100644 --- a/spec/unit/errors_spec.rb +++ b/spec/unit/errors_spec.rb @@ -0,0 +1,49 @@+ +# +# specifying flor +# +# Sun Feb 5 19:48:17 JST 2017 +# + +require 'spec_helper' + + +describe 'Flor unit' do + + before :each do + + @unit = Flor::Unit.new('envs/test/etc/conf.json') + @unit.conf['unit'] = 'uerrs' + @unit.hook('journal', Flor::Journal) + @unit.storage.delete_tables + @unit.storage.migrate + @unit.start + end + + after :each do + + @unit.shutdown + end + + describe 'error' do + + it 'lets the execution be saved to storage' do + + r = + @unit.launch(%{ + sequence + fail "nada" + }, wait: true) + + expect(r['point']).to eq('failed') + sleep 0.3 + + expect(@unit.executions.count).to eq(1) + + e = @unit.executions.first + + expect(e.data['nodes'].keys).to eq(%w[ 0 0_0 ]) + end + end +end +
Add unit vs error spec (prep put_execution rework)
diff --git a/sanguine.gemspec b/sanguine.gemspec index abc1234..def5678 100644 --- a/sanguine.gemspec +++ b/sanguine.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "sanguine" - spec.version = "1.1.2" + spec.version = "1.1.3" spec.authors = ["Austen Madden"] spec.email = ["maddenausten@gmail.com"]
Update minor version again because shennanigans
diff --git a/spec/app_spec.rb b/spec/app_spec.rb index abc1234..def5678 100644 --- a/spec/app_spec.rb +++ b/spec/app_spec.rb @@ -27,7 +27,11 @@ context "good args" do it "spits out a buzzfeedish title vaguely related to the PR" do post '/command', text: good_url - ap JSON.parse(last_response.body) + ap begin + JSON.parse(last_response.body) + rescue + { ERROR: "FAILED JSON PARSE" } + end expect(last_response.body).to include "in_channel" end end
Fix bad parse output in a spec
diff --git a/lib/fog/hp/requests/cdn/head_container.rb b/lib/fog/hp/requests/cdn/head_container.rb index abc1234..def5678 100644 --- a/lib/fog/hp/requests/cdn/head_container.rb +++ b/lib/fog/hp/requests/cdn/head_container.rb @@ -11,12 +11,10 @@ # ==== Returns # * response<~Excon::Response>: # * headers<~Hash>: - # * 'X-CDN-Enabled'<~Boolean> - cdn status for container - # * 'X-CDN-URI'<~String> - cdn url for this container - # * 'X-TTL'<~String> - integer seconds before data expires, defaults to 86400 (1 day) + # * 'X-Cdn-Enabled'<~Boolean> - cdn status for container + # * 'X-Cdn-Uri'<~String> - cdn url for this container + # * 'X-Ttl'<~String> - integer seconds before data expires, defaults to 86400 (1 day) # * 'X-Log-Retention'<~Boolean> - ? - # * 'X-User-Agent-ACL'<~String> - ? - # * 'X-Referrer-ACL'<~String> - ? def head_container(container) response = request( :expects => 204,
Update inline docs as per real responses.
diff --git a/guard-test.gemspec b/guard-test.gemspec index abc1234..def5678 100644 --- a/guard-test.gemspec +++ b/guard-test.gemspec @@ -15,7 +15,7 @@ s.required_ruby_version = '>= 1.9.2' - s.add_runtime_dependency 'guard', '>= 2.0.0.pre.3' + s.add_runtime_dependency 'guard', '~> 2.0' s.add_runtime_dependency 'test-unit', '~> 2.2' s.add_development_dependency 'bundler'
Update Guard dependency to ~> 2.0
diff --git a/worker/lib/Job/job.rb b/worker/lib/Job/job.rb index abc1234..def5678 100644 --- a/worker/lib/Job/job.rb +++ b/worker/lib/Job/job.rb @@ -2,11 +2,9 @@ # Licence:: See Licence.rdoc module Job - class Job - @project_name - @povray_arguments - @povray_scene_file_name - @partial_image_file_name + class Job + + attr_accessor :project_name, :povray_arguments, :povray_scene_file_name, :partial_image_file_name def initialize(project_name, povray_arguments, povray_scene_file_name, partial_image_file_name) @project_name = project_name @@ -22,21 +20,6 @@ def self.deserialize(serialized_job) Marshal.load(serialized_job) end - - def project_name - @project_name - end - - def povray_arguments - @povray_arguments - end - - def povray_scene_file_name - @povray_scene_file_name - end - - def partial_image_file_name - @partial_image_file_name - end + end end
Use Attr_accessor for attributes in Job class
diff --git a/jquery-cdn.gemspec b/jquery-cdn.gemspec index abc1234..def5678 100644 --- a/jquery-cdn.gemspec +++ b/jquery-cdn.gemspec @@ -1,4 +1,4 @@-require_relative 'lib/jquery-cdn/version' +require File.expand_path('../lib/jquery-cdn/version', __FILE__) Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY
Fix require for old Ruby
diff --git a/lib/api/routes/core.rb b/lib/api/routes/core.rb index abc1234..def5678 100644 --- a/lib/api/routes/core.rb +++ b/lib/api/routes/core.rb @@ -5,6 +5,20 @@ configure do set :root, ExercismAPI::ROOT + enable :raise_errors + end + + configure :production do + disable :show_exceptions + end + + configure :development do + enable :show_exceptions + end + + error 500 do + Bugsnag.auto_notify($!) + {error: "Sorry, something went wrong. We've been notified and will look into it."}.to_json end before do
Add bugsnag to API side of things
diff --git a/lib/deep_cover/node.rb b/lib/deep_cover/node.rb index abc1234..def5678 100644 --- a/lib/deep_cover/node.rb +++ b/lib/deep_cover/node.rb @@ -1,6 +1,11 @@ module DeepCover - class Node + class Node # Reopened in base + CLASSES = [] + def self.inherited(parent) + CLASSES << parent + super + end end require_relative_dir 'node/mixin' require_relative 'node/base'
Build list of all Node subclasses
diff --git a/kittenizer.gemspec b/kittenizer.gemspec index abc1234..def5678 100644 --- a/kittenizer.gemspec +++ b/kittenizer.gemspec @@ -19,6 +19,6 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", ">= 1.8" - spec.add_development_dependency "rake", "~> 12.3" + spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "rspec" end
Update rake requirement from ~> 12.3 to ~> 13.0 Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v12.3.0...v13.0.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/lib/simctl/executor.rb b/lib/simctl/executor.rb index abc1234..def5678 100644 --- a/lib/simctl/executor.rb +++ b/lib/simctl/executor.rb @@ -9,7 +9,10 @@ $stderr.puts command if ENV['SIMCTL_DEBUG'] Open3.popen3(command) do |stdin, stdout, stderr, result| output = stdout.read - raise StandardError.new(output) if result.value.to_i > 0 + if result.value.to_i > 0 + output = stderr.read if output.empty? + raise StandardError.new(output) + end return unless block_given? if looks_like_json?(output) yield JSON.parse(output)
Read stderr if stdout was empty and exit_code != 0
diff --git a/lib/sub_diff/differ.rb b/lib/sub_diff/differ.rb index abc1234..def5678 100644 --- a/lib/sub_diff/differ.rb +++ b/lib/sub_diff/differ.rb @@ -1,6 +1,6 @@ module SubDiff class Differ < Struct.new(:diff_collection, :diff_method) - Match = Struct.new(:match, :prefix, :suffix, :replacement) do + class Match < Struct.new(:match, :prefix, :suffix, :replacement) alias_method :to_str, :match end
Make Match a class instead of a Struct
diff --git a/lib/tubesock/hijack.rb b/lib/tubesock/hijack.rb index abc1234..def5678 100644 --- a/lib/tubesock/hijack.rb +++ b/lib/tubesock/hijack.rb @@ -27,7 +27,7 @@ included do def hijack - sock = Tubesock.hijack(env) + sock = Tubesock.hijack(request.env) yield sock sock.onclose do ActiveRecord::Base.clear_active_connections! if defined? ActiveRecord
Fix `env` deprecated in Rails 5.0 `env` is deprecated in Ralis 5.0 and removed in 5.1, this updates the code to use `request.env` instead: https://github.com/rails/rails/issues/23294
diff --git a/lib/gitlab/util.rb b/lib/gitlab/util.rb index abc1234..def5678 100644 --- a/lib/gitlab/util.rb +++ b/lib/gitlab/util.rb @@ -12,6 +12,27 @@ def set_env_if_missing(key, value) ENV[key] ||= value&.strip end + + def section(name, description = name, &block) + section_start(name, description) + + yield + + section_end(name) + end + + def section_start(name, description = name) + return unless ENV['CI'] + + @section_name = name + $stdout.puts "section_start:#{Time.now.to_i}:#{name}\r\e[0K#{description}" + end + + def section_end(name = @section_name) + return unless ENV['CI'] + + $stdout.puts "section_end:#{Time.now.to_i}:#{name}\r\e[0K" + end end end end
Add section, section_start and section_end helpers
diff --git a/lib/gitlab/util.rb b/lib/gitlab/util.rb index abc1234..def5678 100644 --- a/lib/gitlab/util.rb +++ b/lib/gitlab/util.rb @@ -0,0 +1,17 @@+module Gitlab + class Util + class << self + def get_env(key) + ENV[key]&.strip + end + + def set_env(key, value) + ENV[key] = value&.strip + end + + def set_env_if_missing(key, value) + ENV[key] ||= value&.strip + end + end + end +end
Add helper method for stripping whitespace off env variables
diff --git a/lib/padrino-rpm.rb b/lib/padrino-rpm.rb index abc1234..def5678 100644 --- a/lib/padrino-rpm.rb +++ b/lib/padrino-rpm.rb @@ -32,8 +32,9 @@ end Padrino.before_load do + require 'new_relic/rack_app' + if Padrino.env == :development - require 'new_relic/rack_app' Padrino.use NewRelic::Rack::DeveloperMode end end
Load newrelic/rack_app in all environments
diff --git a/rs-api-tools.gemspec b/rs-api-tools.gemspec index abc1234..def5678 100644 --- a/rs-api-tools.gemspec +++ b/rs-api-tools.gemspec @@ -10,8 +10,8 @@ s.files = Dir['lib/*.rb'] s.bindir = 'bin' s.executables = Dir.entries(s.bindir) - [".", "..", '.gitignore'] - s.homepage = - 'https://github.com/flaccid/rs-api-tools' + s.homepage = 'https://github.com/flaccid/rs-api-tools' + s.add_dependency 'activesupport' s.add_dependency "json", ">= 1.4.4" s.add_dependency 'rest_connection' s.add_dependency 'right_api_client'
Add activesupport to gemspec as a dep.
diff --git a/ruby/arrays_drill.rb b/ruby/arrays_drill.rb index abc1234..def5678 100644 --- a/ruby/arrays_drill.rb +++ b/ruby/arrays_drill.rb @@ -0,0 +1,22 @@+def inventory(arr) + return arr +end + + +store = [] + +store << "candy" << "gum" << "chips" << "soda" << "ice" + +store.delete_at(2) + +store.insert(2, "burrito") + +store.delete("candy") + +store.include?("gum") +"it is #{store.include?("gum")} that this store includes gum" + +rival_store = ["cigarettes", "beer", "wine"] + +# p rival_store + store +p inventory(["candy", "gum", "chips"])
Create method to return array
diff --git a/lxc-server.gemspec b/lxc-server.gemspec index abc1234..def5678 100644 --- a/lxc-server.gemspec +++ b/lxc-server.gemspec @@ -12,6 +12,7 @@ s.add_development_dependency 'rake' s.add_development_dependency 'rspec', '~> 2.11' s.add_development_dependency 'simplecov', '~> 0.4' + s.add_development_dependency 'rack-test', '~> 0.6' s.add_runtime_dependency 'lxc-ruby', '~> 0.2' s.add_runtime_dependency 'sinatra', '~> 1.3'
Add rack-test dependency for tests
diff --git a/DSAWSOperations.podspec b/DSAWSOperations.podspec index abc1234..def5678 100644 --- a/DSAWSOperations.podspec +++ b/DSAWSOperations.podspec @@ -0,0 +1,17 @@+Pod::Spec.new do |s| + s.name = "DSAWSOperations" + s.version = "0.5" + s.summary = "Small framework to make the AWS IOS SDK less verbose and asynchronous." + s.description = <<-DESC + A small framework designed to take some of the pain out of using the AWS IOS SDK, which can get very verbose and is synchronous out of the box. + DESC + s.homepage = "http://github.com/DestoAU/DSAWSOperations" + s.license = 'MIT' + s.author = { "Rob Amos" => "robert.amos@desto.com.au" } + s.source = { :git => "https://github.com/DestoAU/DSAWSOperations.git", :tag => "0.5" } + s.platform = :ios, '6.0' + s.source_files = 'DSAWSOperations', 'DSAWSOperations/**/*.{h,m}' + s.exclude_files = 'Classes/Exclude' + s.frameworks = 'AWSAutoScaling', 'AWSCloudWatch', 'AWSDynamoDB', 'AWSEC2', 'AWSElasticLoadBalancing', 'AWSRuntime', 'AWSS3', 'AWSSecurityTokenService', 'AWSSES', 'AWSSimpleDB', 'AWSSNS', 'AWSSQS' + s.requires_arc = true +end
Add first cut of pod spec.
diff --git a/spec/services/ci/send_pipeline_notification_service_spec.rb b/spec/services/ci/send_pipeline_notification_service_spec.rb index abc1234..def5678 100644 --- a/spec/services/ci/send_pipeline_notification_service_spec.rb +++ b/spec/services/ci/send_pipeline_notification_service_spec.rb @@ -1,8 +1,12 @@ require 'spec_helper' describe Ci::SendPipelineNotificationService, services: true do + let(:pipeline) do + create(:ci_pipeline, project: project, sha: project.commit('master').sha) + end + + let(:project) { create(:project) } let(:user) { create(:user) } - let(:pipeline) { create(:ci_pipeline, user: user, status: status) } subject{ described_class.new(pipeline) } describe '#execute' do
Fix the other missing commit
diff --git a/lib/sparkle_motion/hue/ssdp.rb b/lib/sparkle_motion/hue/ssdp.rb index abc1234..def5678 100644 --- a/lib/sparkle_motion/hue/ssdp.rb +++ b/lib/sparkle_motion/hue/ssdp.rb @@ -7,7 +7,7 @@ class SSDP def scan raw = Frisky::SSDP - .search("IpBridge") + .search("IpBridge", ttl: 30) .select { |resp| ssdp_response?(resp) } .map { |resp| ssdp_extract(resp) } .select { |resp| resp["name"] == "upnp:rootdevice" }
Add a longer TTL to facilitate bridges being slow during discovery.
diff --git a/test/html_test.rb b/test/html_test.rb index abc1234..def5678 100644 --- a/test/html_test.rb +++ b/test/html_test.rb @@ -1,8 +1,9 @@ require 'test_helper' -DocTest.examples_path = ['test/examples/html', 'test/examples/asciidoc-html'] +DocTest.examples_path.unshift 'test/examples/html', 'test/examples/asciidoc-html' class HtmlTest < DocTest::Test converter_opts backend_name: 'html', dialect: 'latex' - generate_tests! DocTest::HTML::ExamplesSuite + html_suite = DocTest::HTML::ExamplesSuite.new paragraph_xpath: './div/p/node()' + generate_tests! html_suite end
Enable using default tests for html conversion This includes a fix to the default xpath used to select the generated inline output. Because asciidoctor-doctest development in branch dev is mostly incompatible with the latex branch now, I'm not submitting this upstream. We should rebase asap.
diff --git a/test/note_test.rb b/test/note_test.rb index abc1234..def5678 100644 --- a/test/note_test.rb +++ b/test/note_test.rb @@ -8,7 +8,9 @@ @total_frames = (@duration * @sample_rate).to_i @cycles_per_frame = @frequency / @sample_rate @sine_wave_cycle = 2 * Math::PI * @cycles_per_frame + @samples = samples_helper @note = MusicTheory::Note.new(frequency: @frequency, duration: @duration) + @note_2 = MusicTheory::Note.new(frequency: @frequency, duration: @duration, distort: true) end def test_total_frames @@ -24,12 +26,35 @@ end def test_samples + assert_equal @samples, @note.samples + end + + def test_distort! + assert_equal distort_helper, @note_2.samples + end + + private + + def samples_helper phase = 0 samples = @total_frames.times.map do sample = (Math.sin phase).to_f phase += @sine_wave_cycle sample end - assert_equal samples, @note.samples + samples + end + + def distort_helper + distorted_samples = @samples.map do |sample| + negative = sample < 0 + sample *= 8.to_f + if sample.abs > 5 + sample = 5 + sample *= -1 if negative + end + sample /= 8.to_f + end + distorted_samples end end
Add test for distort! and private helper methods
diff --git a/pakyow-core/lib/core/middleware/static.rb b/pakyow-core/lib/core/middleware/static.rb index abc1234..def5678 100644 --- a/pakyow-core/lib/core/middleware/static.rb +++ b/pakyow-core/lib/core/middleware/static.rb @@ -10,7 +10,7 @@ response = Rack::Response.new catch(:halt) do - Pakyow.app.send_file!(File.join(Configuration::Base.app.public_dir, env['PATH_INFO'])) + Pakyow.app.send(File.open(File.join(Configuration::Base.app.public_dir, env['PATH_INFO']))) end else @app.call(env)
Change `send_file!` reference to `send` in Static middleware
diff --git a/config/initializers/csp.rb b/config/initializers/csp.rb index abc1234..def5678 100644 --- a/config/initializers/csp.rb +++ b/config/initializers/csp.rb @@ -3,11 +3,10 @@ report_only: Rails.env.production?, # default: false preserve_schemes: true, # default: false. - default_src: %w(* 'unsafe-inline' 'unsafe-eval' + default_src: %w(* 'unsafe-inline' 'unsafe-eval' data: *.dropboxusercontent.com -*.google-analytics.com *.googleapis.com *.google.com -*.facebook.net *.facebook.com -*.twitter.com +*.google-analytics.com *.googleapis.com *.google.com *.gstatic.com +*.facebook.net *.facebook.com *.twitter.com *.hatena.ne.jp *.st-hatena.com *.slidesharecdn.com *.slideshare.net), report_uri: ["/csp_report?report_only=#{Rails.env.production?}"]
Add 'data:' and other missing domains to SecureHeaders
diff --git a/recipes/database_mysql.rb b/recipes/database_mysql.rb index abc1234..def5678 100644 --- a/recipes/database_mysql.rb +++ b/recipes/database_mysql.rb @@ -26,6 +26,8 @@ ## Create the GitLab database & grant all privileges on database gitlab['environments'].each do |environment| mysql_database "gitlabhq_#{environment}" do + encoding "utf8" + collation "utf8_unicode_ci" connection mysql_connection action :create end
Add encoding and collation to the db creation.
diff --git a/app/controllers/active_storage/representations_controller.rb b/app/controllers/active_storage/representations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/active_storage/representations_controller.rb +++ b/app/controllers/active_storage/representations_controller.rb @@ -8,11 +8,23 @@ def show expires_in 1.year, public: true - variant = @blob.representation(params[:variation_key]).processed + type = @blob.content_type || DEFAULT_SEND_FILE_TYPE + + if webp? + variant = @blob.variant({convert: 'web'}).processed + type = 'image/webp' + else + variant = @blob.representation(params[:variation_key]).processed + end send_data @blob.service.download(variant.key), - type: @blob.content_type || DEFAULT_SEND_FILE_TYPE, - disposition: 'inline' + type: type, disposition: 'inline' + end + + private + + def webp? + request.headers['Accept'] =~ /image\/webp/ end end end
Return webp if browser supports it
diff --git a/refinerycms-forms.gemspec b/refinerycms-forms.gemspec index abc1234..def5678 100644 --- a/refinerycms-forms.gemspec +++ b/refinerycms-forms.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "refinerycms-forms" - s.version = "2.0.1" + s.version = "2.0.0" s.summary = "Form generator for Refinery CMS v4.0" s.description = "Form generator for Refinery CMS v4.0 (rails generate refinery:form)" s.homepage = "http://refinerycms.com"
Revert version change (2.0.0 not released yet)
diff --git a/spec/lib/vault/rails/json_serializer_spec.rb b/spec/lib/vault/rails/json_serializer_spec.rb index abc1234..def5678 100644 --- a/spec/lib/vault/rails/json_serializer_spec.rb +++ b/spec/lib/vault/rails/json_serializer_spec.rb @@ -34,7 +34,7 @@ it { is_expected.to eq(nil) } end - context "with an empty string" do + context "with an empty string (only possible if column has a default)" do let(:raw) { "" } it { is_expected.to eq(nil) } end
Clarify test for deserializing an empty string
diff --git a/tests/run_ruby.rb b/tests/run_ruby.rb index abc1234..def5678 100644 --- a/tests/run_ruby.rb +++ b/tests/run_ruby.rb @@ -1,3 +1,4 @@+# NOTE: Requires `gem install http` require 'http' r = HTTP.post("http://localhost:8000/tag", :body => "Fördomen har alltid sin rot i vardagslivet - Olof Palme") puts r.to_s
Add note on how to install test dependency.
diff --git a/db/migrate/20170330080918_associate_datasets_with_commits.rb b/db/migrate/20170330080918_associate_datasets_with_commits.rb index abc1234..def5678 100644 --- a/db/migrate/20170330080918_associate_datasets_with_commits.rb +++ b/db/migrate/20170330080918_associate_datasets_with_commits.rb @@ -3,9 +3,10 @@ add_reference :commits, :dataset, index: true Commit.all.each do |commit| - dataset = Dataset.find_by(geo_id: commit.dataset_area) - commit.dataset_id = dataset.id - commit.save + if dataset = Dataset.find_by(geo_id: commit.dataset_area) + commit.dataset_id = dataset.id + commit.save + end end remove_column :commits, :dataset_area
Fix migration for dataset commmits
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index abc1234..def5678 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -13,7 +13,7 @@ RSpec.configure do |config| config.infer_spec_type_from_file_location! - config.include Devise::TestHelpers, type: :controller + config.include Devise::Test::ControllerHelpers, type: :controller config.before(:each) do DatabaseCleaner.strategy = :truncation
Remove deprication warning around Devise::TestHelpers
diff --git a/omf_common/test/logger_spec.rb b/omf_common/test/logger_spec.rb index abc1234..def5678 100644 --- a/omf_common/test/logger_spec.rb +++ b/omf_common/test/logger_spec.rb @@ -5,9 +5,10 @@ describe OmfCommon::Logger do describe "when used to log message" do it "must print a proper log message" do - Proc.new do + stdout, stderr = capture_io do OmfCommon::Logger.instance.logger.debug 'DEBUG MESSAGE' - end.must_output "#{Time.now.to_s} [DEBUG] DEBUG MESSAGE\n" + end + stdout.must_match /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} \+\d{4} \[DEBUG\] DEBUG MESSAGE/ end end end
Use capture_io instead of must_output in minitest
diff --git a/rack-syntax-highlighter.gemspec b/rack-syntax-highlighter.gemspec index abc1234..def5678 100644 --- a/rack-syntax-highlighter.gemspec +++ b/rack-syntax-highlighter.gemspec @@ -4,7 +4,7 @@ Gem::Specification.new do |gem| gem.authors = ["Glenn Gillen"] gem.email = ["me@glenngillen.com"] - gem.description = %q{TODO: Write a gem description} + gem.description = %q{} gem.summary = %q{TODO: Write a gem summary} gem.homepage = "" @@ -15,5 +15,7 @@ gem.require_paths = ["lib"] gem.version = Rack::Syntax::Highlighter::VERSION - gem.add_dependency 'rack-plastic', '~>0.1.3' + gem.add_dependency 'rack-plastic', '~> 0.1.3' + gem.add_dependency 'albino', '~> 1.3.3' + gem.add_dependency 'pygmentize', '~> 0.0.3' end
Add albino and pygmentize dependencies.
diff --git a/services/importer/lib/importer/ogrinfo.rb b/services/importer/lib/importer/ogrinfo.rb index abc1234..def5678 100644 --- a/services/importer/lib/importer/ogrinfo.rb +++ b/services/importer/lib/importer/ogrinfo.rb @@ -35,7 +35,7 @@ def run if !@executed stdout, stderr, status = Open3.capture3(command) - @raw_output = stdout + @raw_output = stdout.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '?') @exit_code = status.to_i @executed = true end
Make it resilient to encoding issues
diff --git a/docs/config/deploy.rb b/docs/config/deploy.rb index abc1234..def5678 100644 --- a/docs/config/deploy.rb +++ b/docs/config/deploy.rb @@ -13,7 +13,10 @@ set :scm, :git -server '166.78.3.108', :web +foundation1_ip = '166.78.3.108' +foundation2_ip = '166.78.18.29' + +role :web, foundation1_ip, foundation2_ip after "deploy:update_code", "deploy:generate_static_site" set :keep_releases, 3
Deploy to both foundation servers
diff --git a/test/unit/connection_test.rb b/test/unit/connection_test.rb index abc1234..def5678 100644 --- a/test/unit/connection_test.rb +++ b/test/unit/connection_test.rb @@ -0,0 +1,21 @@+require File.expand_path("../../test_helper", __FILE__) + +include RedmineS3 + +class ConfigurationTest < ActiveSupport::TestCase + + test "basic aws functionality" do + if Configuration.get.access_key_id.nil? + skip "Skipping AWS tests because it is not configured for the test environment" + end + + body = "#{File.read(__FILE__)}#{Random.new_seed}" + filename = "foobar.rb" + Connection.client + Connection.put(filename, __FILE__, body) + assert Connection.object_url(filename).include? filename + assert_equal body, Connection.get(filename).read + Connection.delete(filename) + end + +end
Add rudimentary AWS client test It current mysteriously fails sometimes v_v
diff --git a/react-native-lookback.podspec b/react-native-lookback.podspec index abc1234..def5678 100644 --- a/react-native-lookback.podspec +++ b/react-native-lookback.podspec @@ -13,6 +13,7 @@ s.source = { git: package.dig(:repository, :url) } s.source_files = "ios/*" s.platform = :ios, "8.0" + s.frameworks = ["Lookback"] s.dependency "LookbackSafe", "~> 1.4.1" s.dependency "React"
Add Lookback framework to the podspec
diff --git a/jasmine-selenium-runner.gemspec b/jasmine-selenium-runner.gemspec index abc1234..def5678 100644 --- a/jasmine-selenium-runner.gemspec +++ b/jasmine-selenium-runner.gemspec @@ -9,7 +9,7 @@ spec.authors = ["Rajan Agaskar", "Gregg Van Hove" ] spec.email = ["rajan@pivotallabs.com", 'gvanhove@pivotallabs.com'] spec.description = %q{Run your jasmine tests in a real live browser!} - spec.summary = %q{TODO: Write a gem summary} + spec.summary = %q{Run your jasmine tests in a real live browser!} spec.homepage = "http://pivotal.github.com/jasmine/" spec.license = "MIT"
Make bundler happy by providing a summary - Silences warning
diff --git a/test/test_gem_install.rb b/test/test_gem_install.rb index abc1234..def5678 100644 --- a/test/test_gem_install.rb +++ b/test/test_gem_install.rb @@ -17,4 +17,11 @@ end assert_match(/GNU ed/, out) end + + def test_gem_install_nokogiri + RubyInstaller::Runtime.msys2_installation.with_msys_apps_enabled do + assert system("pacman -S mingw-w64-x86_64-libxslt --needed --noconfirm") + assert system("gem inst nokogiri --platform ruby -- --use-system-libraries") + end + end end
Add a test to gem install nokogiri
diff --git a/test/fixtures/cookbooks/test/recipes/repo.rb b/test/fixtures/cookbooks/test/recipes/repo.rb index abc1234..def5678 100644 --- a/test/fixtures/cookbooks/test/recipes/repo.rb +++ b/test/fixtures/cookbooks/test/recipes/repo.rb @@ -26,6 +26,7 @@ support_email_address "#{node['chef_admin']}" EOS action :install + accept_license true end file '/tmp/opscode-manage.firstrun' do
Fix failing tests due to lack of accept_license Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/zero_auth.gemspec b/zero_auth.gemspec index abc1234..def5678 100644 --- a/zero_auth.gemspec +++ b/zero_auth.gemspec @@ -17,7 +17,7 @@ spec.test_files = spec.files.grep(%r{^spec/}) spec.require_paths = ["lib"] - spec.add_development_dependency 'bcrypt', '~> 3.1.7' + spec.add_dependency 'bcrypt', '~> 3.1.7' spec.add_development_dependency 'bundler', '~> 1.5' spec.add_development_dependency 'rake'
Make BCrypt a real dependency [ci-skip]
diff --git a/lib/learn_web/client/user/me.rb b/lib/learn_web/client/user/me.rb index abc1234..def5678 100644 --- a/lib/learn_web/client/user/me.rb +++ b/lib/learn_web/client/user/me.rb @@ -24,13 +24,13 @@ case response.status when 401 puts "It seems your OAuth token is incorrect. Please re-run config with: learn reset" - exit + exit 1 when 500 puts "Something went wrong. Please try again." - exit + exit 1 else puts "Something went wrong. Please try again." - exit + exit 1 end end
Add exit code so we can break out of the execution flow more easily
diff --git a/lib/rom/support/class_macros.rb b/lib/rom/support/class_macros.rb index abc1234..def5678 100644 --- a/lib/rom/support/class_macros.rb +++ b/lib/rom/support/class_macros.rb @@ -1,5 +1,31 @@ module ROM + # Internal support module for class-level settings + # + # @private module ClassMacros + # Specify what macros a class will use + # + # @example + # class MyClass + # extend ROM::ClassMacros + # + # defines :one, :two + # + # one 1 + # two 2 + # end + # + # class OtherClass < MyClass + # two 'two' + # end + # + # MyClass.one # => 1 + # MyClass.two # => 2 + # + # OtherClass.one # => 1 + # OtherClass.two # => 'two' + # + # @api private def defines(*args) mod = Module.new
Add YARD for ClassMacros support module
diff --git a/quickbooks_endpoint.rb b/quickbooks_endpoint.rb index abc1234..def5678 100644 --- a/quickbooks_endpoint.rb +++ b/quickbooks_endpoint.rb @@ -1,10 +1,11 @@ require "sinatra" require "endpoint_base" -# require "pry" require File.expand_path(File.dirname(__FILE__) + '/lib/qb_integration') class QuickbooksEndpoint < EndpointBase::Sinatra::Base + endpoint_key ENV["ENDPOINT_KEY"] + post '/add_product' do code, summary = QBIntegration::Product.new(@payload, @config).import result code, summary
Set endpoint_key on sinatra class
diff --git a/db/migrate/20170405133031_add_missing_indexes.rb b/db/migrate/20170405133031_add_missing_indexes.rb index abc1234..def5678 100644 --- a/db/migrate/20170405133031_add_missing_indexes.rb +++ b/db/migrate/20170405133031_add_missing_indexes.rb @@ -1,4 +1,10 @@-class AddMissingIndexes < ActiveRecord::Migration +migration_superclass = if ActiveRecord::VERSION::MAJOR >= 5 + ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"] +else + ActiveRecord::Migration +end + +class AddMissingIndexes < migration_superclass def self.up add_index addresses_table_name, :user_id add_index addresses_table_name, :deleted_at
Fix Directly inheriting from ActiveRecord::Migration is not supported
diff --git a/fernet.gemspec b/fernet.gemspec index abc1234..def5678 100644 --- a/fernet.gemspec +++ b/fernet.gemspec @@ -15,4 +15,5 @@ gem.add_runtime_dependency "valcro", "0.1" gem.add_development_dependency "rspec", "~> 3.4" + gem.add_development_dependency "rake", "~> 10.4" end
Add rake to dev dependencies
diff --git a/themes_for_rails.gemspec b/themes_for_rails.gemspec index abc1234..def5678 100644 --- a/themes_for_rails.gemspec +++ b/themes_for_rails.gemspec @@ -21,5 +21,4 @@ gem.add_development_dependency "test-unit" gem.add_development_dependency "contest" gem.add_development_dependency "mocha" - gem.add_development_dependency('rails', ["= 3.0.11"]) end
Remove duplicate dependency on Rails to prevent RubyGems error. See https://github.com/rubygems/rubygems/blob/master/lib/rubygems/specification.rb#L2795
diff --git a/Casks/ridibooks.rb b/Casks/ridibooks.rb index abc1234..def5678 100644 --- a/Casks/ridibooks.rb +++ b/Casks/ridibooks.rb @@ -1,8 +1,9 @@ cask :v1 => 'ridibooks' do - version :latest - sha256 :no_check + version '1.5.9b' + sha256 '27e06ef0625f8958a909c7801bfd0108d975164fec9b241d1a12ab083edea2e0' - url 'http://ridibooks.com/getapp?os=mac' + # ridicorp.com is the official download host per the vendor homepage + url "http://cdn.ridicorp.com/app/mac/ridibooks-#{version}.dmg" name 'Ridibooks' homepage 'https://ridibooks.com/support/app/download' license :gratis
Update Ridibooks to versioned url
diff --git a/lib/autoparts/packages/googleappenginego.rb b/lib/autoparts/packages/googleappenginego.rb index abc1234..def5678 100644 --- a/lib/autoparts/packages/googleappenginego.rb +++ b/lib/autoparts/packages/googleappenginego.rb @@ -2,12 +2,12 @@ module Packages class GoogleAppEngineGo < Package name 'googleappenginego' - version '1.9.11' + version '1.9.13' description 'Google App Engine for Go: A CLI for managing Google App Engine cloud services for Go' category Category::DEPLOYMENT - source_url 'https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.11.zip' - source_sha1 '6c2cf90de4d9dc5771ae0927e8e8005b967dffc3' + source_url 'https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.13.zip' + source_sha1 'aa67ac85debc1ea9e332ac7382850e81c385cc63' source_filetype 'zip' def install
Update App Engine Go to 1.9.13
diff --git a/lib/awestruct/deploy/github_pages_deploy.rb b/lib/awestruct/deploy/github_pages_deploy.rb index abc1234..def5678 100644 --- a/lib/awestruct/deploy/github_pages_deploy.rb +++ b/lib/awestruct/deploy/github_pages_deploy.rb @@ -1,4 +1,5 @@ require 'awestruct/deployers' +require 'git' module Awestruct module Deploy
Fix uninitialized constant issue with git deploy
diff --git a/lib/designernews/helpers/story_formatter.rb b/lib/designernews/helpers/story_formatter.rb index abc1234..def5678 100644 --- a/lib/designernews/helpers/story_formatter.rb +++ b/lib/designernews/helpers/story_formatter.rb @@ -5,7 +5,19 @@ MAX_TWEET_LENGTH = 140 - SHORT_URL_LENGTH_HTTPS - WHITESPACE def tweet - [title.truncate(MAX_TWEET_LENGTH), url].map(&:strip).join(' ') + [title_with_badge.truncate(MAX_TWEET_LENGTH), url].join(' ') + end + + def title_with_badge + if badge + [title.strip, hashtag].join(' ') + else + title.strip + end + end + + def hashtag + badge.sub('_', '').prepend('#') end end end
Add badge hashtags to tweets
diff --git a/lib/fit_commit/validators/summary_period.rb b/lib/fit_commit/validators/summary_period.rb index abc1234..def5678 100644 --- a/lib/fit_commit/validators/summary_period.rb +++ b/lib/fit_commit/validators/summary_period.rb @@ -3,7 +3,7 @@ module FitCommit module Validators class SummaryPeriod < Base - def validate_line(lineno, text, branch_name) + def validate_line(lineno, text, _branch_name) if lineno == 1 && text.end_with?(".") add_error(lineno, "Do not end your summary with a period.") end
Mark param as unused in SummaryPeriod validator
diff --git a/lib/rabbitmq/http/client/response_helper.rb b/lib/rabbitmq/http/client/response_helper.rb index abc1234..def5678 100644 --- a/lib/rabbitmq/http/client/response_helper.rb +++ b/lib/rabbitmq/http/client/response_helper.rb @@ -13,7 +13,7 @@ end def decode_resource(response) - if response.nil? || response.body.empty? + if response.nil? || response.body.nil? || response.body.empty? Hashie::Mash.new else decode_response_body(response.body)
Handle 204 responses with HTTP keepalive If the HTTP API is behind a proxy which has HTTP keepalive enabled, Faraday will assign a nil body on 204 responses.
diff --git a/lib/vagrant-notify/action/check_provider.rb b/lib/vagrant-notify/action/check_provider.rb index abc1234..def5678 100644 --- a/lib/vagrant-notify/action/check_provider.rb +++ b/lib/vagrant-notify/action/check_provider.rb @@ -0,0 +1,17 @@+module Vagrant + module Notify + module Action + class CheckProvider + def initialize(app, env) + @app = app + end + + def call(env) + env[:result] = true + + @app.call env + end + end + end + end +end
Add a placeholder action to check if machine provider is compatible with the plugin
diff --git a/lib/web_blocks/facade/registration_scope.rb b/lib/web_blocks/facade/registration_scope.rb index abc1234..def5678 100644 --- a/lib/web_blocks/facade/registration_scope.rb +++ b/lib/web_blocks/facade/registration_scope.rb @@ -6,17 +6,17 @@ def initialize context super context - @@component = nil unless defined? @@component + @@registration_scope = nil unless defined? @@registration_scope end def handle command = nil, data = {}, &block case command when :set - @@component = data + @@registration_scope = data when :unset - @@component = nil + @@registration_scope = nil end - @@component + @@registration_scope end end
Fix an issue with naming
diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index abc1234..def5678 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -18,7 +18,7 @@ Subscription.create( user: user, subscription_product: sp, - address: ship_address, + address: li.ship_address, limit: sp.limit, credit_card: payment.source, recurring: sp.recurring,
Use line item ship address to create the subscriptions
diff --git a/app/services/contributor_service.rb b/app/services/contributor_service.rb index abc1234..def5678 100644 --- a/app/services/contributor_service.rb +++ b/app/services/contributor_service.rb @@ -29,7 +29,7 @@ ) end - def self.send_contributor_notice_to email + def self.send_contributor_notice_to inviter:, email:, universe: CollaborationMailer.contributor_invitation( inviter: inviter, invite_email: email,
Include proper params on contrib notice
diff --git a/ruby/luhn/luhn.rb b/ruby/luhn/luhn.rb index abc1234..def5678 100644 --- a/ruby/luhn/luhn.rb +++ b/ruby/luhn/luhn.rb @@ -1,18 +1,19 @@+# Luhn class Luhn - + attr_reader :num def initialize(num) @num = num end def addends - @num.to_s.chars.map(&:to_i) # digits - .reverse - .map.with_index { |digit, index| addend(digit, index) } - .reverse + num.to_s.chars.map(&:to_i) # digits + .reverse + .map.with_index { |digit, index| addend(digit, index) } + .reverse end def addend(digit, index) - subtract_nine(double(digit, index)) + subtract_nine(double_every_other(digit, index)) end def checksum @@ -31,12 +32,11 @@ private - def double(digit, index) - index % 2 == 1 ? digit * 2 : digit + def double_every_other(digit, index) + index.odd? ? digit * 2 : digit end def subtract_nine(digit) digit > 9 ? digit - 9 : digit end - end
Refactor to use .odd? also style fixes
diff --git a/app/views/forums/index.atom.builder b/app/views/forums/index.atom.builder index abc1234..def5678 100644 --- a/app/views/forums/index.atom.builder +++ b/app/views/forums/index.atom.builder @@ -15,6 +15,7 @@ entry.author do |author| author.name(post.user.name) end + entry.category(:term => post.forum.title) entry.wfw :commentRss, "http://#{MY_DOMAIN}/nodes/#{node.id}/comments.atom" end end
Add category in forum feed. Signed-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@2metz.fr>
diff --git a/test/performance/raise_comparison_test.rb b/test/performance/raise_comparison_test.rb index abc1234..def5678 100644 --- a/test/performance/raise_comparison_test.rb +++ b/test/performance/raise_comparison_test.rb @@ -0,0 +1,103 @@+require "test_helper" +require "benchmark" + +class RaiseComparisonTest < RemotelyExceptional::TestCase + class TestStrategy + class << self + attr_accessor :action + end + + def self.===(exception) + exception.is_a?(ArgumentError) + end + + def self.handle(remote_exception) + action == :retry ? remote_exception.retry : remote_exception.continue + end + end + + class TestIncluder + include RemotelyExceptional::RemoteHandling + end + + context "compared to raise" do + setup do + was_disabled = GC.enable + GC.start + # Sleep briefly if the GC wasn't previously disabled for more consistent + # execution. + sleep 0.1 unless was_disabled + GC.disable + end + + should "perform between 2.0 - 3.5x slower when continuing" do + TestStrategy.action = :continue + bench_range.each do |bench_size| + raise_time = remotely_exceptional_time = 0 + + bench_size.times do + raise_time += Benchmark.realtime do + begin + raise ArgumentError + rescue ArgumentError + end + end + + remotely_exceptional_time += Benchmark.realtime do + TestIncluder.remotely_exceptional(TestStrategy) do + raise ArgumentError + end + end + end + + # Allow a little more leeway for benchmarks of 100 or less iterations. + epsilon = bench_size <= 100 ? 3.5 : 2.0 + real_epsilon = (remotely_exceptional_time / raise_time) - 1 + fail_msg = "bench size: #{bench_size} | expected_epsilon: #{epsilon} | real_epsilon: #{real_epsilon}" + assert_in_epsilon(raise_time, remotely_exceptional_time, epsilon, fail_msg) + end + end + + should "perform between 2.0 - 3.5x slower when retrying" do + TestStrategy.action = :retry + bench_range.each do |bench_size| + raise_time = remotely_exceptional_time = 0 + + bench_size.times do + should_retry = false + raise_time += Benchmark.realtime do + begin + unless should_retry + should_retry = true + raise ArgumentError + end + rescue ArgumentError + retry + end + end + + should_retry = false + remotely_exceptional_time += Benchmark.realtime do + TestIncluder.remotely_exceptional(TestStrategy) do + unless should_retry + should_retry = true + raise ArgumentError + end + end + end + end + + # Allow a little more leeway for benchmarks of 100 or less iterations. + epsilon = bench_size <= 100 ? 3.5 : 2.0 + real_epsilon = (remotely_exceptional_time / raise_time) - 1 + fail_msg = "bench size: #{bench_size} | expected_epsilon: #{epsilon} | real_epsilon: #{real_epsilon}" + assert_in_epsilon(raise_time, remotely_exceptional_time, epsilon, fail_msg) + end + end + end + + # Skip iterations [1, 10] because they're too variable. + def bench_range + @bench_range ||= 2.upto(4).map { |n| 10 ** n } + end +end
Add ugly performance comparison test
diff --git a/test/unit/edition/gov_uk_delivery_test.rb b/test/unit/edition/gov_uk_delivery_test.rb index abc1234..def5678 100644 --- a/test/unit/edition/gov_uk_delivery_test.rb +++ b/test/unit/edition/gov_uk_delivery_test.rb @@ -10,10 +10,8 @@ policy.first_published_at = Time.zone.now policy.major_change_published_at = Time.zone.now - policy.stubs(:govuk_delivery_tags).returns(['http://example.com/feed']) - govuk_delivery_create_notification_success(['http://example.com/feed'], policy.title, '') + policy.expects(:notify_govuk_delivery).once policy.publish! - end test "should notify govuk_delivery on publishing news articles" do @@ -21,8 +19,8 @@ news_article.first_published_at = Time.zone.now news_article.major_change_published_at = Time.zone.now - news_article.stubs(:govuk_delivery_tags).returns(['http://example.com/feed']) - govuk_delivery_create_notification_success(['http://example.com/feed'], news_article.title, '') + + news_article.expects(:notify_govuk_delivery).once news_article.publish! end @@ -32,8 +30,7 @@ publication.first_published_at = Time.zone.now publication.major_change_published_at = Time.zone.now - publication.stubs(:govuk_delivery_tags).returns(['http://example.com/feed']) - govuk_delivery_create_notification_success(['http://example.com/feed'], publication.title, '') + publication.expects(:notify_govuk_delivery).once publication.publish! end end
Change unit test to just check for invocation
diff --git a/gibber.gemspec b/gibber.gemspec index abc1234..def5678 100644 --- a/gibber.gemspec +++ b/gibber.gemspec @@ -21,4 +21,5 @@ spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "pry" + spec.add_development_dependency "minitest" end
Add minitest to dev dependencies
diff --git a/gimlet.gemspec b/gimlet.gemspec index abc1234..def5678 100644 --- a/gimlet.gemspec +++ b/gimlet.gemspec @@ -20,6 +20,7 @@ spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" + spec.add_development_dependency "rspec" spec.add_dependency "thor" end
Add rspec as development dependency
diff --git a/ci_scripts/check_resource_bundle.rb b/ci_scripts/check_resource_bundle.rb index abc1234..def5678 100644 --- a/ci_scripts/check_resource_bundle.rb +++ b/ci_scripts/check_resource_bundle.rb @@ -10,6 +10,7 @@ require 'xcodeproj' contents_of_resources_dir = Dir.glob("Stripe/Resources/Images/*.png").map { |h| File.basename(h) }.uniq.sort +puts contents_of_resources_dir targets = ['StripeiOSResources', 'StripeiOS'] targets.each do |target| @@ -19,7 +20,8 @@ if duplicates.any? abort("Found some duplicate entries in the resources build phase for target #{target}:\n#{duplicates}") end - resources = resource_bundle_files.uniq.sort.select{ |n| !(n.end_with?(".strings") || n.end_with?(".sh")) } + resources = resource_bundle_files.uniq.sort.select{ |n| !(n.end_with?(".strings") || n.end_with?(".sh") || n == "Stripe3DS2.bundle") } + puts resources if contents_of_resources_dir != resources likely_culprits = ((contents_of_resources_dir - resources) + (resources - contents_of_resources_dir)).uniq
Fix resource bundle test to allow Stripe3DS2.bundle
diff --git a/snmp.gemspec b/snmp.gemspec index abc1234..def5678 100644 --- a/snmp.gemspec +++ b/snmp.gemspec @@ -28,6 +28,7 @@ s.license = 'MIT' s.required_ruby_version = '>= 1.9.0' + s.add_development_dependency("rake") s.add_development_dependency("bundler") s.add_development_dependency("minitest") s.add_development_dependency("rdoc")
Add rake as dev depedency