diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/bitbucket_rest_api/teams.rb b/lib/bitbucket_rest_api/teams.rb index abc1234..def5678 100644 --- a/lib/bitbucket_rest_api/teams.rb +++ b/lib/bitbucket_rest_api/teams.rb @@ -10,7 +10,7 @@ def list(user_role) response = get_request("/2.0/teams/?role=#{user_role.to_s}") - return response unless block_given? + return response["values"] unless block_given? response["values"].each { |el| yield el } end @@ -20,25 +20,25 @@ def members(team_name) response = get_request("/2.0/teams/#{team_name.to_s}/members") - return response unless block_given? + return response["values"] unless block_given? response["values"].each { |el| yield el } end def followers(team_name) response = get_request("/2.0/teams/#{team_name.to_s}/followers") - return response unless block_given? + return response["values"] unless block_given? response["values"].each { |el| yield el } end def following(team_name) response = get_request("/2.0/teams/#{team_name.to_s}/following") - return response unless block_given? + return response["values"] unless block_given? response["values"].each { |el| yield el } end def repos(team_name) response = get_request("/2.0/repositories/#{team_name.to_s}") - return response unless block_given? + return response["values"] unless block_given? response["values"].each { |el| yield el } end
Return values array from response Returning an array of the data rather than the entire response to allow iteration over
diff --git a/lib/usaidwat/either.rb b/lib/usaidwat/either.rb index abc1234..def5678 100644 --- a/lib/usaidwat/either.rb +++ b/lib/usaidwat/either.rb @@ -0,0 +1,22 @@+module USaidWat + class Either + attr_reader :value + + def initialize(value) + @value = value + end + end + + class Left < Either + def method_missing(method_sym, *args, &block) + self + end + end + + class Right < Either + def method_missing(method_sym, *args, &block) + @value = value.send(method_sym, *args, &block) + self + end + end +end
Create a basic Either monad for chaining operators together
diff --git a/lib/passman/commands/command.rb b/lib/passman/commands/command.rb index abc1234..def5678 100644 --- a/lib/passman/commands/command.rb +++ b/lib/passman/commands/command.rb @@ -1,42 +1,44 @@ require_relative '../helpers/hyphenizer' module Passman - class Command - attr_reader :global, :options, :args - attr_reader :config, :database + module Commands + class Command + attr_reader :global, :options, :args + attr_reader :config, :database - def initialize(global, options, args) - @global = global - @options = options - @args = args + def initialize(global, options, args) + @global = global + @options = options + @args = args - @config = global[:config] - @database = global[:database] - end + @config = global[:config] + @database = global[:database] + end - singleton_class.send(:alias_method, :original_name, :name) + singleton_class.send(:alias_method, :original_name, :name) - def self.name - Helpers::Hyphenizer.hyphenize(original_name) - end + def self.name + Helpers::Hyphenizer.hyphenize(original_name) + end - def self.desc(*arg) - getter_setter :desc, arg - end + def self.desc(*arg) + getter_setter :desc, arg + end - def self.arg_name(*arg) - getter_setter :arg_name, arg - end + def self.arg_name(*arg) + getter_setter :arg_name, arg + end - def self.invoke(global, options, args) - new(global, options, args).invoke - end + def self.invoke(global, options, args) + new(global, options, args).invoke + end - def self.getter_setter(var, arg) - if arg.empty? - instance_variable_get "@#{var}" - else - instance_variable_set "@#{var}", arg.first + def self.getter_setter(var, arg) + if arg.empty? + instance_variable_get "@#{var}" + else + instance_variable_set "@#{var}", arg.first + end end end end
Include Commands module outside the Command class
diff --git a/spec/dragonfly/data_storage/couch_data_store_spec.rb b/spec/dragonfly/data_storage/couch_data_store_spec.rb index abc1234..def5678 100644 --- a/spec/dragonfly/data_storage/couch_data_store_spec.rb +++ b/spec/dragonfly/data_storage/couch_data_store_spec.rb @@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/shared_data_store_examples' describe Dragonfly::DataStorage::CouchDataStore do + before(:each) do WebMock.allow_net_connect! @data_store = Dragonfly::DataStorage::CouchDataStore.new( @@ -12,6 +13,13 @@ :password => "", :database => "dragonfly_test" ) + begin + @data_store.db.get('ping') + rescue Errno::ECONNREFUSED => e + pending "You need to start CouchDB on localhost:5984 to test the CouchDataStore" + rescue RestClient::ResourceNotFound + end + end it_should_behave_like 'data_store'
Set couch tests to pending when couch isn't being run
diff --git a/test/controllers/gobierto_data/api/v1/query_controller_test.rb b/test/controllers/gobierto_data/api/v1/query_controller_test.rb index abc1234..def5678 100644 --- a/test/controllers/gobierto_data/api/v1/query_controller_test.rb +++ b/test/controllers/gobierto_data/api/v1/query_controller_test.rb @@ -0,0 +1,57 @@+# frozen_string_literal: true + +require "test_helper" + +module GobiertoData + module Api + module V1 + class QueryControllerTest < GobiertoControllerTest + + def site + @site ||= sites(:madrid) + end + + def site_with_module_disabled + @site_with_module_disabled ||= sites(:santander) + end + + def test_index + with(site: site) do + get gobierto_data_api_v1_root_path(sql: "SELECT COUNT(*) AS test_count FROM users"), as: :json + + assert_response :success + + response_data = response.parsed_body + + assert response_data.has_key? "data" + assert_equal 1, response_data["data"].count + assert_equal 7, response_data["data"].first["test_count"] + end + end + + def test_index_with_module_disabled + with(site: site_with_module_disabled) do + get gobierto_data_api_v1_root_path(sql: "SELECT COUNT(*) AS test_count FROM users"), as: :json + + assert_response :forbidden + end + end + + def test_index_with_invalid_query + with(site: site) do + get gobierto_data_api_v1_root_path(sql: "SELECT COUNT(*) AS test_count FROM not_existing_table"), as: :json + + assert_response :bad_request + + response_data = response.parsed_body + + assert response_data.has_key? "errors" + assert_equal 1, response_data["errors"].count + assert_match(/UndefinedTable/, response_data["errors"].first["sql"]) + end + end + + end + end + end +end
Add tests for data API query controller
diff --git a/app/controllers/backend/articles_controller.rb b/app/controllers/backend/articles_controller.rb index abc1234..def5678 100644 --- a/app/controllers/backend/articles_controller.rb +++ b/app/controllers/backend/articles_controller.rb @@ -6,7 +6,7 @@ before_action -> { breadcrumb.add t('b.articles'), backend_articles_path } def index - @articles = paginate Article.all + @articles = paginate Article.order('published_at DESC') end def new
Order the list of articles.
diff --git a/app/models/concerns/application_userstamp_concern.rb b/app/models/concerns/application_userstamp_concern.rb index abc1234..def5678 100644 --- a/app/models/concerns/application_userstamp_concern.rb +++ b/app/models/concerns/application_userstamp_concern.rb @@ -15,7 +15,12 @@ def add_userstamp_associations(options) options.reverse_merge!(inverse_of: false) - super(options) + # Skip calling `add_userstamp_associations` in the gem during assets precompile. + # The env variable RAILS_GROUPS is set to 'assets'. + # https://github.com/lowjoel/activerecord-userstamp/blob/master/lib/active_record/userstamp/stampable.rb#L76 + # calls https://github.com/lowjoel/activerecord-userstamp/blob/master/lib/active_record/userstamp/utilities.rb#L31 + # which needs a database connection, needlessly complicating the build. + super(options) unless ENV['RAILS_GROUPS'] == 'assets' end end end
Fix assets precompile needing a database connection.
diff --git a/lib/opbeat/capistrano.rb b/lib/opbeat/capistrano.rb index abc1234..def5678 100644 --- a/lib/opbeat/capistrano.rb +++ b/lib/opbeat/capistrano.rb @@ -1,7 +1,7 @@ require 'capistrano' require 'capistrano/version' -if Capistrano.constants.include? :VERSION +if Capistrano::VERSION.to_i <= 2 require 'opbeat/integration/capistrano2' else require 'opbeat/integration/capistrano3'
Change weird Capistrano version check
diff --git a/lib/vote_tracker/vote.rb b/lib/vote_tracker/vote.rb index abc1234..def5678 100644 --- a/lib/vote_tracker/vote.rb +++ b/lib/vote_tracker/vote.rb @@ -19,7 +19,7 @@ end def to_s - "Senate #{action} #{article} #{type} for #{issue}: #{summary}" + "#Senate #{action} #{article} #{type} for #{issue}: #{summary}" end def to_tweet
Add a hashtag for tweets.
diff --git a/0_code_wars/7_jaden_case.rb b/0_code_wars/7_jaden_case.rb index abc1234..def5678 100644 --- a/0_code_wars/7_jaden_case.rb +++ b/0_code_wars/7_jaden_case.rb @@ -0,0 +1,13 @@+# http://www.codewars.com/kata/5390bac347d09b7da40006f6/ +# --- iterations --- +class String + def to_jaden_case + split(" ").map(&:capitalize).join(" ") + end +end + +class String + def to_jaden_case + gsub(/(?<=\A|\s)(\w+)/, &:capitalize) + end +end
Add code wars (7) jaden case
diff --git a/app/exporters/publishing_api_manual_with_sections_publisher.rb b/app/exporters/publishing_api_manual_with_sections_publisher.rb index abc1234..def5678 100644 --- a/app/exporters/publishing_api_manual_with_sections_publisher.rb +++ b/app/exporters/publishing_api_manual_with_sections_publisher.rb @@ -6,24 +6,24 @@ update_type: update_type, ).call - manual.sections.each do |document| - next if !document.needs_exporting? && action != :republish + manual.sections.each do |section| + next if !section.needs_exporting? && action != :republish PublishingAPIPublisher.new( - entity: document, + entity: section, update_type: update_type, ).call - document.mark_as_exported! if action != :republish + section.mark_as_exported! if action != :republish end - manual.removed_sections.each do |document| - next if document.withdrawn? && action != :republish + manual.removed_sections.each do |section| + next if section.withdrawn? && action != :republish begin - publishing_api_v2.unpublish(document.id, type: "redirect", alternative_path: "/#{manual.slug}", discard_drafts: true) + publishing_api_v2.unpublish(section.id, type: "redirect", alternative_path: "/#{manual.slug}", discard_drafts: true) rescue GdsApi::HTTPNotFound # rubocop:disable Lint/HandleExceptions end - document.withdraw_and_mark_as_exported! if action != :republish + section.withdraw_and_mark_as_exported! if action != :republish end end
Rename document -> section in PublishingApiManualWithSectionsPublisher
diff --git a/app/models/competitions/portland_short_track_series/overall.rb b/app/models/competitions/portland_short_track_series/overall.rb index abc1234..def5678 100644 --- a/app/models/competitions/portland_short_track_series/overall.rb +++ b/app/models/competitions/portland_short_track_series/overall.rb @@ -9,7 +9,7 @@ def after_calculate super - MonthlyStandings.calculate! year + # MonthlyStandings.calculate! year end end end
Disable monothly short track standings
diff --git a/simple_backend/app/controllers/recipe_lookup.rb b/simple_backend/app/controllers/recipe_lookup.rb index abc1234..def5678 100644 --- a/simple_backend/app/controllers/recipe_lookup.rb +++ b/simple_backend/app/controllers/recipe_lookup.rb @@ -0,0 +1,6 @@+get '/search_recipes' do + response = RestClient.get "https://api.bigoven.com/recipes?pg=1&rpp=25&title_kw=salsa&api_key=#{ENV['API_KEY']}",{:Accept => 'application/json'} + + p response + +end
Change name of recipe search controller
diff --git a/spec/requests/message_thread/thread_views_spec.rb b/spec/requests/message_thread/thread_views_spec.rb index abc1234..def5678 100644 --- a/spec/requests/message_thread/thread_views_spec.rb +++ b/spec/requests/message_thread/thread_views_spec.rb @@ -0,0 +1,18 @@+require "spec_helper" + +# This is a very thin test, since most of the functionality is tested +# in the controller test. Here we just want to make sure that the CSS +# class appears, for the UJS magic to kick in. + +describe "thread views" do + context "for a signed in user" do + include_context "signed in as a site user" + let(:thread) { FactoryGirl.create(:message_thread_with_messages) } + let!(:thread_view) { FactoryGirl.create(:thread_view, thread: thread, user: current_user) } + + it "should output a page with the correct class" do + visit thread_path(thread) + page.should have_css('article.message.thread-view-from-here') + end + end +end
Add a thin integration test to ensure that the correct autoscroll class appears when viewing a thread.
diff --git a/spec/controllers/restaurants_controller_spec.rb b/spec/controllers/restaurants_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/restaurants_controller_spec.rb +++ b/spec/controllers/restaurants_controller_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' -# RSpec.describe RestaurantsController, type: :controller do -# +RSpec.describe RestaurantsController, type: :controller do + # let(:restaurants) { search_by_zip("94030") } # # @@ -14,4 +14,4 @@ # end -# end +end
Fix restaurants controller rspec test file to pass Travis CI
diff --git a/docurium.gemspec b/docurium.gemspec index abc1234..def5678 100644 --- a/docurium.gemspec +++ b/docurium.gemspec @@ -18,7 +18,7 @@ s.add_dependency "mustache", ">= 0.99.4" s.add_dependency "rocco", "= 0.7.0" s.add_dependency "gli", "~>2.5" - s.add_dependency "rugged", "~>0.17.beta" + s.add_dependency "rugged", "~>0.18.b1" s.add_development_dependency "bundler", "~>1.0" s.files = `git ls-files`.split("\n")
Use the more accurate ~>0.18.b1 rugged version
diff --git a/lib/specinfra/command/linux/base/lxc_container.rb b/lib/specinfra/command/linux/base/lxc_container.rb index abc1234..def5678 100644 --- a/lib/specinfra/command/linux/base/lxc_container.rb +++ b/lib/specinfra/command/linux/base/lxc_container.rb @@ -1,11 +1,17 @@ class Specinfra::Command::Linux::Base::LxcContainer < Specinfra::Command::Base::LxcContainer class << self def check_exists(container) - "lxc-ls -1 | grep -w #{escape(container)}" + [ + "lxc-ls -1 | grep -w #{escape(container)}", + "virsh -c lxc:/// list --all --name | grep -w '^#{escape(container)}$'" + ].join(' || ') end def check_is_running(container) - "lxc-info -n #{escape(container)} -s | grep -w RUNNING" + [ + "lxc-info -n #{escape(container)} -s | grep -w RUNNING", + "virsh -c lxc:/// list --all --name --state-running | grep -w '^#{escape(container)}$'" + ].join(' || ') end end end
Support libvirt lxc as well
diff --git a/app/admin/optional_modules/videos/video_upload.rb b/app/admin/optional_modules/videos/video_upload.rb index abc1234..def5678 100644 --- a/app/admin/optional_modules/videos/video_upload.rb +++ b/app/admin/optional_modules/videos/video_upload.rb @@ -7,6 +7,11 @@ decorate_with VideoUploadDecorator config.clear_sidebar_sections! + + batch_action :toggle_online do |ids| + VideoUpload.find(ids).each { |item| item.toggle! :online } + redirect_to :back, notice: t('active_admin.batch_actions.flash') + end index do selectable_column
Add batch action to toggle status for VideoUpload
diff --git a/minimal-mistakes-jekyll.gemspec b/minimal-mistakes-jekyll.gemspec index abc1234..def5678 100644 --- a/minimal-mistakes-jekyll.gemspec +++ b/minimal-mistakes-jekyll.gemspec @@ -15,7 +15,8 @@ f.match(%r{^(assets|_(includes|layouts|sass)/|(LICENSE|README|CHANGELOG)((\.(txt|md|markdown)|$)))}i) end - spec.add_development_dependency "jekyll", "~> 3.3" + spec.add_dependency "jekyll", "~> 3.3" + spec.add_development_dependency "bundler", "~> 1.12" spec.add_development_dependency "rake", "~> 10.0"
Add Jekyll v3.3 as dependency
diff --git a/curriculum_vitae.gemspec b/curriculum_vitae.gemspec index abc1234..def5678 100644 --- a/curriculum_vitae.gemspec +++ b/curriculum_vitae.gemspec @@ -9,7 +9,7 @@ spec.authors = ['Murdho'] spec.email = ['murdho@murdho.com'] - spec.summary = 'Simple DSL for creating CV}' + spec.summary = 'Simple DSL for creating CV' spec.description = '' spec.homepage = 'https://github.com/murdho/curriculum_vitae' spec.license = 'MIT'
Remove lost character from gemspec
diff --git a/unicorn/recipes/default.rb b/unicorn/recipes/default.rb index abc1234..def5678 100644 --- a/unicorn/recipes/default.rb +++ b/unicorn/recipes/default.rb @@ -1,10 +1,10 @@-env = YAML::load( `gem environment` )["RubyGems Environment"].detect { |x| x["EXECUTABLE DIRECTORY"] } +require 'rubygems' template "/etc/init.d/unicorn" do source "unicorn-init.sh.erb" owner "root" group "root" mode "755" - variables( :gem_home => env["EXECUTABLE DIRECTORY"]) + variables( :gem_home => Gem.bindir ) end gem_package "unicorn" do
Use RubyGems class methods to get bindir instead of exec'ing out to the shell
diff --git a/backend/app/controllers/api/v1/jobs_controller.rb b/backend/app/controllers/api/v1/jobs_controller.rb index abc1234..def5678 100644 --- a/backend/app/controllers/api/v1/jobs_controller.rb +++ b/backend/app/controllers/api/v1/jobs_controller.rb @@ -10,7 +10,7 @@ def create job = Job.new(job_params) if job.save - render json: job, status: 201, location: [:api, job] + render json: job, status: 201 else render json: { errors: job.errors }, status: 422 end @@ -34,8 +34,8 @@ private def job_params - params.permit(:title, :description, :travel, :diver_license, :tech) + params.require(:job).permit(:title, :description, :travel, :diver_license, :tech) end -end+end
Fix job create route (redirect issue)
diff --git a/lib/chef/knife/cloudformation_destroy.rb b/lib/chef/knife/cloudformation_destroy.rb index abc1234..def5678 100644 --- a/lib/chef/knife/cloudformation_destroy.rb +++ b/lib/chef/knife/cloudformation_destroy.rb @@ -33,6 +33,7 @@ end if(config[:polling]) if(stacks.size == 1) + provider.fetch_stacks poll_stack(stacks.first) else ui.error "Stack polling is not available when multiple stack deletion is requested!"
Refresh stack information prior to polling to prevent immediate exit
diff --git a/test/integration/default/serverspec/influxdb_spec.rb b/test/integration/default/serverspec/influxdb_spec.rb index abc1234..def5678 100644 --- a/test/integration/default/serverspec/influxdb_spec.rb +++ b/test/integration/default/serverspec/influxdb_spec.rb @@ -0,0 +1,19 @@+require "serverspec" + +include Serverspec::Helper::Exec +include Serverspec::Helper::DetectOS + +RSpec.configure do |c| + c.before :all do + c.path = "/sbin:/usr/sbin" + end +end + +describe "InfluxDB Server" do + + it "has a daemon runing" do + expect(service("influxdb")).to be_running + end + +end +
Add test for the InfluxDB service
diff --git a/vendor/aq_sh/aquarii-sh.rb b/vendor/aq_sh/aquarii-sh.rb index abc1234..def5678 100644 --- a/vendor/aq_sh/aquarii-sh.rb +++ b/vendor/aq_sh/aquarii-sh.rb @@ -1,12 +1,21 @@ #!/usr/bin/env ruby -require 'pathname' +begin + require 'pathname' + base = Pathname(__FILE__).expand_path + lib = base + "../lib/aq_lib.rb" -base = Pathname(__FILE__).expand_path -lib = base + "../lib/aq_lib.rb" + require lib -require lib - -# kick start the thing : -AqLib::Command.kickstart!(ARGV[0], ENV["SSH_ORIGINAL_COMMAND"]) -#AqLib::Command.kickstart!("marc@ananas.lan.sigpipe.me", "test") + # kick start the thing : + AqLib::Command.kickstart!(ARGV[0], ENV["SSH_ORIGINAL_COMMAND"]) + #AqLib::Command.kickstart!("marc@ananas.lan.sigpipe.me", "test") +rescue => e + STDERR.puts "REMOTE: IIIaquarii: An error occured, please contact administrator." + a=File.open(File.expand_path("../../../errors_aq_sh", __FILE__), "a") + a << Time.now + a << " - " + a << e + a << "\n" + a.close +end
Improve a bit the error handling stuff in aquarii shell
diff --git a/db/migrate/20170106100107_january6_remove_conflicting_content_items.rb b/db/migrate/20170106100107_january6_remove_conflicting_content_items.rb index abc1234..def5678 100644 --- a/db/migrate/20170106100107_january6_remove_conflicting_content_items.rb +++ b/db/migrate/20170106100107_january6_remove_conflicting_content_items.rb @@ -0,0 +1,10 @@+require_relative "helpers/delete_content_item" + +class January6RemoveConflictingContentItems < ActiveRecord::Migration[5.0] + def up + to_delete = [1624168, 1624157, 1622943] + content_items = ContentItem.where(id: to_delete) + Helpers::DeleteContentItem.destroy_supporting_objects(content_items) + content_items.destroy_all + end +end
Add a migration to remove conflicting content items
diff --git a/examples/jack.rb b/examples/jack.rb index abc1234..def5678 100644 --- a/examples/jack.rb +++ b/examples/jack.rb @@ -4,6 +4,9 @@ # creeper -j jack.rb # OR # ./jack.rb +# +# If you remove the shebang, it can also be run with: +# ruby jack.rb $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib') unless $LOAD_PATH.include?(File.dirname(__FILE__) + '/../lib') @@ -15,4 +18,4 @@ Creeper.logger.info "[JACK.WORK] #{$0.inspect} #{args.inspect}" end -Creeper.work([ 'jack.work' ], 1) unless defined?(Creeper::Launcher) +Creeper.work(:all, 1) unless defined?(Creeper::Launcher)
Update example to use :all syntax
diff --git a/native-navigation.podspec b/native-navigation.podspec index abc1234..def5678 100644 --- a/native-navigation.podspec +++ b/native-navigation.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.name = "native-navigation" s.version = package['version'] - s.summary = "React Native Mapview component for iOS + Android" + s.summary = "Native navigation library for React Native applications" s.authors = { "intelligibabble" => "leland.m.richardson@gmail.com" } s.homepage = "https://github.com/airbnb/native-navigation#readme"
[minor] Fix podspec summary (wrong project) Just a very minor tweak. It appears that the podspec's summary is describing https://github.com/airbnb/react-native-maps, so probably just a copy-and-paste error.
diff --git a/lib/mongomodel/attributes/typecasting.rb b/lib/mongomodel/attributes/typecasting.rb index abc1234..def5678 100644 --- a/lib/mongomodel/attributes/typecasting.rb +++ b/lib/mongomodel/attributes/typecasting.rb @@ -27,7 +27,7 @@ end def before_type_cast(key) - values_before_typecast[key] + values_before_typecast[key] || self[key] end private
Fix before type cast values when loaded from database
diff --git a/i18n-hygiene.gemspec b/i18n-hygiene.gemspec index abc1234..def5678 100644 --- a/i18n-hygiene.gemspec +++ b/i18n-hygiene.gemspec @@ -2,8 +2,8 @@ s.name = 'i18n-hygiene' s.version = '0.1.0' s.license = 'MIT' - s.summary = "Helps maintain translations." - s.description = "Provides rake tasks to help maintain translations." + s.summary = "A linter for translation data in ruby applications" + s.description = "Provides a rake task that checks locale data for likely issues. Intended to be used in build pipelines to detect problems before they reach production" s.authors = [ "Nick Browne"," Keith Pitty" ] s.email = "dev@theconversation.edu.au" s.files = `git ls-files -- lib/*`.split("\n")
Update gem summary and description to help potential users I lost the discussion about changing the gem name, but I think it's worth expanding the summary and description to provide more detail. In particular, I wanted to include "linter" as a short cut to communicating the type of tool this is.
diff --git a/finances.gemspec b/finances.gemspec index abc1234..def5678 100644 --- a/finances.gemspec +++ b/finances.gemspec @@ -25,5 +25,5 @@ spec.add_development_dependency "cucumber" spec.add_development_dependency "rspec" spec.add_development_dependency "page-object" - spec.add_development_dependency "tmuxinator" + spec.add_development_dependency "teamocil" end
Switch to teamocil for tmux
diff --git a/library/fiddle/handle/initialize_spec.rb b/library/fiddle/handle/initialize_spec.rb index abc1234..def5678 100644 --- a/library/fiddle/handle/initialize_spec.rb +++ b/library/fiddle/handle/initialize_spec.rb @@ -0,0 +1,10 @@+require_relative '../../../spec_helper' +require 'fiddle' + +describe "Fiddle::Handle#initialize" do + it "raises Fiddle::DLError if the library cannot be found" do + -> { + Fiddle::Handle.new("doesnotexist.doesnotexist") + }.should raise_error(Fiddle::DLError) + end +end
Add spec and fix exception for Fiddle::Handle.new with a missing library * Fixes https://github.com/oracle/truffleruby/issues/2714
diff --git a/test/benchmark/metrics.rb b/test/benchmark/metrics.rb index abc1234..def5678 100644 --- a/test/benchmark/metrics.rb +++ b/test/benchmark/metrics.rb @@ -0,0 +1,38 @@+require 'statsd-instrument' +require 'benchmark/ips' + +def helperFunction() + a = 10 + a += a + a -= a + a *= a +end + +Benchmark.ips do |bench| + bench.report("increment metric benchmark") do + StatsD.increment('GoogleBase.insert', 10) + end + + bench.report("measure metric benchmark") do + StatsD.measure('helperFunction') do + helperFunction() + end + end + + bench.report("gauge metric benchmark") do + StatsD.gauge('GoogleBase.insert', 12) + end + + bench.report("set metric benchmark") do + StatsD.set('GoogleBase.customers', "12345", sample_rate: 1.0) + end + + bench.report("event metric benchmark") do + StatsD.event('Event Title', "12345") + end + + bench.report("service check metric benchmark") do + StatsD.service_check('shipit.redis_connection', 'ok') + end + +end
Add benchmarking script for metric types
diff --git a/fonetica.gemspec b/fonetica.gemspec index abc1234..def5678 100644 --- a/fonetica.gemspec +++ b/fonetica.gemspec @@ -15,6 +15,7 @@ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] + s.add_dependency(%q<activesupport>, [">= 3.0.0"]) s.add_dependency(%q<activerecord>, [">= 3.0.0"]) - s.add_dependency(%q<activesupport>, [">= 3.0.0"]) + s.add_development_dependency(%q<rspec>, ["~> 2.0.0"]) end
Add rspec as development dependency
diff --git a/fragrant.gemspec b/fragrant.gemspec index abc1234..def5678 100644 --- a/fragrant.gemspec +++ b/fragrant.gemspec @@ -17,6 +17,7 @@ s.add_dependency 'puma' s.add_dependency 'vegas' s.add_dependency 'grape', "~> 0.2.1" # vendorized, though + s.add_dependency 'virtus' # vendorized grape requires this, released 0.2.1 does not yet s.add_development_dependency 'rspec' s.add_development_dependency 'rake'
Add missing 'virtus' gem dependency
diff --git a/db/data/20141102203932_update_display_text_for_obo_sentences.rb b/db/data/20141102203932_update_display_text_for_obo_sentences.rb index abc1234..def5678 100644 --- a/db/data/20141102203932_update_display_text_for_obo_sentences.rb +++ b/db/data/20141102203932_update_display_text_for_obo_sentences.rb @@ -3,7 +3,7 @@ obo_ontologies = Ontology.joins(:ontology_version). where(ontology_versions: {file_extension: '.obo'}) obo_ontologies.each do |ontology| - ontology.sentences.select([:id, :text]).find_each(&:set_display_text!) + ontology.sentences.select(%i(id text)).find_each(&:set_display_text!) end end
Improve code style: Use fancy string.
diff --git a/db/migrate/20151009190325_add_operator_to_schedule_stop_pair.rb b/db/migrate/20151009190325_add_operator_to_schedule_stop_pair.rb index abc1234..def5678 100644 --- a/db/migrate/20151009190325_add_operator_to_schedule_stop_pair.rb +++ b/db/migrate/20151009190325_add_operator_to_schedule_stop_pair.rb @@ -1,6 +1,15 @@ class AddOperatorToScheduleStopPair < ActiveRecord::Migration - def change + def up add_reference :current_schedule_stop_pairs, :operator, index: true add_reference :old_schedule_stop_pairs, :operator, index: true + ScheduleStopPair.find_each do |ssp| + ssp.operator = ssp.route.operator + ssp.save! + end + end + + def down + remove_reference :current_schedule_stop_pairs, :operator + remove_reference :old_schedule_stop_pairs, :operator end end
Define up migration to avoid re-importing all SSPs
diff --git a/site-cookbooks/mysql_part/recipes/create_database.rb b/site-cookbooks/mysql_part/recipes/create_database.rb index abc1234..def5678 100644 --- a/site-cookbooks/mysql_part/recipes/create_database.rb +++ b/site-cookbooks/mysql_part/recipes/create_database.rb @@ -24,6 +24,7 @@ # create database user mysql_database_user node['mysql_part']['app']['username'] do connection mysql_connection_info + host '%' password node['mysql_part']['app']['password'] action :create end
Fix host parameter in case of creating user.
diff --git a/spec/features/dynamic_exam_spec.rb b/spec/features/dynamic_exam_spec.rb index abc1234..def5678 100644 --- a/spec/features/dynamic_exam_spec.rb +++ b/spec/features/dynamic_exam_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Exercise Flow', organization_workspace: :test do +feature 'Dynamic Exam', organization_workspace: :test do let(:user) { create(:user, id: 1) } let(:user2) { create(:user, id: 2) }
Fix name left over from copy-paste
diff --git a/lib/has_uuid/active_record/associations/singular_association.rb b/lib/has_uuid/active_record/associations/singular_association.rb index abc1234..def5678 100644 --- a/lib/has_uuid/active_record/associations/singular_association.rb +++ b/lib/has_uuid/active_record/associations/singular_association.rb @@ -5,8 +5,8 @@ extend ActiveSupport::Concern included do def uuid_writer(uuid) - replace(klass.find(uuid)) unless uuid.nil? - replace(nil) if uuid.nil? + replace(klass.find(uuid)) unless uuid.nil? || uuid.empty? + replace(nil) if uuid.nil? || uuid.empty? end def uuid_reader(force_reload = false)
Handle empty uuids on associations
diff --git a/app/models/aws_accessor.rb b/app/models/aws_accessor.rb index abc1234..def5678 100644 --- a/app/models/aws_accessor.rb +++ b/app/models/aws_accessor.rb @@ -27,6 +27,9 @@ private def credentials - Aws::Credentials.new(@access_key_id, @secret_access_key) + Aws::Credentials.new( + @access_key_id || ENV['AWS_ACCESS_KEY_ID'], + @secret_access_key || ENV['AWS_SECRET_ACCESS_KEY'] + ) end end
Use environment variables by default
diff --git a/app/concerns/action_controller/cors_protection.rb b/app/concerns/action_controller/cors_protection.rb index abc1234..def5678 100644 --- a/app/concerns/action_controller/cors_protection.rb +++ b/app/concerns/action_controller/cors_protection.rb @@ -21,7 +21,9 @@ "accept", "content-type", "referer", "origin", "connection", "host", "user-agent" - ].join(",") if request.env['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] == "POST" + ].join(",") if ["POST", "PUT", "PATCH"].include?( + request.env['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] + ) end end
Fix core for PUT & PATCH
diff --git a/app/models/song_section.rb b/app/models/song_section.rb index abc1234..def5678 100644 --- a/app/models/song_section.rb +++ b/app/models/song_section.rb @@ -3,7 +3,7 @@ validates_presence_of :title, :song_id - before_save :set_position_to_end_of_song, if: -> { ordered_by.zero? } + before_save :set_position_to_end_of_song, if: -> { ordered_by.blank? || ordered_by.zero? } def set_position_to_end_of_song self.ordered_by = highest_song_ordered_by + 1
Fix bug when saving SongSection with blank order We were not properly checking for a blank field before assuming it was a numeric. This is corrected. Closes #2
diff --git a/app/controllers/users/contributions_controller.rb b/app/controllers/users/contributions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users/contributions_controller.rb +++ b/app/controllers/users/contributions_controller.rb @@ -8,7 +8,6 @@ def request_refund authorize resource - authorize! :request_refund, resource if resource.value > resource.user.user_total.credits || !resource.request_refund flash.alert = I18n.t('controllers.users.contributions.request_refund.insufficient_credits') else
Remove cancan from users/contributions controller
diff --git a/app/models/work_package.rb b/app/models/work_package.rb index abc1234..def5678 100644 --- a/app/models/work_package.rb +++ b/app/models/work_package.rb @@ -16,6 +16,8 @@ class WorkPackage < Eventable + attr_accessible :wp_type, :description, :learnt, :next_steps, :days + after_create {|q| q.events.create!(:event_date => created_at, :transition => :create)} def title
Fix issue adding work package
diff --git a/app/services/jadu/claim.rb b/app/services/jadu/claim.rb index abc1234..def5678 100644 --- a/app/services/jadu/claim.rb +++ b/app/services/jadu/claim.rb @@ -9,19 +9,25 @@ end def perform - if operation.ok? - claim.update fee_group_reference: operation['feeGroupReference'] if operation['feeGroupReference'] - claim.finalize! - else - raise StandardError.new <<-EOS.strip_heredoc - Application #{claim.reference} was rejected by Jadu with error #{operation['errorCode']} - Description: #{operation['errorDescription']} - Details: #{operation['details']} - EOS - end + operation.ok? ? finalize_claim : request_error end private + + def finalize_claim + if operation['feeGroupReference'] + claim.update fee_group_reference: operation['feeGroupReference'] + end + claim.finalize! + end + + def request_error + raise StandardError.new <<-EOS.strip_heredoc + Application #{claim.reference} was rejected by Jadu with error #{operation['errorCode']} + Description: #{operation['errorDescription']} + Details: #{operation['details']} + EOS + end def operation @operation ||= client.new_claim(serialized_claim, attachments) @@ -40,13 +46,5 @@ o.update a.filename => a.file.read end end - - def filename_for(attachment) - File.basename claim.send(attachment).url - end - - def file_contents_for(attachment) - claim.send(attachment).file.read - end end end
Remove redundant private methods & reduce complexity of perform method
diff --git a/test/fixtures/policies/_base.rb b/test/fixtures/policies/_base.rb index abc1234..def5678 100644 --- a/test/fixtures/policies/_base.rb +++ b/test/fixtures/policies/_base.rb @@ -1,7 +1,7 @@ default_source :community default_source :chef_repo, '..' cookbook 'redis', path: '../../..' -run_list 'redis::default' +run_list 'sudo::default', 'redis::default' named_run_list :centos, 'yum::default', 'yum-epel::default', run_list named_run_list :debian, 'apt::default', run_list named_run_list :freebsd, 'freebsd::default', run_list
Add sudo default recipe for /etc/sudoers fix.
diff --git a/lib/formtastic/util.rb b/lib/formtastic/util.rb index abc1234..def5678 100644 --- a/lib/formtastic/util.rb +++ b/lib/formtastic/util.rb @@ -18,8 +18,11 @@ end def rails_safe_buffer_class - return ActionView::SafeBuffer if defined?(ActionView::SafeBuffer) - ActiveSupport::SafeBuffer + # It's important that we check ActiveSupport first, + # because in Rails 2.3.6 ActionView::SafeBuffer exists + # but is a deprecated proxy object. + return ActiveSupport::SafeBuffer if defined?(ActiveSupport::SafeBuffer) + return ActionView::SafeBuffer end end
Fix a deprecation warning in Rails 2.3.6 and newer
diff --git a/lib/static_sync/config.rb b/lib/static_sync/config.rb index abc1234..def5678 100644 --- a/lib/static_sync/config.rb +++ b/lib/static_sync/config.rb @@ -22,6 +22,7 @@ def storage Fog::Storage.new({ :provider => self.remote['provider'], + :region => self.remote['region'], :aws_access_key_id => self.remote['username'], :aws_secret_access_key => self.remote['password'] })
Allow regions to be supplied.
diff --git a/lib/hatchet/git_app.rb b/lib/hatchet/git_app.rb index abc1234..def5678 100644 --- a/lib/hatchet/git_app.rb +++ b/lib/hatchet/git_app.rb @@ -17,7 +17,9 @@ end def git_repo - "git@heroku.com:#{name}.git" + 'http' == ENV['HATCHET_GIT_PROTOCOL'] ? + "https://git.heroku.com/#{name}.git" : + "git@heroku.com:#{name}.git" end def push_without_retry!
Use http git when HATCHET_GIT_PROTOCOL is set for http
diff --git a/lib/transproc/compiler.rb b/lib/transproc/compiler.rb index abc1234..def5678 100644 --- a/lib/transproc/compiler.rb +++ b/lib/transproc/compiler.rb @@ -1,3 +1,5 @@+# frozen_string_literal: true + module Transproc # @api private class Compiler
Add missing frozen_string_literal: true comment
diff --git a/lib/usesthis/interview.rb b/lib/usesthis/interview.rb index abc1234..def5678 100644 --- a/lib/usesthis/interview.rb +++ b/lib/usesthis/interview.rb @@ -1,13 +1,13 @@ module UsesThis class Interview < Salt::Post - def initialize(site, path) - super(site, path) - @metadata['layout'] = 'interview' + def self.path + "interviews" end - def output_path(parent_path) - File.join(parent_path, 'interviews', @slug) + def initialize(path) + super + @layout = 'interview' end end end
Set a class path method, ditch the output_path override method.
diff --git a/server.rb b/server.rb index abc1234..def5678 100644 --- a/server.rb +++ b/server.rb @@ -22,5 +22,6 @@ :metadata => {'email' => params[:stripeEmail]}, :description => "Charge for test@example.com" ) + 'success' end end
Stop returning a charge object in POST
diff --git a/server.rb b/server.rb index abc1234..def5678 100644 --- a/server.rb +++ b/server.rb @@ -10,6 +10,8 @@ require "./lib/calculatorapp.rb" require "./lib/calculatorloader.rb" require "./lib/calculatorrouter.rb" + +# HACK: We should find a better way to handle `require'ing this file if __FILE__ == $0 CalculatorApp.configure do |app|
Document __FILE__ == $0 hack
diff --git a/lib/chbs/generator.rb b/lib/chbs/generator.rb index abc1234..def5678 100644 --- a/lib/chbs/generator.rb +++ b/lib/chbs/generator.rb @@ -2,11 +2,17 @@ require 'nokogiri' class Chbs::Generator + attr_reader :corpus def initialize(options={}) corpusname = options[:corpus] || 'tv-and-movies' - corpusdir = File.expand_path('../../../corpus/', __FILE__) - corpusfile = File.join(corpusdir, "#{corpusname}.json") + corpusfile = nil + if corpusname.include?('/') + corpusfile = corpusname + else + corpusdir = File.expand_path('../../../corpus/', __FILE__) + corpusfile = File.join(corpusdir, "#{corpusname}.json") + end @corpus = JSON.parse(File.read(corpusfile)) end
Support path to corpus file. attr_reader :corpus.
diff --git a/lib/git_tracker/runner.rb b/lib/git_tracker/runner.rb index abc1234..def5678 100644 --- a/lib/git_tracker/runner.rb +++ b/lib/git_tracker/runner.rb @@ -19,7 +19,8 @@ end def self.install - puts "`git-tracker install` is deprecated. Please use `git-tracker init`" + warn("`git-tracker install` is deprecated. Please use `git-tracker init`", uplevel: 1) + init end
Use a warning for the deprecation notice
diff --git a/lib/email_assessor.rb b/lib/email_assessor.rb index abc1234..def5678 100644 --- a/lib/email_assessor.rb +++ b/lib/email_assessor.rb @@ -18,6 +18,6 @@ file_name ||= "" domain = domain.downcase - File.open(file_name).each_line.any? { |line| domain.match?(%r{\A(?:.+\.)*?#{line.chomp}\z}i) } + File.foreach(file_name).any? { |line| domain.match?(%r{\A(?:.+\.)*?#{line.chomp}\z}i) } end end
Use File.foreach to avoid the need to close files
diff --git a/lib/feature/gitaly.rb b/lib/feature/gitaly.rb index abc1234..def5678 100644 --- a/lib/feature/gitaly.rb +++ b/lib/feature/gitaly.rb @@ -7,7 +7,6 @@ # Server feature flags should use '_' to separate words. SERVER_FEATURE_FLAGS = %w[ - get_commit_signatures cache_invalidator inforef_uploadpack_cache get_all_lfs_pointers_go
Add latest changes from gitlab-org/gitlab@master
diff --git a/lib/frecon/console.rb b/lib/frecon/console.rb index abc1234..def5678 100644 --- a/lib/frecon/console.rb +++ b/lib/frecon/console.rb @@ -6,7 +6,7 @@ begin require "pry" - Pry.start + FReCon.pry rescue Exception => e require "irb"
Include FReCon on Pry start
diff --git a/lib/alipay/sign/rsa.rb b/lib/alipay/sign/rsa.rb index abc1234..def5678 100644 --- a/lib/alipay/sign/rsa.rb +++ b/lib/alipay/sign/rsa.rb @@ -9,8 +9,8 @@ Base64.encode64(rsa.sign('sha1', string)) end - def self.verify?(string, sign) - rsa = OpenSSL::PKey::RSA.new(ALIPAY_RSA_PUBLIC_KEY) + def self.verify?(key, string, sign) + rsa = OpenSSL::PKey::RSA.new(key) rsa.verify('sha1', Base64.decode64(sign), string) end end
Fix Sign::RSA key arg missing
diff --git a/Library/Homebrew/test/utils/livecheck_formula_spec.rb b/Library/Homebrew/test/utils/livecheck_formula_spec.rb index abc1234..def5678 100644 --- a/Library/Homebrew/test/utils/livecheck_formula_spec.rb +++ b/Library/Homebrew/test/utils/livecheck_formula_spec.rb @@ -0,0 +1,39 @@+# frozen_string_literal: true + +require "utils/livecheck_formula" + +describe LivecheckFormula do + describe "init", :integration_test do + it "runs livecheck command for Formula" do + install_test_formula "testball" + + formatted_response = described_class.init("testball") + + expect(formatted_response).not_to be_nil + expect(formatted_response).to be_a(Hash) + expect(formatted_response.size).not_to eq(0) + + # expect(formatted_response[:name]).to eq("testball") + # expect(formatted_response[:formula_version]).not_to be_nil + # expect(formatted_response[:livecheck_version]).not_to be_nil + end + end + + describe "parse_livecheck_response" do + it "returns a hash of Formula version data" do + example_raw_command_response = "aacgain : 7834 ==> 1.8" + formatted_response = described_class.parse_livecheck_response(example_raw_command_response) + + expect(formatted_response).not_to be_nil + expect(formatted_response).to be_a(Hash) + + expect(formatted_response).to include(:name) + expect(formatted_response).to include(:formula_version) + expect(formatted_response).to include(:livecheck_version) + + expect(formatted_response[:name]).to eq("aacgain") + expect(formatted_response[:formula_version]).to eq("7834") + expect(formatted_response[:livecheck_version]).to eq("1.8") + end + end +end
Add tests for livecheck_formula utils
diff --git a/lib/rails-footnotes.rb b/lib/rails-footnotes.rb index abc1234..def5678 100644 --- a/lib/rails-footnotes.rb +++ b/lib/rails-footnotes.rb @@ -17,6 +17,11 @@ mattr_accessor :enabled @@enabled = false + + class << self + delegate :notes, :to => Filter + delegate :notes=, :to => Filter + end def self.run! ActiveSupport::Deprecation.warn "run! is deprecated and will be removed from future releases, use Footnotes.setup or Footnotes.enabled instead.", caller
Allow to change the notes config directly from Footnotes.setup
diff --git a/lib/oprah/test_helpers.rb b/lib/oprah/test_helpers.rb index abc1234..def5678 100644 --- a/lib/oprah/test_helpers.rb +++ b/lib/oprah/test_helpers.rb @@ -1,11 +1,11 @@ module Oprah module TestHelpers - def present_many(*args, &block) - Oprah.present_many(*args, &block) + def present_many(*args, **kwargs) + Oprah.present_many(*args, **kwargs) end - def present(*args, &block) - Oprah.present(*args, &block) + def present(*args, **kwargs) + Oprah.present(*args, **kwargs) end end end
Add kwargs splats to TestHelpers
diff --git a/rotp.gemspec b/rotp.gemspec index abc1234..def5678 100644 --- a/rotp.gemspec +++ b/rotp.gemspec @@ -5,7 +5,6 @@ s.name = "rotp" s.version = ROTP::VERSION s.platform = Gem::Platform::RUBY - s.required_ruby_version = '>= 1.9.3' s.license = "MIT" s.authors = ["Mark Percival"] s.email = ["mark@markpercival.us"]
Save minimum ruby for version 3
diff --git a/lib/pad_utils/pad_text.rb b/lib/pad_utils/pad_text.rb index abc1234..def5678 100644 --- a/lib/pad_utils/pad_text.rb +++ b/lib/pad_utils/pad_text.rb @@ -1,7 +1,7 @@ module PadUtils # Convert a string into a proper Ruby name. - # For example, 'app_name' will be converted to 'AppName' + # For example, 'app_name' will be converted to 'AppName' def self.convert_to_ruby_name(value) if value.scan(/\_|\-/).size > 0 value.split(/\_|\-/).map(&:capitalize).join @@ -9,7 +9,7 @@ value.slice(0,1).capitalize + value.slice(1..-1) end end - + # Convert a string to only alphanumeric and underscores def self.sanitize(value) value.tr('^A-Za-z0-9', '_') @@ -17,13 +17,29 @@ # Replace text within a file. # old_text can be a regex or a string - def self.replace(file, old_text, new_text) + def self.replace_in_file(file, old_text, new_text) text_update = File.read(file) text_update = text_update.gsub(old_text, new_text) File.open(file, "w") { |f| f.write(text_update) } rescue Exception => e - puts e + PadUtils.log("Error replacing #{old_text} in #{file} with #{new_text}", e) + end + + def self.insert_before(original, tag, text) + # TODO: Implement + end + + def self.insert_before_in_file(file, tag, text) + # TODO: Implement + end + + def self.insert_after(original, tag, text) + # TODO: Implement + end + + def self.insert_after_in_file(file, tag, text) + # TODO: Implement end end
Add signatures for text insert methods
diff --git a/lib/em-wpn/test_helper.rb b/lib/em-wpn/test_helper.rb index abc1234..def5678 100644 --- a/lib/em-wpn/test_helper.rb +++ b/lib/em-wpn/test_helper.rb @@ -24,13 +24,8 @@ end Client.class_eval do - unless instance_methods.include?(:deliver_with_testing) - def deliver_with_testing(notification) - EM::WPN.deliveries << notification - deliver_without_testing(notification) - end - alias :deliver_without_testing :deliver - alias :deliver :deliver_with_testing + def deliver(notification) + EM::WPN.deliveries << notification end end end
Test helper shouldn't deliver the notification
diff --git a/lib/engineyard/version.rb b/lib/engineyard/version.rb index abc1234..def5678 100644 --- a/lib/engineyard/version.rb +++ b/lib/engineyard/version.rb @@ -1,4 +1,4 @@ module EY - VERSION = '3.2.0' + VERSION = '3.2.1.pre' ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.6.3' end
Add .pre for next release
diff --git a/lib/resque_poll/engine.rb b/lib/resque_poll/engine.rb index abc1234..def5678 100644 --- a/lib/resque_poll/engine.rb +++ b/lib/resque_poll/engine.rb @@ -1,7 +1,5 @@ module ResquePoll class Engine < ::Rails::Engine isolate_namespace ResquePoll - - config.authentication_method = nil end end
Remove auth method config option
diff --git a/test/functional/notable_detailed_template_test.rb b/test/functional/notable_detailed_template_test.rb index abc1234..def5678 100644 --- a/test/functional/notable_detailed_template_test.rb +++ b/test/functional/notable_detailed_template_test.rb @@ -29,5 +29,3 @@ # assert Digest::MD5.hexdigest(File.read(@file_name)) == "ca170f534913a0f9db79c931d9d56cf2", "GOT #{Digest::MD5.hexdigest(File.read(@file_name))}" #end end - -#23c852872357f2808479275461cac1f3
Test still runs but commented out? win!
diff --git a/lib/stairway/stairs.rb b/lib/stairway/stairs.rb index abc1234..def5678 100644 --- a/lib/stairway/stairs.rb +++ b/lib/stairway/stairs.rb @@ -35,6 +35,12 @@ end end + def run_step(name, context={}, options={}) + notify(context, options) + + @steps[name].run + end + protected def notify(context, options)
Add run_step to run a single step at once
diff --git a/argf.rb b/argf.rb index abc1234..def5678 100644 --- a/argf.rb +++ b/argf.rb @@ -7,13 +7,10 @@ } # Get all lines of all files, one by one using file handles -puts ARGF.filename -ARGF.file.each_line { |line| - puts line -} -ARGF.close -puts ARGF.filename -ARGF.file.each_line { |line| - puts line -} -ARGF.close+while !ARGF.file.closed? + puts "===== Current File: #{ARGF.filename} =====" + ARGF.file.each_line { |line| + puts line + } + ARGF.close +end
Use a loop instead of the previous version which only handled exactly two files
diff --git a/0_code_wars/make_acronym.rb b/0_code_wars/make_acronym.rb index abc1234..def5678 100644 --- a/0_code_wars/make_acronym.rb +++ b/0_code_wars/make_acronym.rb @@ -0,0 +1,7 @@+# http://www.codewars.com/kata/557efeb04effce569d000022/ +# --- iteration 1 --- +def make_acronym(phrase) + return "Not a string" unless phrase.is_a?(String) + return "Not letters" unless phrase.downcase.delete("^a-z ").size == phrase.size + return phrase.split.map{ |word| word[0] }.join.upcase +end
Add code wars (7) - make acronym
diff --git a/db/migrate/20110914211417_default_email_prefs_to_true.rb b/db/migrate/20110914211417_default_email_prefs_to_true.rb index abc1234..def5678 100644 --- a/db/migrate/20110914211417_default_email_prefs_to_true.rb +++ b/db/migrate/20110914211417_default_email_prefs_to_true.rb @@ -0,0 +1,10 @@+class DefaultEmailPrefsToTrue < ActiveRecord::Migration + def self.up + User.where('email_delivery IS NULL or email_acceptance IS NULL OR email_rejection IS NULL').each do |u| + u.update_attributes :email_delivery => true, :email_acceptance => true, :email_rejection => true + end + end + + def self.down + end +end
Set email prefs to true for exising records (prior default behavior)
diff --git a/db/migrate/20190212171331_change_request_id_to_bigint.rb b/db/migrate/20190212171331_change_request_id_to_bigint.rb index abc1234..def5678 100644 --- a/db/migrate/20190212171331_change_request_id_to_bigint.rb +++ b/db/migrate/20190212171331_change_request_id_to_bigint.rb @@ -0,0 +1,9 @@+class ChangeRequestIdToBigint < ActiveRecord::Migration[6.0] + def up + change_column :requests, :id, :bigint + end + + def down + change_column :requests, :id, :integer + end +end
Update request_id primary key to bigint
diff --git a/lib/gds_api/helpers.rb b/lib/gds_api/helpers.rb index abc1234..def5678 100644 --- a/lib/gds_api/helpers.rb +++ b/lib/gds_api/helpers.rb @@ -0,0 +1,25 @@+require 'gds_api/publisher' +require 'gds_api/imminence' +require 'gds_api/panopticon' + +module GdsApi + module Helpers + def publisher_api + @api ||= GdsApi::Publisher.new(Plek.current.environment) + end + + def imminence_api + @imminence_api ||= GdsApi::Imminence.new(Plek.current.environment) + end + + def panopticon_api + @panopticon_api ||= GdsApi::Panopticon.new(Plek.current.environment) + end + + def self.included(klass) + if klass.respond_to?(:helper_method) + klass.helper_method :publisher_api, :panopticon_api, :imminence_api + end + end + end +end
Add a helper module that can be used in our apps' controllers
diff --git a/SVWebViewController.podspec b/SVWebViewController.podspec index abc1234..def5678 100644 --- a/SVWebViewController.podspec +++ b/SVWebViewController.podspec @@ -6,7 +6,7 @@ s.license = 'MIT' s.author = { 'Sam Vermette' => 'hello@samvermette.com' } s.source = { :git => 'https://github.com/samvermette/SVWebViewController.git', :tag => s.version.to_s } - s.platform = :ios + s.platform = :ios, '7.0' s.source_files = 'SVWebViewController/*.{h,m}' s.resources = 'SVWebViewController/SVWebViewController.bundle' s.requires_arc = true
Make podspec iOS 7 only.
diff --git a/lib/locale_kit/version.rb b/lib/locale_kit/version.rb index abc1234..def5678 100644 --- a/lib/locale_kit/version.rb +++ b/lib/locale_kit/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module LocaleKit - VERSION = '0.0.3'.freeze + VERSION = "0.0.3" end
Change syntax for raise rubocop offences
diff --git a/helpers/utils.rb b/helpers/utils.rb index abc1234..def5678 100644 --- a/helpers/utils.rb +++ b/helpers/utils.rb @@ -1,6 +1,6 @@ def valid_datatype(datatype) - return ['int', 'double', 'float', 'string', 'String', 'bool', 'boolean', 'char'].include? datatype.chomp + return ['short', 'byte', 'char', 'int', 'double', 'float', 'string', 'String', 'bool', 'boolean'].include? datatype.chomp end def valid_name?(name)
Add more valid data types
diff --git a/lib/wright/provider.rb b/lib/wright/provider.rb index abc1234..def5678 100644 --- a/lib/wright/provider.rb +++ b/lib/wright/provider.rb @@ -2,26 +2,26 @@ require 'wright/util/recursive_autoloader' module Wright - # Public: Provider class. + # Provider class. class Provider - # Public: Wright standard provider directory. + # Wright standard provider directory PROVIDER_DIR = File.expand_path('provider', File.dirname(__FILE__)) Wright::Util::RecursiveAutoloader.add_autoloads(PROVIDER_DIR, name) - # Public: Initialize a Provider. + # Initializes a Provider. # - # resource - The resource used by the provider, typically a - # Wright::Resource. + # @param resource [Resource] the resource used by the provider def initialize(resource) @resource = resource @updated = false end - # Public: Checks if the provider was updated since the last call - # to updated?. + # Checks if the provider was updated since the last call to + # {#updated?} # - # Returns true if the provider was updated and false otherwise. + # @return [Bool] true if the provider was updated and false + # otherwise def updated? updated = @updated @updated = false
Convert Provider top level docs to yard
diff --git a/manifests/cf-manifest/scripts/generate-cf-secrets.rb b/manifests/cf-manifest/scripts/generate-cf-secrets.rb index abc1234..def5678 100644 --- a/manifests/cf-manifest/scripts/generate-cf-secrets.rb +++ b/manifests/cf-manifest/scripts/generate-cf-secrets.rb @@ -0,0 +1,43 @@+#!/usr/bin/env ruby + +require 'optparse' +require 'yaml' +require File.expand_path("../../../shared/lib/secret_generator", __FILE__) + +generator = SecretGenerator.new({ + "vcap_password" => :sha512_crypted, + "cf_db_master_password" => :simple, + "cf_db_api_password" => :simple, + "cf_db_uaa_password" => :simple, + "staging_upload_password" => :simple, + "bulk_api_password" => :simple, + "nats_password" => :simple, + "router_password" => :simple, + "uaa_batch_password" => :simple, + "uaa_admin_password" => :simple, + "cc_db_encryption_key" => :simple, + "uaa_admin_client_secret" => :simple, + "uaa_cc_client_secret" => :simple, + "uaa_cc_routing_secret" => :simple, + "uaa_clients_app_direct_secret" => :simple, + "uaa_clients_developer_console_secret" => :simple, + "uaa_clients_login_secret" => :simple, + "uaa_clients_notifications_secret" => :simple, + "uaa_clients_doppler_secret" => :simple, + "uaa_clients_cloud_controller_username_lookup_secret" => :simple, + "uaa_clients_gorouter_secret" => :simple, + "uaa_clients_firehose_password" => :simple, + "loggregator_endpoint_shared_secret" => :simple, + "consul_encrypt_keys" => :simple_in_array, +}) + +OptionParser.new do |opts| + opts.on('--existing-secrets FILE') do |file| + existing_secrets = YAML.load_file(file) + # An empty file parses as false + generator.existing_secrets = existing_secrets["secrets"] if existing_secrets + end +end.parse! + +output = { "secrets" => generator.generate } +puts output.to_yaml
Create new CF secret generator that uses new lib This will allow us to pass in the existing secrets so that only ones that are missing will be generated.
diff --git a/lib/wicked_pdf/railtie.rb b/lib/wicked_pdf/railtie.rb index abc1234..def5678 100644 --- a/lib/wicked_pdf/railtie.rb +++ b/lib/wicked_pdf/railtie.rb @@ -3,12 +3,16 @@ if defined?(Rails) - if Rails::VERSION::MAJOR == 4 + if Rails::VERSION::MAJOR == 3 class WickedRailtie < Rails::Railtie initializer 'wicked_pdf.register' do |app| ActionController::Base.send :include, PdfHelper - ActionView::Base.send :include, WickedPdfHelper::Assets + if Rails::VERSION::MINOR > 0 && Rails.configuration.assets.enabled + ActionView::Base.send :include, WickedPdfHelper::Assets + else + ActionView::Base.send :include, WickedPdfHelper + end end end @@ -26,11 +30,7 @@ class WickedRailtie < Rails::Railtie initializer 'wicked_pdf.register' do |app| ActionController::Base.send :include, PdfHelper - if Rails::VERSION::MINOR > 0 && Rails.configuration.assets.enabled - ActionView::Base.send :include, WickedPdfHelper::Assets - else - ActionView::Base.send :include, WickedPdfHelper - end + ActionView::Base.send :include, WickedPdfHelper::Assets end end
Split Railtie logic for Rails 2, 3, and 4+
diff --git a/lib/purpur/helpers.rb b/lib/purpur/helpers.rb index abc1234..def5678 100644 --- a/lib/purpur/helpers.rb +++ b/lib/purpur/helpers.rb @@ -8,7 +8,7 @@ content_tag(:span, {class: styleclass, data: { icon: Purpur.icon_name(name), 'icon-size' => size }}.deep_merge(options)) do content_tag(:span, class: 'icon--wrapper') do content_tag(:svg, class: 'icon--cnt') do - content_tag('use', nil, 'xlink:href' => "#{asset_url('purpur.svg')}##{name}-icon", 'x' => 0, 'y' => 0) + content_tag('use', nil, 'xlink:href' => "#{asset_url('purpur.svg')}##{Purpur.icon_name(name)}-icon", 'x' => 0, 'y' => 0) end end end
Fix synonym set for the icons
diff --git a/spec/services/ci/stop_environment_service_spec.rb b/spec/services/ci/stop_environment_service_spec.rb index abc1234..def5678 100644 --- a/spec/services/ci/stop_environment_service_spec.rb +++ b/spec/services/ci/stop_environment_service_spec.rb @@ -7,7 +7,7 @@ let(:service) { described_class.new(project, user) } describe '#execute' do - context 'when environment exists' do + context 'when environment with review app exists' do before do create(:environment, :with_review_app, project: project) end @@ -17,6 +17,54 @@ service.execute('master') end + + context 'when specified branch does not exist' do + it 'does not stop environment' do + expect_any_instance_of(Environment).not_to receive(:stop!) + + service.execute('non/existent/branch') + end + end + + context 'when no branch not specified' do + it 'does not stop environment' do + expect_any_instance_of(Environment).not_to receive(:stop!) + + service.execute(nil) + end + end + + context 'when environment is not stoppable' do + before do + allow_any_instance_of(Environment) + .to receive(:stoppable?).and_return(false) + end + + it 'does not stop environment' do + expect_any_instance_of(Environment).not_to receive(:stop!) + + service.execute('master') + end + end + end + + context 'when there is no environment associated with review app' do + before do + create(:environment, project: project) + end + + it 'does not stop environment' do + expect_any_instance_of(Environment).not_to receive(:stop!) + + service.execute('master') + end + end + + context 'when environment does not exist' do + it 'does not raise error' do + expect { service.execute('master') } + .not_to raise_error + end end end end
Extend tests for service that stops environment
diff --git a/4_custom/reverse_linked_list.rb b/4_custom/reverse_linked_list.rb index abc1234..def5678 100644 --- a/4_custom/reverse_linked_list.rb +++ b/4_custom/reverse_linked_list.rb @@ -0,0 +1,88 @@+require_relative "./testable" + +class ReverseLinkedList + include Testable + + # Definition for singly-linked list. + # @param {ListNode} head + # @return {ListNode} + class ListNode + attr_accessor :val, :next + def initialize(val) + @val = val + @next = nil + end + + def to_s + vals = [] + n = self + until n.nil? + vals << n.val + n = n.next + end + "[#{vals.join(",")}]" + end + + def ==(other) + self.to_s == other.to_s + end + end + + def reverse_list(head) + return nil unless head.is_a?(ListNode) + node = head + prev = nil + # get node + until node.nil? + # store the node's next element + old_next = node.next + # set pointer to previous + node.next = prev + # set previous node to current + prev = node + # get next node + node = old_next + end + prev + end + + def test_cases + one_node_list = generate_list([1]) + one_node_list_rev = generate_list([1]) + + two_node_list = generate_list([1, 2]) + two_node_list_rev = generate_list([2, 1]) + base = { method_name: "reverse_list" } + + one_thousand_element_arr = [*1..1000].shuffle + one_thousand_element_arr_rev = one_thousand_element_arr.reverse + + one_thousand_node_list = generate_list(one_thousand_element_arr) + one_thousand_node_list_rev = generate_list(one_thousand_element_arr_rev) + + [ + { name: "empty array", in: [], out: nil }, + { name: "nil", in: nil, out: nil }, + { name: "string", in: "invalid", out: nil }, + { name: "one node", in: one_node_list, out: one_node_list }, + { name: "two nodes", in: two_node_list, out: two_node_list_rev }, + { name: "thousand nodes", in: one_thousand_node_list, out: one_thousand_node_list_rev }, + ].map{ |h| base.merge(h) } + end + + private + + def generate_list(vals) + return nil unless vals.is_a?(Array) + head = ListNode.new(vals.shift) + node = head + until vals.empty? + old_node = node + node = ListNode.new(vals.shift) + old_node.next = node + end + head + end +end + +ReverseLinkedList.new.test
Add iterative reverse linked list
diff --git a/lib/modalsupport/mixins/bracket_constructor.rb b/lib/modalsupport/mixins/bracket_constructor.rb index abc1234..def5678 100644 --- a/lib/modalsupport/mixins/bracket_constructor.rb +++ b/lib/modalsupport/mixins/bracket_constructor.rb @@ -1,4 +1,26 @@-# Mixin that adds a [] operator constructor to a class +# Mixin that adds a [] operator constructor to a class, which +# is a not-so-ugly alternative to the +new+ method. +# +# class A +# include BracketConstructor +# def initialize(a) +# puts "A.new(#{a.inspect})" +# end +# end +# +# A[100] # => A.new(100) +# +# In Rails, this kind of constructor has an advantage over a function such as: +# +# def A(*args) +# A.new(*args) +# end +# +# With the A[] notation we've referenced the class name via the constant A, +# which in Rails brings in the declaration for A automatically, whereas the +# method A() won't be found unless the file which declares it is explicitely +# required. +# module ModalSupport::BracketConstructor def self.included(base)
Add some comments to BracketConstructor.
diff --git a/examples/livefeed_loop.rb b/examples/livefeed_loop.rb index abc1234..def5678 100644 --- a/examples/livefeed_loop.rb +++ b/examples/livefeed_loop.rb @@ -13,7 +13,7 @@ result = client.next_result result.posts.each do |post| - puts "#{post.indexed} - #{post.url}" + puts "#{post.indexed_at} - #{post.url}" end # You're faster than Twingly! Take a break and wait for
Fix attribute for livefeed loop example Was changed in dff29e6808ce9cbdbee94a5fdc8970610b4a7cdd
diff --git a/site-cookbooks/backup_restore/spec/recipes/restore_ruby_spec.rb b/site-cookbooks/backup_restore/spec/recipes/restore_ruby_spec.rb index abc1234..def5678 100644 --- a/site-cookbooks/backup_restore/spec/recipes/restore_ruby_spec.rb +++ b/site-cookbooks/backup_restore/spec/recipes/restore_ruby_spec.rb @@ -0,0 +1,48 @@+require_relative '../spec_helper' + +describe 'backup_restore::restore_ruby' do + let(:chef_run) do + runner = ChefSpec::Runner.new( + cookbook_path: %w(site-cookbooks cookbooks), + platform: 'centos', + version: '6.5' + ) do |node| + node.set['cloudconductor']['applications'] = { + dynamic_git_app: { + type: 'dynamic', + parameters: { + backup_directories: '/var/www/app' + } + } + } + end + runner.converge(described_recipe) + end + + tmp_dir = '/tmp/backup/restore' + backup_name = 'ruby_full' + backup_file = "#{tmp_dir}/#{backup_name}.tar" + + it 'create base_path' do + expect(chef_run).to create_directory('/var/www').with( + recursive: true + ) + end + + it 'extract_full_backup' do + allow(::File).to receive(:exist?).and_call_original + allow(::File).to receive(:exist?).with(backup_file).and_return(true) + allow(::Dir).to receive(:exist?).and_call_original + allow(::Dir).to receive(:exist?).with("#{tmp_dir}/#{backup_name}").and_return(false) + expect(chef_run).to run_bash('extract_full_backup').with( + code: <<-EOF + tar -xvf #{backup_file} -C #{tmp_dir} + tar -zxvf #{tmp_dir}/#{backup_name}/archives/ruby.tar.gz -C #{chef_run.node['rails_part']['app']['base_path']} + EOF + ) + end + + it 'link_to_latest_version' do + expect(chef_run).to run_ruby_block('link_to_latest_version') + end +end
Add chef-spec for restore_ruby recipe
diff --git a/lib/phare/check/jshint.rb b/lib/phare/check/jshint.rb index abc1234..def5678 100644 --- a/lib/phare/check/jshint.rb +++ b/lib/phare/check/jshint.rb @@ -8,7 +8,7 @@ @config = File.expand_path("#{directory}.jshintrc", __FILE__) @path = File.expand_path("#{directory}app/assets/javascripts", __FILE__) @glob = File.join(@path, '**/*') - @extensions = %w(.js .js.es6) + @extensions = %w(.js .es6) @options = options super
Fix issue with es6 extension with JSHint
diff --git a/hurley.gemspec b/hurley.gemspec index abc1234..def5678 100644 --- a/hurley.gemspec +++ b/hurley.gemspec @@ -9,6 +9,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.0" + spec.add_development_dependency "sinatra", "~> 1.4" spec.authors = contributors.keys.compact spec.description = %q{Hurley provides a common interface for working with different HTTP adapters.} spec.email = contributors.values.compact
Add sinatra as development dependency for testing purposes Used for test suite
diff --git a/lib/quartz/validations.rb b/lib/quartz/validations.rb index abc1234..def5678 100644 --- a/lib/quartz/validations.rb +++ b/lib/quartz/validations.rb @@ -5,12 +5,21 @@ File.exist?(File.join(directory, 'go')) end - raise 'Go not installed' unless go_exists + raise 'Go not installed.' unless go_exists end def self.check_go_quartz_version current_pulse = File.read(File.join(File.dirname(__FILE__), '../../go/quartz/quartz.go')) - installed_pulse = File.read(File.join(ENV['GOPATH'], + + installed_pulse_dir = ENV['GOPATH'].split(File::PATH_SEPARATOR).select do |directory| + File.exist?(File.join(directory, 'src/github.com/DavidHuie/quartz/go/quartz/quartz.go')) + end[0] + + unless installed_pulse_dir + raise "GOPATH not configured." + end + + installed_pulse = File.read(File.join(installed_pulse_dir, 'src/github.com/DavidHuie/quartz/go/quartz/quartz.go')) if current_pulse != installed_pulse
Support multiple directories in GOPATH
diff --git a/lib/quill/builder/html.rb b/lib/quill/builder/html.rb index abc1234..def5678 100644 --- a/lib/quill/builder/html.rb +++ b/lib/quill/builder/html.rb @@ -25,6 +25,12 @@ attrs << ['<b>', '</b>'] when 'italic' attrs << ['<i>', '</i>'] + when 'underline' + attrs << ['<u>', '</u>'] + when 'strike' + attrs << ['<s>', '</s>'] + when 'background' + attrs << [%Q|<span style="background-color: #{value}">|, '</span>'] when 'color' attrs << [%Q|<span style="color: #{value}">|, '</span>'] end
Support underline, strike and background
diff --git a/lib/tent-client/middleware/content_type_header.rb b/lib/tent-client/middleware/content_type_header.rb index abc1234..def5678 100644 --- a/lib/tent-client/middleware/content_type_header.rb +++ b/lib/tent-client/middleware/content_type_header.rb @@ -4,7 +4,7 @@ module Middleware class ContentTypeHeader < Faraday::Middleware CONTENT_TYPE_HEADER = 'Content-Type'.freeze - MEDIA_TYPE = %w(application/vnd.tent.post.v0+json; type="%s").freeze + MEDIA_TYPE = %(application/vnd.tent.post.v0+json; type="%s").freeze def call(env) if env[:body] && Hash === env[:body]
Fix content type header middleware
diff --git a/neo-dci.gemspec b/neo-dci.gemspec index abc1234..def5678 100644 --- a/neo-dci.gemspec +++ b/neo-dci.gemspec @@ -15,7 +15,7 @@ gem.require_paths = ["lib"] gem.version = Neo::DCI::VERSION - gem.add_runtime_dependency 'on', '~> 0.3.3' + gem.add_runtime_dependency 'on', '~> 1.0.0' gem.add_development_dependency 'rake' gem.add_development_dependency 'rdoc'
Upgrade 'on' gem to 1.0.0
diff --git a/lib/tasks/emails.rake b/lib/tasks/emails.rake index abc1234..def5678 100644 --- a/lib/tasks/emails.rake +++ b/lib/tasks/emails.rake @@ -2,14 +2,14 @@ task send_emails: :environment do next unless PullRequest.in_date_range? - User.all.each do |user| + User.all.find_each do |user| Notification.new(user).send_email # rescue nil end end desc 'Send a november reminder to everyone' task send_reminder: :environment do - User.where("email <> ''").where.not(email_frequency: 'none').each do |user| + User.where("email <> ''").where.not(email_frequency: 'none').find_each do |user| ReminderMailer.november(user).deliver_now rescue nil end end
Load users in batches in email tasks
diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index abc1234..def5678 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -1,10 +1,12 @@ namespace :import do + # usage rake import:all_photos['~/Pictures'] task :all_photos, [:path] => :environment do |t, args| require "album_set_processor" AlbumSetProcessor.new(args.path).syncronize_photos end + # usage rake import:photos['~/Pictures/Hawaii'] task :photos, [:path] => :environment do |t, args| require "album_processor"
Add usage comments for tasks
diff --git a/lib/tasks/travis.rake b/lib/tasks/travis.rake index abc1234..def5678 100644 --- a/lib/tasks/travis.rake +++ b/lib/tasks/travis.rake @@ -27,7 +27,6 @@ db:migrate tmp:create spec - js:test js:lint spec:coverage:ensure ]
Disable JS tests until we sort out buster.
diff --git a/app/controllers/spree/conekta/payments_controller.rb b/app/controllers/spree/conekta/payments_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spree/conekta/payments_controller.rb +++ b/app/controllers/spree/conekta/payments_controller.rb @@ -1,5 +1,6 @@ module Spree::Conekta class PaymentsController < Spree::StoreController + helper Spree::OrdersHelper ssl_required skip_before_filter :verify_authenticity_token, only: :create
Add OrderHelpers for FIX error in show the payments for missing order_just_completed? method
diff --git a/app/models/concerns/is_an_entity_with_identifiers.rb b/app/models/concerns/is_an_entity_with_identifiers.rb index abc1234..def5678 100644 --- a/app/models/concerns/is_an_entity_with_identifiers.rb +++ b/app/models/concerns/is_an_entity_with_identifiers.rb @@ -12,6 +12,16 @@ new_model.identifiers = new_model.identified_by true end + end + + def add_identifier(identifier) + self.identified_by ||= [] + self.identified_by << identifier + end + + def remove_identifier(identifier) + self.not_identified_by ||= [] + self.not_identified_by << identifier end def before_update_making_history(changeset)
Add add_identifier and remove_identifier methods to IsAnEntityWithIdentifiers concern
diff --git a/lib/spork/run_strategy.rb b/lib/spork/run_strategy.rb index abc1234..def5678 100644 --- a/lib/spork/run_strategy.rb +++ b/lib/spork/run_strategy.rb @@ -28,7 +28,7 @@ protected def self.factory(test_framework) - if RUBY_PLATFORM =~ /mswin/ + if RUBY_PLATFORM =~ /mswin|mingw/ Spork::RunStrategy::Magazine.new(test_framework) else Spork::RunStrategy::Forking.new(test_framework)
Work with mingw compiled versions of Windows.
diff --git a/minitest_to_rspec.gemspec b/minitest_to_rspec.gemspec index abc1234..def5678 100644 --- a/minitest_to_rspec.gemspec +++ b/minitest_to_rspec.gemspec @@ -9,8 +9,8 @@ spec.authors = ["Jared Beck"] spec.email = ["jared@jaredbeck.com"] - spec.summary = %q{Converts minitest files to rspec} - spec.homepage = nil + spec.summary = "Converts minitest files to rspec" + spec.homepage = "https://github.com/jaredbeck/minitest_to_rspec" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f|
Add homepage to gemspec [ci skip]