diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/libdetect.rb b/lib/libdetect.rb index abc1234..def5678 100644 --- a/lib/libdetect.rb +++ b/lib/libdetect.rb @@ -14,7 +14,7 @@ File.exist? DARWIN_LIBCLANG ENV['LIBCLANG'] = DARWIN_LIBCLANG when /linux/ - prog = 'llvm-config-3.4' + prog = 'llvm-config' if find_executable(prog) ENV['LLVM_CONFIG'] = prog end
Use the generic llvm-config for library detection
diff --git a/lib/tasks/legislation_proposals.rake b/lib/tasks/legislation_proposals.rake index abc1234..def5678 100644 --- a/lib/tasks/legislation_proposals.rake +++ b/lib/tasks/legislation_proposals.rake @@ -0,0 +1,10 @@+namespace :legislation_proposals do + desc "Calculate cached votes score for existing legislation proposals" + task calculate_cached_votes_score: :environment do + Legislation::Proposal.find_each do |p| + p.update_column(:cached_votes_score, p.cached_votes_up - p.cached_votes_down) + print "." + end + puts "\nTask finished 🎉" + end +end
Add rake task to calculate cached voted score Run this task it's only necessary if already existing legislation proposals in DB.
diff --git a/lib/inkling/attribute_initialization.rb b/lib/inkling/attribute_initialization.rb index abc1234..def5678 100644 --- a/lib/inkling/attribute_initialization.rb +++ b/lib/inkling/attribute_initialization.rb @@ -4,7 +4,7 @@ def initialize_attributes(attributes = {}) attributes.each do |key, val| if respond_to?("#{key}=") - val = Time.parse(val) if key.to_s[-3, 3] == "_at" + val = Time.parse(val) if key.to_s[-3, 3] == "_at" && !val.is_a?(Time) val = val.to_i if key.to_s == "id" && !val.nil? send("#{key}=", val) end
Handle case where _at field is already a time
diff --git a/lib/kumo_dockercloud/haproxy_service.rb b/lib/kumo_dockercloud/haproxy_service.rb index abc1234..def5678 100644 --- a/lib/kumo_dockercloud/haproxy_service.rb +++ b/lib/kumo_dockercloud/haproxy_service.rb @@ -12,7 +12,9 @@ raise KumoDockerCloud::Error.new('Could not get instances of the haproxy container for this environment') if haproxy_containers.empty? - haproxy_containers.each { |haproxy_container| haproxy_container.disable_server(service_to_disable) } + haproxy_threads = haproxy_containers.map { |haproxy_container| Thread.new { haproxy_container.disable_server(service_to_disable) } } + haproxy_threads.each(&:join) + end end end
Make haproxy disable call multithreaded
diff --git a/features/step_definitions/format_steps.rb b/features/step_definitions/format_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/format_steps.rb +++ b/features/step_definitions/format_steps.rb @@ -1,3 +1,11 @@+CSVLib = if RUBY_VERSION =~ /^1.8/ + require 'fastercsv' + FasterCSV + else + require 'csv' + CSV + end + Then "I should see nicely formatted datetimes" do page.body.should =~ /\w+ \d{1,2}, \d{4} \d{2}:\d{2}/ end @@ -14,7 +22,7 @@ body = page.driver.response.body begin - csv = CSV.parse(body) + csv = CSVLib.parse(body) table.raw.each_with_index do |expected_row, row_index| expected_row.each_with_index do |expected_cell, col_index| cell = csv.try(:[], row_index).try(:[], col_index)
Add support for running features with ruby 1.8.7 (CSV)
diff --git a/lib/opml_file.rb b/lib/opml_file.rb index abc1234..def5678 100644 --- a/lib/opml_file.rb +++ b/lib/opml_file.rb @@ -23,7 +23,7 @@ original_name.gsub(/[^\w\.\-]/, '_') end - protected + private def save(content) written = 0
Use private modifier since no inheritance or whatsoever
diff --git a/lib/rubocop/cop/rspec/describe_class.rb b/lib/rubocop/cop/rspec/describe_class.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/rspec/describe_class.rb +++ b/lib/rubocop/cop/rspec/describe_class.rb @@ -20,8 +20,6 @@ class DescribeClass < Cop include RuboCop::RSpec::TopLevelDescribe - RAILS_METADATA_TYPES = %i(request feature routing view).freeze - MSG = 'The first argument to describe should be '\ 'the class or module being tested.'.freeze @@ -36,21 +34,20 @@ (hash $...)) PATTERN + def_node_matcher :rails_metadata?, <<-PATTERN + (pair + (sym :type) + (sym {:request :feature :routing :view})) + PATTERN + def on_top_level_describe(node, args) return if valid_describe?(node) describe_with_metadata(node) do |pairs| - return if pairs.any? { |pair| rails_metadata?(*pair) } + return if pairs.any?(&method(:rails_metadata?)) end add_offense(args.first, :expression) - end - - private - - def rails_metadata?(key, value) - key.eql?(s(:sym, :type)) && - RAILS_METADATA_TYPES.include?(value.children.first) end end end
Add node matcher for rails metadata
diff --git a/lib/sequent/web/sinatra/form_helpers.rb b/lib/sequent/web/sinatra/form_helpers.rb index abc1234..def5678 100644 --- a/lib/sequent/web/sinatra/form_helpers.rb +++ b/lib/sequent/web/sinatra/form_helpers.rb @@ -1,4 +1,5 @@ require_relative 'form' +require 'rack/csrf' module Sequent module Web
Add missing require for rack/csrf
diff --git a/lib/safety_pin/query_builder.rb b/lib/safety_pin/query_builder.rb index abc1234..def5678 100644 --- a/lib/safety_pin/query_builder.rb +++ b/lib/safety_pin/query_builder.rb @@ -8,6 +8,9 @@ results = JSON.parse(response) paths = results.fetch("hits").map {|hit| hit.fetch("path") } paths.map {|path| Node.find(path) } + rescue RestClient::ExceptionWithResponse => e + query_string = query.map {|k,v| "#{k}=#{v}"}.join("&") + raise QueryBuilderError.new("returned error status #{e.http_code} for query #{query_string.inspect}") end def self.url @@ -18,4 +21,6 @@ url.to_s end end + + class QueryBuilderError < Exception; end end
Raise QueryBuilderError with helpful status
diff --git a/DeskKit/DeskKit.podspec b/DeskKit/DeskKit.podspec index abc1234..def5678 100644 --- a/DeskKit/DeskKit.podspec +++ b/DeskKit/DeskKit.podspec @@ -10,6 +10,5 @@ s.source_files = 'DeskKit/DeskKit/*.{h,m}', 'DeskKit/DeskKit/**/*.{h,m}' s.resources = 'DeskKit/DeskKit/**/*.{png,storyboard}' s.requires_arc = true - s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' } - s.dependency 'DeskAPIClient', '~> 1.1.3' + s.dependency 'DeskAPIClient', '~> 1.1.4' end
Update podspec to point to DeskAPIClient 1.1.4 and enable bitcode.
diff --git a/test/cookbooks/test/recipes/default.rb b/test/cookbooks/test/recipes/default.rb index abc1234..def5678 100644 --- a/test/cookbooks/test/recipes/default.rb +++ b/test/cookbooks/test/recipes/default.rb @@ -6,3 +6,12 @@ php_fpm_pool 'test-pool' do action :install end + +# add a channel +php_pear_channel 'pear.php.net' do + action :update +end + +# install a package from the pear.php.net channel +# http://pear.php.net/package/HTTP2 +php_pear 'HTTP2'
Test all the resources in the resource test suite Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/open_exchange_rates.rb b/lib/open_exchange_rates.rb index abc1234..def5678 100644 --- a/lib/open_exchange_rates.rb +++ b/lib/open_exchange_rates.rb @@ -6,7 +6,7 @@ require "open_exchange_rates/rates" module OpenExchangeRates - BASE_URL = "http://openexchangerates.org/api".freeze + BASE_URL = "https://openexchangerates.org/api".freeze LATEST_URL = "#{BASE_URL}/latest.json" class << self
Change API base url to use HTTPS https://github.com/vlado/open_exchange_rates/pull/9#issuecomment-239127834
diff --git a/LRImageManager.podspec b/LRImageManager.podspec index abc1234..def5678 100644 --- a/LRImageManager.podspec +++ b/LRImageManager.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = 'LRImageManager' - s.version = '0.2' + s.version = '0.3' s.license = 'MIT' s.summary = 'Objective-C simple image manager with memory and disk cache support.' s.homepage = 'https://github.com/luisrecuenco/LRImageManager.git' s.author = { "Luis Recuenco" => "luisrecuenco@gmail.com" } - s.source = { :git => 'https://github.com/luisrecuenco/LRImageManager.git', :tag => '0.2' } + s.source = { :git => 'https://github.com/luisrecuenco/LRImageManager.git', :tag => '0.3' } s.platform = :ios, '6.0' s.source_files = 'LRImageManager' s.requires_arc = true
Make podspec point to version 0.3
diff --git a/spec/features/companies/company_adds_offer_spec.rb b/spec/features/companies/company_adds_offer_spec.rb index abc1234..def5678 100644 --- a/spec/features/companies/company_adds_offer_spec.rb +++ b/spec/features/companies/company_adds_offer_spec.rb @@ -2,6 +2,7 @@ RSpec.describe "Company adds Offer" do let(:company) { Company.first || FactoryGirl.create(:company) } + let!(:country) { FactoryGirl.create(:country) } before do login_as(company, scope: :user) @@ -20,6 +21,7 @@ page.find("#offer_salary_min").set(1000) page.find("#offer_salary_max").set(2000) page.find("#offer_contact_email").set("foobar@example.com") + page.find("#offer_country_id").set(country.name_en) page.find("#offer_contact_phone").set("555 100-888") page.find("#offer_location").set("Berlin") page.find("#offer_description").set("We're looking for welders!")
Fix feature spec for adding offers
diff --git a/spec/lib/admin_module/pages/login_page_400_spec.rb b/spec/lib/admin_module/pages/login_page_400_spec.rb index abc1234..def5678 100644 --- a/spec/lib/admin_module/pages/login_page_400_spec.rb +++ b/spec/lib/admin_module/pages/login_page_400_spec.rb @@ -19,7 +19,16 @@ config.ams_version = "4.0.0" end - allow_any_instance_of(AdminModule::Pages::LoginPage400).to receive(:get_dynamic_url).and_return(HtmlSpec.url_for("login400.aspx.html")) + base_url = ENV['AM_LIVE_BASE_URL_400'] + login_url = "login400.aspx.html" + + unless base_url.nil? || base_url.empty? + HtmlSpec.always_use_server = true + login_url = File.join(base_url, "user/login.aspx") + else + HtmlSpec.always_use_server = false + end + allow_any_instance_of(AdminModule::Pages::LoginPage400).to receive(:get_dynamic_url).and_return(HtmlSpec.url_for(login_url)) end context "logging in" do
Add support for testing with live v4.0.0 site Use AM_LIVE_BASE_URL_400 env var to specify base url to test with.
diff --git a/lib/queueing_rabbit/job.rb b/lib/queueing_rabbit/job.rb index abc1234..def5678 100644 --- a/lib/queueing_rabbit/job.rb +++ b/lib/queueing_rabbit/job.rb @@ -11,7 +11,7 @@ end def queue_name - @queue_name ||= self.name.split('::')[-1] + @queue_name ||= (self.name.split('::')[-1] if self.name) end def queue_options
Allow including Job module to anonymous classes.
diff --git a/Library/Formula/solr.rb b/Library/Formula/solr.rb index abc1234..def5678 100644 --- a/Library/Formula/solr.rb +++ b/Library/Formula/solr.rb @@ -10,9 +10,9 @@ end_script class Solr <Formula - url 'http://apache.deathculture.net/lucene/solr/1.3.0/apache-solr-1.3.0.tgz' + url 'http://apache.deathculture.net/lucene/solr/1.4.0/apache-solr-1.4.0.tgz' homepage 'http://lucene.apache.org/solr/' - md5 '23774b077598c6440d69016fed5cc810' + md5 '1cc3783316aa1f95ba5e250a4c1d0451' def install prefix.mkpath
Update Solr Formula to 1.4.0
diff --git a/HTDelegateProxy.podspec b/HTDelegateProxy.podspec index abc1234..def5678 100644 --- a/HTDelegateProxy.podspec +++ b/HTDelegateProxy.podspec @@ -5,7 +5,7 @@ s.homepage = "https://github.com/hoteltonight/HTDelegateProxy" s.license = 'MIT' s.author = { "Jacob Jennings" => "jacob.r.jennings@gmail.com" } - s.source = { :git => "https://github.com/hoteltonight/HTDelegateProxy.git", :tag => "0.0.1" } + s.source = { :git => "https://github.com/hoteltonight/HTDelegateProxy.git", :tag => "0.0.2" } s.ios.deployment_target = '4.3' s.osx.deployment_target = '10.5' s.source_files = 'Classes', '*.{h,m}'
Update HTDelegateProxt.podspec with 0.0.2 version and tag.
diff --git a/cmake30.rb b/cmake30.rb index abc1234..def5678 100644 --- a/cmake30.rb +++ b/cmake30.rb @@ -22,8 +22,8 @@ class Cmake30 < Formula homepage 'http://www.cmake.org/' - url 'http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz' - sha1 '4dfd9ee9b829c77175d655f22322f14747f11ad2' + url 'http://www.cmake.org/files/v3.0/cmake-3.0.2.tar.gz' + sha1 '379472e3578902a1d6f8b68a9987773151d6f21a' keg_only 'Enable installation of several CMake versions'
Upgrade CMake 3 to v3.0.2
diff --git a/merb-gen/lib/generators/templates/component/model/spec/models/%file_name%_spec.rb b/merb-gen/lib/generators/templates/component/model/spec/models/%file_name%_spec.rb index abc1234..def5678 100644 --- a/merb-gen/lib/generators/templates/component/model/spec/models/%file_name%_spec.rb +++ b/merb-gen/lib/generators/templates/component/model/spec/models/%file_name%_spec.rb @@ -1,6 +1,6 @@ require File.join( File.dirname(__FILE__), <%= go_up(modules.size + 1) %>, "spec_helper" ) -describe <%= class_name %> do +describe <%= full_class_name %> do it "should have specs"
[merb-gen] Fix for generation of namespaced model specs [#1233 state:resolved]
diff --git a/spec/controllers/revision_feedback_controller_spec.rb b/spec/controllers/revision_feedback_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/revision_feedback_controller_spec.rb +++ b/spec/controllers/revision_feedback_controller_spec.rb @@ -21,10 +21,6 @@ it 'calls RevisionFeedbackService with features' do VCR.use_cassette 'ores_features' do - # Checks if the RevisionFeedbackService is initialized with valid features - expect_any_instance_of(RevisionFeedbackService).to receive(:initialize) - .with(have_key('feature.enwiki.revision.cite_templates')) - # Checks if a valid feedback is received from RevisionFeedbackService expect_any_instance_of(RevisionFeedbackService).to receive(:feedback) .and_return(have_at_least(1))
Fix warning for stubbing initialize
diff --git a/spec/unit/puppet/provider/package/appdmg_eula_spec.rb b/spec/unit/puppet/provider/package/appdmg_eula_spec.rb index abc1234..def5678 100644 --- a/spec/unit/puppet/provider/package/appdmg_eula_spec.rb +++ b/spec/unit/puppet/provider/package/appdmg_eula_spec.rb @@ -0,0 +1,45 @@+#! /usr/bin/env ruby +require 'spec_helper' + +describe Puppet::Type.type(:package).provider(:appdmg_eula) do + let(:resource) { Puppet::Type.type(:package).new(:name => 'foo', :provider => :appdmg_eula) } + let(:provider) { described_class.new(resource) } + + describe "when installing an appdmg with an eula" do + + let(:fake_mountpoint) { "/tmp/dmg.foo" } + let(:empty_hdiutil_plist) { Plist::Emit.dump({}) } + let(:fake_hdiutil_plist) { Plist::Emit.dump({"system-entities" => [{"mount-point" => fake_mountpoint}]}) } + + before do + fh = mock 'filehandle' + fh.stubs(:path).yields "/tmp/foo" + resource[:source] = "foo.dmg" + described_class.stubs(:open).yields fh + Dir.stubs(:mktmpdir).returns "/tmp/testtmp123" + FileUtils.stubs(:remove_entry_secure) + end + + describe "from a remote source" do + let(:tmpdir) { "/tmp/good123" } + + before :each do + resource[:source] = "http://fake.puppetlabs.com/foo.dmg" + end + + it "should call tmpdir and use the returned directory" do + Dir.expects(:mktmpdir).returns tmpdir + Dir.stubs(:entries).returns ["foo.app"] + described_class.expects(:curl).with do |*args| + args[0] == "-o" and args[1].include? tmpdir + end + described_class.expects(:hdiutil).with('convert', nil, '-format', 'UDTO', '-o', '/tmp/good123/appdmg_eula') + described_class.expects(:hdiutil).with('attach', '-plist', '-nobrowse', '-readonly', '-noverify', '-noautoopen', '-mountrandom', '/tmp', '/tmp/good123/appdmg_eula.cdr').returns(fake_hdiutil_plist) + described_class.expects(:installapp) + described_class.expects(:hdiutil).with('eject', '/tmp/dmg.foo') + + provider.install + end + end + end +end
Add spec for appdmg_eula package provider
diff --git a/lib/tasks/blogo_tasks.rake b/lib/tasks/blogo_tasks.rake index abc1234..def5678 100644 --- a/lib/tasks/blogo_tasks.rake +++ b/lib/tasks/blogo_tasks.rake @@ -14,8 +14,8 @@ namespace :blogo do - desc 'Create admin user' - task :create_admin, [:name, :email, :password] => :environment do |task, args| + desc 'Create blog user' + task :create_user, [:name, :email, :password] => :environment do |task, args| attrs = args.to_hash attrs[:password_confirmation] = attrs[:password] Blogo::User.create!(attrs)
Rename rake task create_admin -> create_user
diff --git a/lib/tasks/multi_spork.rake b/lib/tasks/multi_spork.rake index abc1234..def5678 100644 --- a/lib/tasks/multi_spork.rake +++ b/lib/tasks/multi_spork.rake @@ -1,10 +1,12 @@ require 'active_record' require 'multi_spork' +require 'ruby-debug' namespace :multi_spork do namespace :testdbs do desc "Clone schema of development db to test dbs to be used by multi_spork worker" task :clone do + debugger org_test_configuration = ActiveRecord::Base.configurations['test'] Rake::Task["db:schema:dump"].invoke
Add debugging instruction to debug why rake task failing
diff --git a/app/controllers/spots_controller.rb b/app/controllers/spots_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spots_controller.rb +++ b/app/controllers/spots_controller.rb @@ -5,7 +5,7 @@ @spots = Spot.all @spots = @spots.order(:favorites_count) if session[:user_id] - @user = User.find(session[:id]) + @user = User.find(session[:user_id]) end end
Fix typo in spot controller
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,5 +1,8 @@ class UsersController < ApplicationController before_action :authenticate_user!, except: [:new, :create] + if Rails.env == 'production' + http_basic_authenticate_with name: ENV['HTTP_AUTH_USERNAME'], password: ENV['HTTP_AUTH_PASSWORD'] + end def new if current_user.present?
Add http basic auth to users controller
diff --git a/app/features/album/album_creator.rb b/app/features/album/album_creator.rb index abc1234..def5678 100644 --- a/app/features/album/album_creator.rb +++ b/app/features/album/album_creator.rb @@ -10,9 +10,8 @@ def insert_all_photos @added_images_count = 0 - filenames = valid_keys.map { |key| key.gsub("#{prefix}/", '') } puts "attempting to import #{valid_keys.count} images" - filenames.each do |filename| + valid_keys.each do |filename| insert_photo(filename) end puts "imported #{@added_images_count} images"
Remove prefix stripping since it's not used
diff --git a/app/models/ontology/hets_options.rb b/app/models/ontology/hets_options.rb index abc1234..def5678 100644 --- a/app/models/ontology/hets_options.rb +++ b/app/models/ontology/hets_options.rb @@ -1,6 +1,8 @@ module Ontology::HetsOptions extend ActiveSupport::Concern + # Hets has some trouble inferring those input types + # by itself, so we give it a hint: EXTENSIONS_TO_INPUT_TYPES = {'.tptp' => 'tptp', '.p' => 'tptp'}
Add comment on extensions/input types hash.
diff --git a/config/initializers/edition_services.rb b/config/initializers/edition_services.rb index abc1234..def5678 100644 --- a/config/initializers/edition_services.rb +++ b/config/initializers/edition_services.rb @@ -1,7 +1,7 @@ Whitehall.edition_services.subscribe(/^(force_publish|publish)$/) { |event, edition, options| ServiceListeners::AuthorNotifier.new(edition, options[:user]).notify! } Whitehall.edition_services.subscribe(/^(force_publish|publish|unpublish|archive)$/) { |event, edition, options| ServiceListeners::EditorialRemarker.new(edition, options[:user], options[:remark]).save_remark! } -Whitehall.edition_services.subscribe(/^(force_publish|publish)$/) { |event, edition, options| ServiceListeners::SearchIndexer.new(edition).index! } Whitehall.edition_services.subscribe(/^(force_publish|publish)$/) { |event, edition, options| Whitehall::GovUkDelivery::Notifier.new(edition).edition_published! } -Whitehall.edition_services.subscribe("unpublish") { |event, edition, options| ServiceListeners::SearchIndexer.new(edition).remove! } Whitehall.edition_services.subscribe(/^(force_publish|publish)$/) { |_, edition, _| ServiceListeners::PanopticonRegistrar.new(edition).register! } Whitehall.edition_services.subscribe(/^(force_publish|publish)$/) { |_, edition, _| ServiceListeners::AnnouncementClearer.new(edition).clear! } +Whitehall.edition_services.subscribe(/^(force_publish|publish)$/) { |event, edition, options| ServiceListeners::SearchIndexer.new(edition).index! } +Whitehall.edition_services.subscribe("unpublish") { |event, edition, options| ServiceListeners::SearchIndexer.new(edition).remove! }
Move indexing listener to back of the queue To minimise the chance that the search indexing job is picked up before a scheduled-edition publishing transaction is complete, we move have the search indexer listener register itself last.
diff --git a/config/initializers/panopticon_hosts.rb b/config/initializers/panopticon_hosts.rb index abc1234..def5678 100644 --- a/config/initializers/panopticon_hosts.rb +++ b/config/initializers/panopticon_hosts.rb @@ -1,7 +1,7 @@ require 'panopticon_api' PanopticonApi.endpoint = case Rails.env.to_s -when 'development' then 'http://panopticon.dev.gov.uk' +when 'development' then ENV['PANOPTICON_URI'] || 'http://panopticon.dev.gov.uk' when 'test' then 'http://panopticon.dev.gov.uk' when 'staging' then 'http://panopticon.staging.alphagov.co.uk:8080' end
Allow setting an alternative panopticon endpoint during development.
diff --git a/app/view_models/effort_show_view.rb b/app/view_models/effort_show_view.rb index abc1234..def5678 100644 --- a/app/view_models/effort_show_view.rb +++ b/app/view_models/effort_show_view.rb @@ -3,7 +3,8 @@ class EffortShowView < EffortWithLapSplitRows delegate :full_name, :bib_number, :gender, :split_times, :finish_status, :report_url, :beacon_url, :photo, - :overall_rank, :gender_rank, :started?, :finished?, :dropped?, :in_progress?, to: :effort + :overall_rank, :gender_rank, :started?, :finished?, :dropped?, :in_progress?, + :final_lap, :stopped_lap, :final_split_id, :stopped_split_id, :final_bitkey, :stopped_bitkey, to: :effort delegate :event_name, :person, :start_time, :has_start_time?, :stopped?, to: :loaded_effort delegate :simple?, :multiple_sub_splits?, :multiple_laps?, :laps_unlimited?, :event_group, to: :event @@ -21,7 +22,7 @@ end def has_removable_stop? - stopped? && (!finished? || laps_unlimited?) + stopped? && (!finished? || laps_unlimited? || times_exist_after_stop?) end private @@ -29,4 +30,11 @@ def problem_efforts event.efforts.reject(&:valid_status?).sort_by(&:last_name) end + + def times_exist_after_stop? + stopped_split_id && + ((final_lap != stopped_lap) || + (final_split_id != stopped_split_id) || + (final_bitkey != stopped_bitkey)) + end end
Fix stop removal in efforts/show view for multi-lap events.
diff --git a/frontend/spec/support/shared_contexts/locales.rb b/frontend/spec/support/shared_contexts/locales.rb index abc1234..def5678 100644 --- a/frontend/spec/support/shared_contexts/locales.rb +++ b/frontend/spec/support/shared_contexts/locales.rb @@ -10,6 +10,7 @@ end after do + I18n.locale = :en # reset locale after each spec. I18n.reload! end end
Remove order-dependency from locale specs This commit removes an implicit order dependency in the frontend locale specs.
diff --git a/cookbooks/wt_heatmaps/recipes/import.rb b/cookbooks/wt_heatmaps/recipes/import.rb index abc1234..def5678 100644 --- a/cookbooks/wt_heatmaps/recipes/import.rb +++ b/cookbooks/wt_heatmaps/recipes/import.rb @@ -21,7 +21,6 @@ owner "hadoop" group "hadoop" mode 00500 - recursive true end cron "logs2hivecron" do
Fix a bad recursive call Former-commit-id: 69f08a332dfa56d3d3bfcfa931b629981c9cc809 [formerly 5c2f208bc5ddeee63749b54bd759439f6d4ef817] [formerly 1ca3c18e5cbcac9d566e32d2d6b320a49ecc8079 [formerly 1b5d8b976f3af6d1ec351ddbf0c2d8c02267f67d [formerly 0319a6768f65170052c8cd512440579ce2390ad1]]] Former-commit-id: 59600bf94fa0d17a1f77fcf41c543a22f3584493 [formerly e808b8f0014c1b64123e239709b986d4b5b515c0] Former-commit-id: fc6e635a565a305f5d551efb911802052c4e6dca Former-commit-id: 74a450f51952a71aa47da9cad1224b6226c7a258
diff --git a/lib/analysis/analyze_assessments_table.rb b/lib/analysis/analyze_assessments_table.rb index abc1234..def5678 100644 --- a/lib/analysis/analyze_assessments_table.rb +++ b/lib/analysis/analyze_assessments_table.rb @@ -24,6 +24,22 @@ @parsed_csv ||= CSV.parse(contents, csv_options) end + def assessment_subject + data[:assessment_subject] + end + + def assessment_subject_summary + assessment_subject.each_with_object(Hash.new(0)) { |subj, counts| counts[subj] += 1 } + end + + def assessment_test + data[:assessment_test] + end + + def assessment_test_summary + assessment_test.each_with_object(Hash.new(0)) { |subj, counts| counts[subj] += 1 } + end + def nil_converter(value) value unless value == '\N' end
Add new summary methods for inspecting exported assessments CSV
diff --git a/lib/git_find_committer/repository.rb b/lib/git_find_committer/repository.rb index abc1234..def5678 100644 --- a/lib/git_find_committer/repository.rb +++ b/lib/git_find_committer/repository.rb @@ -14,7 +14,7 @@ end def pull_master - `git pull origin master` + `cd #{@config.tmp_repo_path} && git pull origin master` self end
Change directory before git pull origin master
diff --git a/lib/sorcery/model/temporary_token.rb b/lib/sorcery/model/temporary_token.rb index abc1234..def5678 100644 --- a/lib/sorcery/model/temporary_token.rb +++ b/lib/sorcery/model/temporary_token.rb @@ -12,7 +12,7 @@ # Random code, used for salt and temporary tokens. def self.generate_random_token - SecureRandom.base64(15).tr('+/=lIO0', 'pqrsxyz') + SecureRandom.urlsafe_base64(15).tr('lIO0', 'sxyz') end module ClassMethods
Use urlsafe_base64 for url sensitive chars
diff --git a/rails-pipeline.gemspec b/rails-pipeline.gemspec index abc1234..def5678 100644 --- a/rails-pipeline.gemspec +++ b/rails-pipeline.gemspec @@ -22,8 +22,4 @@ s.add_dependency "aws-sdk" s.add_dependency "ruby-protocol-buffers" - #s.add_development_dependency "sqlite3" - #s.add_development_dependency "rspec-rails" - #s.add_development_dependency "activerecord-tableless" - #s.add_development_dependency "pry" end
Remove dev dependencies from gemspec - doesn't work with test env, so they're in Gemfile anyway.
diff --git a/lib/github_api/response/jsonize.rb b/lib/github_api/response/jsonize.rb index abc1234..def5678 100644 --- a/lib/github_api/response/jsonize.rb +++ b/lib/github_api/response/jsonize.rb @@ -7,7 +7,11 @@ dependency 'multi_json' define_parser do |body| - ::MultiJson.load body + if MultiJson.respond_to?(:load) + MultiJson.load body + else + MultiJson.decode body + end end def parse(body)
Support older version of multi_json for backwards compatibility with other gems.
diff --git a/templates/ruby/lib/http_client/response_handler.rb b/templates/ruby/lib/http_client/response_handler.rb index abc1234..def5678 100644 --- a/templates/ruby/lib/http_client/response_handler.rb +++ b/templates/ruby/lib/http_client/response_handler.rb @@ -11,7 +11,11 @@ {{if .Api.Response.Formats.Json}} # Response body is in JSON if type and type.include?("json") - body = JSON.parse body + begin + body = JSON.parse body + rescue JSON::ParserError + return body + end end {{end}} return body
Return plain body on error when parsing response for json
diff --git a/lib/queue_classic_delayed/setup.rb b/lib/queue_classic_delayed/setup.rb index abc1234..def5678 100644 --- a/lib/queue_classic_delayed/setup.rb +++ b/lib/queue_classic_delayed/setup.rb @@ -8,7 +8,7 @@ # Raises RuntimeError if something goes wrong. def self.create sql = """ - CREATE TABLE queue_classic_delayed_jobs ( + CREATE TABLE #{QC::Delayed::TABLE_NAME} ( id serial PRIMARY KEY, q_name varchar(255), method varchar(255), @@ -30,7 +30,7 @@ # Raises RuntimeError if something goes wrong. def self.drop QC::Conn.transaction do - QC::Conn.execute("DROP TABLE IF EXISTS queue_classic_delayed_jobs") + QC::Conn.execute("DROP TABLE IF EXISTS #{QC::Delayed::TABLE_NAME}") end end end
Use QC::Delayed::TABLE_NAME instead of a static string
diff --git a/lib/stacks/virtual_name_service.rb b/lib/stacks/virtual_name_service.rb index abc1234..def5678 100644 --- a/lib/stacks/virtual_name_service.rb +++ b/lib/stacks/virtual_name_service.rb @@ -5,6 +5,7 @@ def configure() @ports = [53] + add_vip_network :mgmt end def realserver_prod_fqdns
Make nemeservers create vips on the mgmt network
diff --git a/lib/stash/wrapper/stash_wrapper.rb b/lib/stash/wrapper/stash_wrapper.rb index abc1234..def5678 100644 --- a/lib/stash/wrapper/stash_wrapper.rb +++ b/lib/stash/wrapper/stash_wrapper.rb @@ -15,7 +15,7 @@ object_node :stash_administrative, 'stash_administrative', class: StashAdministrative descriptive_node :stash_descriptive, 'stash_descriptive' - def initialize(identifier:, version:, license:, embargo:, inventory:, descriptive_elements:) + def initialize(identifier:, version:, license:, embargo:, inventory:, descriptive_elements:) # rubocop:disable Metrics/ParameterLists self.identifier = identifier self.stash_administrative = StashAdministrative.new( version: version,
Disable Rubocop warning re: long parameter lists
diff --git a/lib/rss.rb b/lib/rss.rb index abc1234..def5678 100644 --- a/lib/rss.rb +++ b/lib/rss.rb @@ -9,11 +9,11 @@ response = Net::HTTP.get_response( URI.parse(url) ) # check if redirect is needed - if response.code.to_s == '301' || response.code.to_s == '302' + if response.kind_of? Net::HTTPRedirection url = response.header['location'] response = Net::HTTP.get_response( URI.parse( url ) ) end - if response.code.to_s != '200' + if ! response.kind_of? Net::HTTPSuccess raise "Can't fetch '#{url}', http code: #{response.code.to_s}" return end
Use kind_of object to check if http call was successfully.
diff --git a/test/tzinfo-data/tzinfo/data/version.rb b/test/tzinfo-data/tzinfo/data/version.rb index abc1234..def5678 100644 --- a/test/tzinfo-data/tzinfo/data/version.rb +++ b/test/tzinfo-data/tzinfo/data/version.rb @@ -1,5 +1,5 @@ #-- -# Copyright (c) 2012 Philip Ross +# Copyright (c) 2012-2013 Philip Ross # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -22,7 +22,7 @@ module TZInfo module Data - # TZInfo Data version information. + # TZInfo::Data version information. module Version # The format used for the data. The only format currently supported by # TZInfo is version 1.
Fix reference to 'TZInfo Data' instead of 'TZInfo::Data'.
diff --git a/lib/dotenv-schema.rb b/lib/dotenv-schema.rb index abc1234..def5678 100644 --- a/lib/dotenv-schema.rb +++ b/lib/dotenv-schema.rb @@ -4,9 +4,9 @@ module Dotenv class << self def load_with_validation(*filenames) - env_before = ENV.to_h + env_before = ENV.to_hash load_without_validation *filenames - env = ENV.to_h.reject {|k, v| env_before.has_key?(k) } + env = ENV.to_hash.reject {|k, v| env_before.has_key?(k) } schema = Schema.load schema_path schema.validate! env
Use ENV.to_hash instead of ENV.to_h
diff --git a/lib/json_response.rb b/lib/json_response.rb index abc1234..def5678 100644 --- a/lib/json_response.rb +++ b/lib/json_response.rb @@ -1,4 +1,6 @@-require 'activesupport' +require 'rubygems' +require 'json' +require 'json/pure' class JsonResponse
Remove active support, and simply use the json lib.
diff --git a/cookbooks/rs_utils/recipes/setup_ssh.rb b/cookbooks/rs_utils/recipes/setup_ssh.rb index abc1234..def5678 100644 --- a/cookbooks/rs_utils/recipes/setup_ssh.rb +++ b/cookbooks/rs_utils/recipes/setup_ssh.rb @@ -22,7 +22,7 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -unless node.private_ssh_key.nil? || node.private_ssh_key == '' +if node.private_ssh_key.nil? || node.private_ssh_key == '' log "Install private key" private_ssh_key = node.private_ssh_key
Use if instead of unless to check existance of key.
diff --git a/lib/rspec/rails/example/request_example_group.rb b/lib/rspec/rails/example/request_example_group.rb index abc1234..def5678 100644 --- a/lib/rspec/rails/example/request_example_group.rb +++ b/lib/rspec/rails/example/request_example_group.rb @@ -48,7 +48,7 @@ metadata[:type] = :request before do - @router = ::Rails.application.routes + @routes = ::Rails.application.routes end webrat do
Fix typo => router to routes
diff --git a/lib/travis/api/v3/services/repository/migrate.rb b/lib/travis/api/v3/services/repository/migrate.rb index abc1234..def5678 100644 --- a/lib/travis/api/v3/services/repository/migrate.rb +++ b/lib/travis/api/v3/services/repository/migrate.rb @@ -11,7 +11,7 @@ current_user = access_control.user owner = repository.owner - if !Travis::Features.owner_active?(:migrate, owner) + if !Travis::Features.owner_active?(:allow_migration, owner) raise Error.new("Migrating repositories is disabled for #{owner.login}. Please contact Travis CI support for more information.", status: 403) end
Unify names of migration feature flags
diff --git a/lib/openlogi/item.rb b/lib/openlogi/item.rb index abc1234..def5678 100644 --- a/lib/openlogi/item.rb +++ b/lib/openlogi/item.rb @@ -12,6 +12,7 @@ property :price, coerce: Integer property :unit_price, coerce: Integer property :barcode + property :jancode property :international_info, coerce: InternationalInfo property :stock, coerce: Stock property :quantity, coerce: Integer
Add jancode to Item class
diff --git a/modules/govuk/lib/facter/vdc.rb b/modules/govuk/lib/facter/vdc.rb index abc1234..def5678 100644 --- a/modules/govuk/lib/facter/vdc.rb +++ b/modules/govuk/lib/facter/vdc.rb @@ -2,12 +2,6 @@ Facter.add("vdc") do setcode do - env_octet = Facter.value(:ipaddress).split('.')[2].to_i - vdc = Facter.value(:domain).split('.').first - if env_octet > 7 - vdc + '_dr' - else - vdc - end + Facter.value(:domain).split('.').first end end
Remove logic for inferring membership of the DR VDCs. The disaster-recovery VDCs (VMWare "virtual datacentres") no longer exist; they were part of the old VMWare-based installation when parts of GOV.UK were hosted in Carrenza and UKCloud. This logic had a bug where the heuristic for telling whether a machine was a DR machine or not was based on the IP address of whichever network interface happens to be returned as `:ipaddress`. For VMs which have Docker installed on them, this can be the host address on the Docker network rather than the VM's eth0 interface. So the logic then has a 1 - 7/256 ≈ 97% chance of wrongly appending `_dr` to the value of the `:vdc` Puppet fact for that node. This would have gone harmlessly unnoticed, except that /modules/icinga/manifests/client.pp:51 uses the presence of the `_dr` as another heuristic to infer that it should add the (long-since-deleted) VPN gateway for the corresponding (also long-since deleted) VDC as a "parent" to the node's host configuration in Icinga. This causes Icinga to fail to start up because it fails to validate its configuration, which breaks pretty much all the monitoring in the whole environment.
diff --git a/lib/therm_control.rb b/lib/therm_control.rb index abc1234..def5678 100644 --- a/lib/therm_control.rb +++ b/lib/therm_control.rb @@ -9,6 +9,7 @@ set_temp = SetTemp.first temp = Temp.discover.values.first.f r = Reading.new(temp_f: temp) + r.set_temp = set_temp.temp if set_temp.cooling? if temp < (set_temp.temp - SWING)
Save the set temp at reading
diff --git a/libraries/lib_apt.rb b/libraries/lib_apt.rb index abc1234..def5678 100644 --- a/libraries/lib_apt.rb +++ b/libraries/lib_apt.rb @@ -0,0 +1,48 @@+class Chef + class Provider + class Package + class Apt + + def install_package(name, version) + rescued = false + begin + # Keep all the things in the block for retry + Chef::Log.debug("#{@new_resource} Candidate Version: #{version}") + package_name = "#{name}=#{version}" + package_name = name if @is_virtual_package + + run_command_with_systems_locale( + :command => "apt-get -q -y#{expand_options(default_release_options)}#{expand_options(@new_resource.options)} install #{package_name}", + :environment => { + "DEBIAN_FRONTEND" => "noninteractive" + } + ) + rescue Exception => e + if rescued == false + rescued = true + update_aptitude_cache + load_current_resource + Chef::Log.debug("#{@new_resource} Old Candidate Version: #{version}") + version = @candidate_version + Chef::Log.debug("#{@new_resource} New Candidate Version: #{version}") + retry + else + raise Chef::Exceptions::Exec, e.message + end + end + end + + def update_aptitude_cache + Chef::Log.info("#{@new_resource} Updating Aptitude Cache") + run_command_with_systems_locale( + :command => "apt-get update", + :environment => { + "DEBIAN_FRONTEND" => "noninteractive" + } + ) + end + + end + end + end +end
[COOK-2458] Update package cache on install failure and retry Fix to update the aptitude package cache and retry when an apt-get install fails.
diff --git a/morpheus.gemspec b/morpheus.gemspec index abc1234..def5678 100644 --- a/morpheus.gemspec +++ b/morpheus.gemspec @@ -18,6 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rake" + spec.add_development_dependency 'bundler', '~> 1.3' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'rspec', '>= 3.0.0.beta' end
Add RSpec 3 to specs
diff --git a/euler17.rb b/euler17.rb index abc1234..def5678 100644 --- a/euler17.rb +++ b/euler17.rb @@ -0,0 +1,60 @@+=begin + +If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. + +If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used? + + +NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage. + +=end + +def one_digit(n) + words = %w(one two three four five six seven eight nine) + words[n - 1] +end + +def two_digits(n) + words = %w(ten twenty thirty forty fifty sixty seventy eighty ninety) + if (11..19).include?(n) + teens = %w(eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen) + return teens[n - 11] + end + base = words[(n / 10) - 1] + if n % 10 == 0 + return base + else + return base + one_digit(n % 10) + end +end + +def three_digits(n) + base = one_digit(n / 100) + "hundred" + if n % 100 == 0 + return base + else + if n % 100 >= 10 + return base + "and" + two_digits(n % 100) + else + return base + "and" + one_digit(n % 100) + end + end +end + +def digit_word_count(n) + (1..n).reduce(0) do |acc, num| + if num == 1000 + acc + 11 + elsif num >= 100 + acc + three_digits(num).length + elsif num >= 10 + acc + two_digits(num).length + else + acc + one_digit(num).length + end + end +end + +p two_digits(15).length == 7 +p three_digits(342).length == 23 +p digit_word_count(1000) == 21124
Add solution to problem 17
diff --git a/db/migrate/20140929204155_migrate_tos_setting.rb b/db/migrate/20140929204155_migrate_tos_setting.rb index abc1234..def5678 100644 --- a/db/migrate/20140929204155_migrate_tos_setting.rb +++ b/db/migrate/20140929204155_migrate_tos_setting.rb @@ -1,7 +1,7 @@ class MigrateTosSetting < ActiveRecord::Migration def up res = execute("SELECT * FROM site_settings WHERE name = 'tos_accept_required' AND value = 't'") - if res.present? && res[0].present? + if res.present? && res.cmd_tuples > 0 label = I18n.t("terms_of_service.signup_form_message") res = execute("SELECT value FROM site_texts WHERE text_type = 'tos_signup_form_message'") if res.present? && res.cmd_tuples == 1
FIX: Use `cmd_tuples` instead of checking row index for migration.
diff --git a/tasks/http_doc.thor b/tasks/http_doc.thor index abc1234..def5678 100644 --- a/tasks/http_doc.thor +++ b/tasks/http_doc.thor @@ -11,18 +11,23 @@ :desc => "Base URL for API URLs" def build(*paths) base_url = options[:base_url] || "http://localhost/" - paths.each do |path| + paths = paths.map { |path| path = path.gsub(/\/$/, '') - Dir.glob("#{path}/**/*_controller.rb").each do |fn| - puts fn - parser = ::HttpDoc::RubyCommentParser.new(fn) - parser.parse - if parser.controller - r = ::HttpDoc::Rendering::SingleFileRenderer.new(:base_url => base_url) - output_filename = File.basename(fn).gsub(/\.rb/, '') - output_filename << ".html" - File.open(output_filename, "w") { |f| f << r.render_controller(parser.controller) } - end + if File.file?(path) + path + else + Dir.glob("#{path}/**/*_controller.rb") + end + }.flatten + paths.each do |fn| + puts fn + parser = ::HttpDoc::RubyCommentParser.new(fn) + parser.parse + if parser.controller + r = ::HttpDoc::Rendering::SingleFileRenderer.new(:base_url => base_url) + output_filename = File.basename(fn).gsub(/\.rb/, '') + output_filename << ".html" + File.open(output_filename, "w") { |f| f << r.render_controller(parser.controller) } end end end
Allow file names on build command line.
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -31,6 +31,7 @@ get '/dashboard' do @boards = LeanKitKanban::Board.all[0] + @boards.sort!{|a,b| a["Title"].to_s.downcase <=> b["Title"].to_s.downcase} haml :dashboard end
Add sorting of the boards.
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -1,6 +1,3 @@-# Sinatra app for local development -# $ ruby app.rb - require 'rubygems' require 'sinatra'
Remove comments; same in README
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -15,16 +15,14 @@ enable :sessions set :session_secret, 'my sooper secret' - config = YAML.load_file(File.join('config', 'config.yml')) - - set :username, config['username'] - set :password, config['password'] + set :username, ENV["GOOGLE_DRIVE_USERNAME"] + set :password, ENV["GOOGLE_DRIVE_PASSWORD"] if ENV["REDISCLOUD_URL"] uri = URI.parse(ENV["REDISCLOUD_URL"]) set :redis, Redis.new(:host => uri.host, :port => uri.port, :password => uri.password) else - set :redis, Redis.new(:host => config['redis_host'], :port => config['redis_port'], :db => config['redis_db']) + set :redis, Redis.new end end
Use env vars instead of config file for google creds.
diff --git a/lib/mongo_mapper/plugins/associations/belongs_to_association.rb b/lib/mongo_mapper/plugins/associations/belongs_to_association.rb index abc1234..def5678 100644 --- a/lib/mongo_mapper/plugins/associations/belongs_to_association.rb +++ b/lib/mongo_mapper/plugins/associations/belongs_to_association.rb @@ -17,7 +17,7 @@ def setup(model) model.key foreign_key, ObjectId unless model.key?(foreign_key) - model.key type_key_name, ObjectId unless model.key?(type_key_name) if polymorphic? + model.key type_key_name, String unless model.key?(type_key_name) if polymorphic? super add_touch_callbacks if touch? end
Fix type of type_key_name field to be String
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,7 +4,7 @@ require 'plugin_test_helper' # Run the migrations -ActiveRecord::Migrator.migrate("#{RAILS_ROOT}/db/migrate") +ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") # Mixin the factory helper require File.expand_path("#{File.dirname(__FILE__)}/factory")
Use Rails.root instead of RAILS_ROOT in preparation for the Rails 2.1 release
diff --git a/rbkit.gemspec b/rbkit.gemspec index abc1234..def5678 100644 --- a/rbkit.gemspec +++ b/rbkit.gemspec @@ -14,6 +14,7 @@ if s.respond_to? :required_rubygems_version= s.required_rubygems_version = Gem::Requirement.new(">= 0") end + s.required_ruby_version = '>= 2.1.0' s.authors = ["Hemant Kumar", "Emil Soman", "Kashyap"] s.description = %q{Something small for process management} s.email = %q{hemant@codemancers.com emil@codemancers.com kashyap@codemancers.com}
Add required_ruby_version gemspec and set it to >= 2.1.0
diff --git a/lib/salesforce_bulk/batch_result_collection.rb b/lib/salesforce_bulk/batch_result_collection.rb index abc1234..def5678 100644 --- a/lib/salesforce_bulk/batch_result_collection.rb +++ b/lib/salesforce_bulk/batch_result_collection.rb @@ -0,0 +1,36 @@+module SalesforceBulk + class BatchResultCollection < Array + + attr_reader :client + attr_reader :currentIndex + attr_reader :batchId + attr_reader :jobId + attr_reader :resultIds + + def initialize(client, jobId, batchId, resultIds) #previousResultId, nextResultId, currentResultId + @client = client + @jobId = jobId + @batchId = batchId + @resultIds = resultIds + @currentIndex = resultIds.first + + end + + def next? + + end + + def next + + end + + def previous? + + end + + def previous + + end + + end +end
Add first draft of BatchResultCollection class.
diff --git a/lib/schema_generator/handmade_schema_copier.rb b/lib/schema_generator/handmade_schema_copier.rb index abc1234..def5678 100644 --- a/lib/schema_generator/handmade_schema_copier.rb +++ b/lib/schema_generator/handmade_schema_copier.rb @@ -4,9 +4,11 @@ FileUtils.mkdir_p("dist/formats/#{schema_name}/publisher_v2") FileUtils.cp("formats/#{schema_name}/publisher_v2/schema.json", "dist/formats/#{schema_name}/publisher_v2/schema.json") - if File.exist?("formats/#{schema_name}/frontend/schema.json") - FileUtils.mkdir_p("dist/formats/#{schema_name}/frontend") - FileUtils.cp("formats/#{schema_name}/frontend/schema.json", "dist/formats/#{schema_name}/frontend/schema.json") + %w(frontend notification).each do |schema_type| + if File.exist?("formats/#{schema_name}/#{schema_type}/schema.json") + FileUtils.mkdir_p("dist/formats/#{schema_name}/#{schema_type}") + FileUtils.cp("formats/#{schema_name}/#{schema_type}/schema.json", "dist/formats/#{schema_name}/#{schema_type}/schema.json") + end end end end
Update handmade schema copier to also copy notification schemas
diff --git a/test/helper.rb b/test/helper.rb index abc1234..def5678 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,5 +1,7 @@ require 'test/unit' require_relative '../lib/main' +require_relative '../lib/solvebio' +ENV['SOLVEBIO_API_HOST'] ||= 'http://api.solvebio.com' def local_api? ENV['SOLVEBIO_API_HOST'].start_with?('http://127.0.0.1')
Set up environment better for Travis testing.
diff --git a/task/build_metadata.rake b/task/build_metadata.rake index abc1234..def5678 100644 --- a/task/build_metadata.rake +++ b/task/build_metadata.rake @@ -0,0 +1,18 @@+# frozen_string_literal: true +file "lib/bundler/generated/build_metadata.rb" => [".git/HEAD", __FILE__] do |t| + build_metadata = { + :built_at => BUNDLER_SPEC.date.strftime("%Y-%m-%d"), + :git_sha => `git rev-parse --short HEAD`.strip, + :release => Rake::Task["release"].instance_variable_get(:@already_invoked), + } + + File.open(t.name, "w") {|f| f << <<-RUBY } +# frozen_string_literal: true + +module Bundler + BUILD_METADATA = { +#{build_metadata.sort.map {|k, v| " #{k.inspect} => #{BUNDLER_SPEC.send(:ruby_code, v)}," }.join("\n")} + }.freeze +end + RUBY +end
Add a rake task to generate build metadata
diff --git a/supercharged.gemspec b/supercharged.gemspec index abc1234..def5678 100644 --- a/supercharged.gemspec +++ b/supercharged.gemspec @@ -23,7 +23,7 @@ s.add_dependency "strong_parameters" s.add_development_dependency "sqlite3" - s.add_development_dependency "minitest" + s.add_development_dependency "minitest", "~> 3.0" s.add_development_dependency "minitest-spec-context" s.add_development_dependency "minitest-rails" s.add_development_dependency "mocha"
Revert "minitest no version in dependency" This reverts commit c81858eba75f7415986f4d321c514a5f4c73cd35.
diff --git a/features/step_definitions/game_steps.rb b/features/step_definitions/game_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/game_steps.rb +++ b/features/step_definitions/game_steps.rb @@ -0,0 +1,11 @@+When(/^I see the home page$/) do + visit root_path +end + +When(/^I click "([^"]*)"$/) do |link| + click_on link +end + +Then(/^I should see a new game$/) do + expect(page).to have_content(/Game was successfully created./) +end
Add feature steps for first scenario
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index abc1234..def5678 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -9,4 +9,10 @@ # Make sure your secret_key_base is kept private # if you're sharing your code publicly. -Workparty::Application.config.secret_key_base = '06b3a318b5107812bd079436f8e2108e0fdfb2483d16e28327d328470da27faace54688094f601dc6387232d2175dde34f17db3a55dc6dee94b7bf0ca75e1226' +if Rails.env.production? && ENV['SECRET_TOKEN'].blank? + raise 'The SECRET_TOKEN environment variable is not set.\n + To generate it, run "rake secret", then set it on the production server.\n + If you\'re using Heroku, you do this with "heroku config:set SECRET_TOKEN=the_token_you_generated"' +end + +Workparty::Application.config.secret_key_base = ENV['SECRET_TOKEN'] || '06b3a318b5107812bd079436f8e2108e0fdfb2483d16e28327d328470da27faace54688094f601dc6387232d2175dde34f17db3a55dc6dee94b7bf0ca75e1226'
Set secret token from ENV in production and raise error if not done
diff --git a/app/controllers/task.rb b/app/controllers/task.rb index abc1234..def5678 100644 --- a/app/controllers/task.rb +++ b/app/controllers/task.rb @@ -1,6 +1,11 @@ get '/task/:id' do |id| @task = Task.find(id) - @task.description + erb :'task/single', locals: {task: @task} +end + +get '/tasks/all' do + @tasks = Task.all + erb :'task/all' end get '/tasks/new' do
Add all and use view for single display
diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb index abc1234..def5678 100644 --- a/omnibus_overrides.rb +++ b/omnibus_overrides.rb @@ -1,7 +1,7 @@ # THIS IS NOW HAND MANAGED, JUST EDIT THE THING # .travis.yml and appveyor.yml consume this, # try to keep it machine-parsable. -override :rubygems, version: "2.6.11" +override :rubygems, version: "2.6.13" override :bundler, version: "1.15.1" override "libffi", version: "3.2.1" override "libiconv", version: "1.15"
Upgrade to Rubygems 2.6.13 to resolve CVEs http://blog.rubygems.org/2017/08/27/2.6.13-released.html Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/gif_bot.rb b/gif_bot.rb index abc1234..def5678 100644 --- a/gif_bot.rb +++ b/gif_bot.rb @@ -3,20 +3,28 @@ class GifBot < Sinatra::Base post "/" do - return error("I need text and trigger_word parameters") unless params_present? - search_term = params[:text].gsub(params[:trigger_word], "").strip - gifs = Giphy.search(search_term) - random_gif = gifs.sample + content_type :json - content_type :json - { text: random_gif.original_image.url }.to_json + if params_present? && random_gif + format_message(random_gif.original_image.url) + else + format_message("I couldn't find a gif :cry:") + end end def params_present? params.has_key?("text") && params.has_key?("trigger_word") end - def error(error_message) - { text: error_message }.to_json + def format_message(message) + { text: message }.to_json + end + + def random_gif + @random_gif ||= Giphy.search(search_term).sample + end + + def search_term + params[:text].gsub(params[:trigger_word], "").strip end end
Return meaningful message when no gif found.
diff --git a/cookbooks/wt_logpreproc/metadata.rb b/cookbooks/wt_logpreproc/metadata.rb index abc1234..def5678 100644 --- a/cookbooks/wt_logpreproc/metadata.rb +++ b/cookbooks/wt_logpreproc/metadata.rb @@ -4,7 +4,7 @@ license "All rights reserved" description "Installs/Configures Webtrends Log Preprocessor" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "1.0.18" +version "1.0.19" depends "wt_base" depends "windows" supports "windows"
Add setting for number of Net Acuity connections Former-commit-id: cca98e318665998559b3057695e34a10458cb1cf [formerly 153a9ca4e9621a202cd53bde075acd080ff9b5eb] [formerly 56b1a1729009943000bc3033f9cca4aeb81ab935 [formerly 15a41a6a19e9bcf1bbae178451cb480fa6b5bd7d]] Former-commit-id: da764446f9762b16e724b7bb4288882aa1867ecc [formerly a2b369242cafcb3818f72ccd56be9bd5b2a0251f] Former-commit-id: 22045d6635b0a7d1fac78bc821c6b07e0355e0ae
diff --git a/app/controllers/app.rb b/app/controllers/app.rb index abc1234..def5678 100644 --- a/app/controllers/app.rb +++ b/app/controllers/app.rb @@ -14,27 +14,27 @@ module PushApp class App < Sinatra::Base before do - error 415 unless request.media_type == 'text/yaml' content_type 'text/yaml' + unless request.media_type == 'text/yaml' + error 415, "Unable to accept input with Content-Type `#{request.media_type}`, must be `text/yaml`.".to_yaml + end end post '/pods' do - # TODO - # * wrap in a transaction for error handling - # * store github pull-request progress state - if specification - linter = Specification::Linter.new(specification) - if linter.lint - pod_version = PodVersion.by_name_and_version(specification.name, specification.version.to_s) - halt 202 - else - results = {} - results['warnings'] = linter.warnings.map(&:message) unless linter.warnings.empty? - results['errors'] = linter.errors.map(&:message) unless linter.errors.empty? - error 422, results.to_yaml - end + if specification.nil? + error 400, 'Unable to load a Pod Specification from the provided input.'.to_yaml end - error 400 + + linter = Specification::Linter.new(specification) + unless linter.lint + results = {} + results['warnings'] = linter.warnings.map(&:message) unless linter.warnings.empty? + results['errors'] = linter.errors.map(&:message) unless linter.errors.empty? + error 422, results.to_yaml + end + + pod_version = PodVersion.by_name_and_version(specification.name, specification.version.to_s) + halt 202 end private
Refactor and add some more error messages.
diff --git a/scheduled_tasks/poll_injection_responses_task.rb b/scheduled_tasks/poll_injection_responses_task.rb index abc1234..def5678 100644 --- a/scheduled_tasks/poll_injection_responses_task.rb +++ b/scheduled_tasks/poll_injection_responses_task.rb @@ -0,0 +1,18 @@+require 'chronic' + +# https://github.com/ssoroka/scheduler_daemon +class PollInjectionResponsesTask < Scheduler::SchedulerTask + environments :production, :demo + every '1m' + + def run + queue = Settings.aws.response_queue + return unless queue + log("Checking for messages on #{queue}") + MessageQueue::AwsClient.new(queue).poll! + rescue StandardError => ex + log('There was an error: ' + ex.message) + ensure + log('Injection import complete') + end +end
Add task to poll queue
diff --git a/CHTCollectionViewWaterfallLayout.podspec b/CHTCollectionViewWaterfallLayout.podspec index abc1234..def5678 100644 --- a/CHTCollectionViewWaterfallLayout.podspec +++ b/CHTCollectionViewWaterfallLayout.podspec @@ -7,7 +7,17 @@ s.license = 'MIT' s.author = { "Nelson" => "chiahsien@gmail.com" } s.source = { :git => "https://github.com/chiahsien/CHTCollectionViewWaterfallLayout.git", :tag => "#{s.version}" } - s.platform = :ios, '6.0' - s.source_files = '*.{h,m}' + s.ios.deployment_target = '6.0' + s.tvos.deployment_target = '9.0' s.requires_arc = true + + s.default_subspec = 'ObjC' + + s.subspec 'ObjC' do |ss| + ss.source_files = '*.{h,m}' + end + + s.subspec 'Swift' do |ss| + ss.source_files = '*.swift' + end end
Update podspec - There are two subspec: ObjC and Swift - Default subspec is ObjC
diff --git a/spec/presenters/tree_node/vm_or_template_spec.rb b/spec/presenters/tree_node/vm_or_template_spec.rb index abc1234..def5678 100644 --- a/spec/presenters/tree_node/vm_or_template_spec.rb +++ b/spec/presenters/tree_node/vm_or_template_spec.rb @@ -15,7 +15,6 @@ template_microsoft template_redhat template_vmware - template_xen ).each do |factory| context(factory.to_s) do let(:object) { FactoryBot.create(factory, :name => "template", :template => true) } @@ -45,7 +44,6 @@ vm_microsoft vm_redhat vm_vmware - vm_xen ).each do |factory| context(factory.to_s) do let(:object) { FactoryBot.create(factory) }
Remove extra *_xen reference from specs follow-up to ManageIQ/manageiq#20250
diff --git a/lib/mumukit/templates/with_structured_results.rb b/lib/mumukit/templates/with_structured_results.rb index abc1234..def5678 100644 --- a/lib/mumukit/templates/with_structured_results.rb +++ b/lib/mumukit/templates/with_structured_results.rb @@ -16,7 +16,7 @@ def extract_result(result) separator = self.class.class_variable_get :@@separator - result = result.split(separator)[1] if separator.present? + result = result.split(separator).last if separator.present? result end
Replace [1] for last fixes problem when running run_tests!
diff --git a/Casks/gitx-l.rb b/Casks/gitx-l.rb index abc1234..def5678 100644 --- a/Casks/gitx-l.rb +++ b/Casks/gitx-l.rb @@ -0,0 +1,6 @@+class GitxL < Cask + url 'https://github.com/downloads/laullon/gitx/GitX-L_v0.8.4.zip' + homepage 'http://gitx.laullon.com/' + version '0.8.4' +end +
Add cask for laullon version of GitX git gui. More up to date and developed than original GitX client.
diff --git a/attributes/berkshelf.rb b/attributes/berkshelf.rb index abc1234..def5678 100644 --- a/attributes/berkshelf.rb +++ b/attributes/berkshelf.rb @@ -1,2 +1,2 @@-default.base.berkshelf_version = '2.0.14' +default.base.berkshelf_version = '2.0.16' default.base.berkshelf_solve_version = '0.8.2'
Update Berkshelf to fix Ridley dep issue .. :/
diff --git a/app/controllers/middleware_datasource_controller.rb b/app/controllers/middleware_datasource_controller.rb index abc1234..def5678 100644 --- a/app/controllers/middleware_datasource_controller.rb +++ b/app/controllers/middleware_datasource_controller.rb @@ -15,7 +15,7 @@ :skip => true, :hawk => N_('removed datasources'), :skip_msg => N_('Not %{operation_name} for %{record_name} on the provider itself'), - :msg => N_('The selected datasources were removed') + :msg => N_('The selected datasources removal was initiated') } }.freeze
Fix MW Datasource removal toast text
diff --git a/app/controllers/spree/admin/suppliers_controller.rb b/app/controllers/spree/admin/suppliers_controller.rb index abc1234..def5678 100644 --- a/app/controllers/spree/admin/suppliers_controller.rb +++ b/app/controllers/spree/admin/suppliers_controller.rb @@ -2,8 +2,6 @@ module Spree module Admin class SuppliersController < ResourceController - respond_to :html - end end end
Remove respond_to as it is not needed
diff --git a/ruby_inspector.gemspec b/ruby_inspector.gemspec index abc1234..def5678 100644 --- a/ruby_inspector.gemspec +++ b/ruby_inspector.gemspec @@ -20,7 +20,7 @@ spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 1.8' + spec.add_development_dependency 'bundler', '~> 1.7' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.2' spec.add_development_dependency 'rack', '~> 1.6'
Rollback to older version of bundler
diff --git a/lib/danger/ci_source/azure_pipelines.rb b/lib/danger/ci_source/azure_pipelines.rb index abc1234..def5678 100644 --- a/lib/danger/ci_source/azure_pipelines.rb +++ b/lib/danger/ci_source/azure_pipelines.rb @@ -19,7 +19,7 @@ # class AzurePipelines < CI def self.validates_as_ci?(env) - env.key? "AGENT_ID" + env.key?("AGENT_ID") && env["BUILD_REPOSITORY_PROVIDER"] != "TfsGit" end def self.validates_as_pr?(env)
Fix run with Azure Pipelines as CI Source and Azure Repos Git as Request Source
diff --git a/lib/reponaut/github.rb b/lib/reponaut/github.rb index abc1234..def5678 100644 --- a/lib/reponaut/github.rb +++ b/lib/reponaut/github.rb @@ -19,6 +19,10 @@ def repos JSON.parse(repo_data).map { |e| Repository.new(e) } + end + + def to_s + username end private @@ -51,6 +55,10 @@ !fork? end + def to_s + full_name + end + def method_missing(symbol, *args) if @data.include?(symbol.to_s) @data[symbol.to_s]
Define to_s methods for GitHub::Client and Repository
diff --git a/private_attr.gemspec b/private_attr.gemspec index abc1234..def5678 100644 --- a/private_attr.gemspec +++ b/private_attr.gemspec @@ -16,4 +16,6 @@ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] + + gem.add_development_dependency 'rake' end
Add rake as dev dependency, per travis-ci
diff --git a/spec/extensions/hash_aliases_spec.rb b/spec/extensions/hash_aliases_spec.rb index abc1234..def5678 100644 --- a/spec/extensions/hash_aliases_spec.rb +++ b/spec/extensions/hash_aliases_spec.rb @@ -1,6 +1,6 @@ require File.join(File.dirname(File.expand_path(__FILE__)), "spec_helper") -describe "filter_having extension" do +describe "hash_aliases extension" do before do @ds = Sequel.mock.dataset.extension(:hash_aliases) end
Fix typo in spec suite description
diff --git a/spec/factories/adjustment_factory.rb b/spec/factories/adjustment_factory.rb index abc1234..def5678 100644 --- a/spec/factories/adjustment_factory.rb +++ b/spec/factories/adjustment_factory.rb @@ -0,0 +1,9 @@+FactoryBot.define do + factory :adjustment, class: Spree::Adjustment do + association(:adjustable, factory: :order) + amount 100.0 + label 'Shipping' + association(:source, factory: :shipment) + eligible true + end +end
Bring adjustment factory from spree_core
diff --git a/spec/noir/command/completion_spec.rb b/spec/noir/command/completion_spec.rb index abc1234..def5678 100644 --- a/spec/noir/command/completion_spec.rb +++ b/spec/noir/command/completion_spec.rb @@ -33,5 +33,17 @@ expect(Noir::Command::Completion.suggestions(list)).to_not include('subsubcommand') end + it 'return matced command name list in sub command' do + list = ['hoge', 's'] + expect(Noir::Command::Completion.suggestions(list)).to include('subcommand') + expect(Noir::Command::Completion.suggestions(list)).to include('subcommandtwo') + expect(Noir::Command::Completion.suggestions(list)).to_not include('subsubcommand') + end + + it 'return matced command name list in sub command' do + list = ['hoge', 'p'] + expect(Noir::Command::Completion.suggestions(list)).to eq([]) + end + end end
Add subcommands test in Noir::Command::Completion
diff --git a/app/controllers/spree/products_controller_decorator.rb b/app/controllers/spree/products_controller_decorator.rb index abc1234..def5678 100644 --- a/app/controllers/spree/products_controller_decorator.rb +++ b/app/controllers/spree/products_controller_decorator.rb @@ -2,7 +2,7 @@ ProductsController.class_eval do def show - @variants = @product.variants_including.active(current_currency).includes([:option_values, :images]) + @variants = @product.variants_including_master.active(current_currency).includes([:option_values, :images]) @product_properties = @product.product_properties.includes(:property) @taxon = Spree::Taxon.find(params[:taxon_id]) if params[:taxon_id] @taxonomies = Spree::Taxonomy.includes(root: :children)
Add sidebar to product page.
diff --git a/rails/app/models/office.rb b/rails/app/models/office.rb index abc1234..def5678 100644 --- a/rails/app/models/office.rb +++ b/rails/app/models/office.rb @@ -1,3 +1,5 @@ class Office < ActiveRecord::Base self.table_name = "pw_moffice" + + belongs_to :member, foreign_key: :person, primary_key: :person end
Add other side of association to Office model
diff --git a/watir/lib/watir/loader.rb b/watir/lib/watir/loader.rb index abc1234..def5678 100644 --- a/watir/lib/watir/loader.rb +++ b/watir/lib/watir/loader.rb @@ -3,11 +3,9 @@ module Watir class Browser class << self + def new(browser=nil, *args) - if browser && browser.to_sym != :ie && Watir.driver == :classic - Watir.driver = :webdriver - end - Watir.load_driver + load_driver_for browser if Watir.driver == :webdriver # remove this class method for WebDriver to avoid endless loop @@ -17,6 +15,31 @@ new browser.nil? && Watir.driver == :webdriver ? :firefox : browser, *args end + + def start(url, browser=nil, *args) + load_driver_for browser + + if Watir.driver == :webdriver + start url, browser || :firefox, *args + else + start url + end + end + + def method_missing(name, *args, &block) + Watir.load_driver + send name, *args, &block + end + + private + + def load_driver_for(browser) + if browser && browser.to_sym != :ie && Watir.driver == :classic + Watir.driver = :webdriver + end + Watir.load_driver + end + end end
Add support for Watir::Browser.start, Watir::Browser.attach and any other Watir::Browser methods.
diff --git a/services/stock_info.rb b/services/stock_info.rb index abc1234..def5678 100644 --- a/services/stock_info.rb +++ b/services/stock_info.rb @@ -32,7 +32,7 @@ def quotes today = Date.today - start_of_week = today - 5 + start_of_week = today - 10 @_quotes ||= MarketBeat.quotes(symbol, start_of_week, today) end
Include last 10 days in history
diff --git a/Casks/firefox-nightly.rb b/Casks/firefox-nightly.rb index abc1234..def5678 100644 --- a/Casks/firefox-nightly.rb +++ b/Casks/firefox-nightly.rb @@ -5,6 +5,7 @@ url "https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-#{version}.en-US.mac.dmg" homepage 'https://nightly.mozilla.org/' license :mpl + tags :vendor => 'Mozilla' app 'FirefoxNightly.app' end
Add tag stanza to firefox nightly
diff --git a/lib/formtastic/inputs/datalist_input.rb b/lib/formtastic/inputs/datalist_input.rb index abc1234..def5678 100644 --- a/lib/formtastic/inputs/datalist_input.rb +++ b/lib/formtastic/inputs/datalist_input.rb @@ -2,7 +2,7 @@ module Inputs # Outputs a label and a text field, along with a datalist tag # datalist tag provides a list of options which drives a simple autocomplete - # on the text field. This is a HTML5 feature, more info can be gotten at + # on the text field. This is a HTML5 feature, more info can be found at # {https://developer.mozilla.org/en/docs/Web/HTML/Element/datalist <datalist> at MDN} # This input accepts a :collection option which takes data in all the usual formats accepted by # {http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/options_for_select options_for_select} @@ -16,7 +16,7 @@ include Base::Collections def to_html - @name = input_html_options[:id].gsub("_id", "") + @name = input_html_options[:id].gsub(/_id$/, "") input_wrapping do label_html << builder.text_field(method, input_html_options) << # standard input @@ -34,7 +34,7 @@ def data_list_html html = builder.template.options_for_select(collection) - builder.template.content_tag(:datalist,html,{:id => html_id_of_datalist}, false) + builder.template.content_tag(:datalist,html, { :id => html_id_of_datalist }, false) end end end
Improve intent of the regex used to strip out _id, and other PR fixes
diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -1,5 +1,7 @@ class StaticPagesController < ApplicationController def home - @ideas = Idea.order('likes_count DESC') + ids = [3,20,38] + ideas = Idea.find_all_by_id(ids) + @ideas = ids.map {|id| ideas.detect{|x| x.id == id}} end end
Select ideas for slides show
diff --git a/lib/shoulda/matchers/assertion_error.rb b/lib/shoulda/matchers/assertion_error.rb index abc1234..def5678 100644 --- a/lib/shoulda/matchers/assertion_error.rb +++ b/lib/shoulda/matchers/assertion_error.rb @@ -1,6 +1,7 @@ module Shoulda module Matchers - if defined?(Test::Unit::AssertionFailedError) + if Gem.ruby_version >= Gem::Version.new('1.8') && Gem.ruby_version < Gem::Version.new('1.9') + require 'test/unit' AssertionError = Test::Unit::AssertionFailedError elsif Gem.ruby_version >= Gem::Version.new("1.9") require 'minitest/unit' @@ -9,4 +10,4 @@ raise "No unit test library available" end end -end+end
Fix the build on Ruby 1.8 using Test::Unit
diff --git a/Gem.gemspec b/Gem.gemspec index abc1234..def5678 100644 --- a/Gem.gemspec +++ b/Gem.gemspec @@ -15,6 +15,6 @@ spec.email = ["envygeeks@gmail.com"] spec.add_development_dependency("rspec", "~> 2.14") - spec.add_development_dependency("envygeeks-coveralls", "~> 0.1") - spec.add_development_dependency("luna-rspec-formatters", "~> 0.4") + spec.add_development_dependency("envygeeks-coveralls", "~> 0") + spec.add_development_dependency("luna-rspec-formatters", "~> 0") end
Allow any version of those depends.
diff --git a/site-cookbooks/backup_restore/recipes/setup.rb b/site-cookbooks/backup_restore/recipes/setup.rb index abc1234..def5678 100644 --- a/site-cookbooks/backup_restore/recipes/setup.rb +++ b/site-cookbooks/backup_restore/recipes/setup.rb @@ -1,4 +1,13 @@ include_recipe 'cron' + +package 'zlib-devel' do + action :install +end + +package 'xz-devel' do + action :install +end + # install gem backup with options --no-ri --no-rdoc before include_recipe 'backup' gem_package 'backup' do version node['backup']['version'] if node['backup']['version']
Add required packages to build nokogiri.