diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/celluloid-zmq/celluloid-zmq.gemspec b/celluloid-zmq/celluloid-zmq.gemspec index abc1234..def5678 100644 --- a/celluloid-zmq/celluloid-zmq.gemspec +++ b/celluloid-zmq/celluloid-zmq.gemspec @@ -8,11 +8,7 @@ gem.summary = "Celluloid::ZMQ provides concurrent Celluloid actors that can listen for 0MQ events" gem.homepage = "http://github.com/tarcieri/dcell" - gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } - gem.files = `git ls-files`.split("\n") - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") gem.name = "celluloid-zmq" - gem.require_paths = ["lib"] gem.version = Celluloid::ZMQ::VERSION gem.add_dependency "celluloid", ">= 0.6.2" @@ -23,4 +19,11 @@ gem.add_development_dependency "rake" gem.add_development_dependency "rspec", ">= 2.7.0" + + # Files + ignores = File.read(".gitignore").split(/\r?\n/).reject{ |f| f =~ /^(#.+|\s*)$/ }.map {|f| Dir[f] }.flatten + gem.files = (Dir['**/*','.gitignore'] - ignores).reject {|f| !File.file?(f) } + gem.test_files = (Dir['spec/**/*','.gitignore'] - ignores).reject {|f| !File.file?(f) } + # gem.executables = Dir['bin/*'].map { |f| File.basename(f) } + gem.require_paths = ['lib'] end
Use a better mechanism for locating files in the gemspec
diff --git a/spec/acceptance/test_sbyc.rb b/spec/acceptance/test_sbyc.rb index abc1234..def5678 100644 --- a/spec/acceptance/test_sbyc.rb +++ b/spec/acceptance/test_sbyc.rb @@ -0,0 +1,72 @@+require 'spec_helper' +module ICRb + describe "Using specialization by constraint" do + + class WithSByCContract + include ICRb::Datatype + + def initialize(rep) + @rep = rep + end + attr_reader :rep + + ic :inline, String, /^[1-9]+$/, ->(s){ s.length > 2 } do + def dress(s) + WithSByCContract.new(s) + end + def undress(wim) + wim.rep + end + end + + ic :byte, Infotype[Integer].such_that{|i| i>0 and i<255 } do + def dress(s) + WithSByCContract.new(s) + end + def undress(wim) + wim.rep + end + end + + end # class WithSByCContract + + describe 'inline IC' do + + it 'accepts valid strings' do + WithSByCContract.inline("123").should be_a(WithSByCContract) + end + + it 'rejects invalid strings' do + lambda{ + WithSByCContract.inline("abc") + }.should raise_error(DressError, "Invalid input `abc` for ICRb::WithSByCContract.inline") + end + + it 'rejects strings to short' do + lambda{ + WithSByCContract.inline("1") + }.should raise_error(DressError, "Invalid input `1` for ICRb::WithSByCContract.inline") + end + end + + describe 'through byte Infotype' do + + it 'accepts valid bytes' do + WithSByCContract.byte(123).should be_a(WithSByCContract) + end + + it 'rejects negative bytes' do + lambda{ + WithSByCContract.byte(-1) + }.should raise_error(DressError, "Invalid input `-1` for ICRb::WithSByCContract.byte") + end + + it 'rejects too large bytes' do + lambda{ + WithSByCContract.byte(256) + }.should raise_error(DressError, "Invalid input `256` for ICRb::WithSByCContract.byte") + end + end + + end +end
Add acceptance test for SByC.
diff --git a/spec/endpoint_access_spec.rb b/spec/endpoint_access_spec.rb index abc1234..def5678 100644 --- a/spec/endpoint_access_spec.rb +++ b/spec/endpoint_access_spec.rb @@ -6,7 +6,7 @@ let(:client) { WechatMP::Client.create } it "should find the health endpoint" do - expect(@client.Datacube.class).to eql(WechatMP::Endpoints::Datacube) + expect(client.datacube.class).to eql(WechatMP::Endpoints::Datacube) end end end
Fix an error in spec
diff --git a/fund_id_reference.rb b/fund_id_reference.rb index abc1234..def5678 100644 --- a/fund_id_reference.rb +++ b/fund_id_reference.rb @@ -6,7 +6,7 @@ require 'nokogiri' doc = Nokogiri::HTML(open('http://www.fundsupermart.com/main/home/index.svdo')) -funds = doc.css('select.fundselect option') +funds = doc.css('select.fundselect[name=dest] option') output = "= Fund ID Reference =\n" output << "_As of #{Time.now.strftime('%d %b %Y')}_\n\n"
Update fund ID parser due to change on page markup.
diff --git a/retort.gemspec b/retort.gemspec index abc1234..def5678 100644 --- a/retort.gemspec +++ b/retort.gemspec @@ -2,18 +2,14 @@ require 'retort/version' Gem::Specification.new do |s| - s.name = "retort" - s.version = Retort::VERSION - s.authors = ["Marcel Morgan"] - s.email = ["marcel.morgan@gmail.com"] + s.name = "retort" + s.version = Retort::VERSION + s.authors = ["Marcel Morgan"] + s.email = ["marcel.morgan@gmail.com"] - s.summary = "rtorrent xmlrpc ruby wrapper" - s.description = <<-EOL -rtorrent xmlrpc wrapper written in ruby (1.9). Designed to decouple the -xmlrpc interface from the underlying ruby objects. -EOL - s.homepage = "http://github.com/mcmorgan/retort" + s.summary = "An rTorrent xmlrpc wrapper written in ruby" + s.description = s.summary + s.homepage = "http://github.com/mcmorgan/retort" - #s.require_path = 'lib' - s.files = Dir.glob("lib/**/*.rb") + s.files = Dir.glob("lib/**/*.rb") end
Update gemspec description and summary to be the same
diff --git a/spec/fixtures/jeckle_config.rb b/spec/fixtures/jeckle_config.rb index abc1234..def5678 100644 --- a/spec/fixtures/jeckle_config.rb +++ b/spec/fixtures/jeckle_config.rb @@ -1,31 +1,33 @@-Jeckle::Setup.register(:my_super_api) do |api| - api.base_uri = 'http://my-super-api.com.br' - api.headers = { 'Content-Type' => 'application/json' } - api.logger = Logger.new(STDOUT) - api.basic_auth = { username: 'steven_seagal', password: 'youAlwaysLose' } - api.namespaces = { prefix: 'api', version: 'v1' } - api.params = { hello: 'world' } - api.open_timeout = 2 - api.read_timeout = 5 +Jeckle.configure do |config| + config.register :my_super_api do |api| + api.base_uri = 'http://my-super-api.com.br' + api.headers = { 'Content-Type' => 'application/json' } + api.logger = Logger.new(STDOUT) + api.basic_auth = { username: 'steven_seagal', password: 'youAlwaysLose' } + api.namespaces = { prefix: 'api', version: 'v1' } + api.params = { hello: 'world' } + api.open_timeout = 2 + api.read_timeout = 5 - api.middlewares do - request :json - response :json - response :raise_error + api.middlewares do + request :json + response :json + response :raise_error + end + end + + config.register :another_api do |api| + api.base_uri = 'http://another-api.com.br' + api.headers = { 'Content-Type' => 'application/json' } + api.logger = Logger.new(STDOUT) + api.basic_auth = { username: 'heisenberg', password: 'metaAfetaAMina' } + api.namespaces = { prefix: 'api', version: 'v5' } + api.params = { hi: 'there' } + + api.middlewares do + request :json + response :json + response :raise_error + end end end - -Jeckle::Setup.register(:another_api) do |api| - api.base_uri = 'http://another-api.com.br' - api.headers = { 'Content-Type' => 'application/json' } - api.logger = Logger.new(STDOUT) - api.basic_auth = { username: 'heisenberg', password: 'metaAfetaAMina' } - api.namespaces = { prefix: 'api', version: 'v5' } - api.params = { hi: 'there' } - - api.middlewares do - request :json - response :json - response :raise_error - end -end
Change the config fixture setup to use the user external DSL.
diff --git a/spec/support/example_models.rb b/spec/support/example_models.rb index abc1234..def5678 100644 --- a/spec/support/example_models.rb +++ b/spec/support/example_models.rb @@ -20,6 +20,12 @@ end end + + after do + NetSuiteRails::PollTrigger.instance_variable_set('@record_models', []) + NetSuiteRails::PollTrigger.instance_variable_set('@list_models', []) + end + end end end
Clear record & list cache after each model is torn down
diff --git a/pronto-rubocop.gemspec b/pronto-rubocop.gemspec index abc1234..def5678 100644 --- a/pronto-rubocop.gemspec +++ b/pronto-rubocop.gemspec @@ -20,6 +20,8 @@ s.test_files = `git ls-files -- {spec}/*`.split("\n") s.require_paths = ['lib'] + s.add_dependency 'rubocop', '~> 0.9.0' + s.add_dependency 'pronto', '~> 0.0.6' s.add_development_dependency 'rake', '~> 10.1.0' s.add_development_dependency 'rspec', '~> 2.13.0' end
Add pronto and rubocop as dependencies
diff --git a/spec/helpers/seeds_helper_spec.rb b/spec/helpers/seeds_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/seeds_helper_spec.rb +++ b/spec/helpers/seeds_helper_spec.rb @@ -0,0 +1,38 @@+require 'rails_helper' + +describe SeedsHelper do + describe "display_seed_description" do + it "no description" do + seed = FactoryGirl.create(:seed, + description: nil + ) + result = helper.display_seed_description(seed) + expect(result).to eq "no description provided." + end + + it "description is less than 130 chars" do + seed = FactoryGirl.create(:seed, + description: 'a' * 20 + ) + result = helper.display_seed_description(seed) + expect(result).to eq 'a' * 20 + end + + it "description is 130 chars" do + seed = FactoryGirl.create(:seed, + description: 'a' * 130 + ) + result = helper.display_seed_description(seed) + link = link_to("Read more", seed_path(seed)) + expect(result).to eq 'a' * 130 + end + + it "description is more than 130 chars" do + seed = FactoryGirl.create(:seed, + description: 'a' * 140 + ) + result = helper.display_seed_description(seed) + expect(result).to eq 'a' * 126 + '...' + ' ' + link_to("Read more", seed_path(seed)) + end + end +end
Add test coverage for Seeds Helper
diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb index abc1234..def5678 100644 --- a/spec/unit/recipes/default_spec.rb +++ b/spec/unit/recipes/default_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'openvpn::default' do - let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) } + let(:chef_run) { ChefSpec::SoloRunner.new.converge(described_recipe) } it 'converges' do chef_run
Use ChefSpec::SoloRunner instead of ChefSpec::Runner' due to deprecation.
diff --git a/lib/_program.rb b/lib/_program.rb index abc1234..def5678 100644 --- a/lib/_program.rb +++ b/lib/_program.rb @@ -42,4 +42,8 @@ end end + def path_is_blocked? + next_block_is_solid? or block_is_out_of_path? + end + end
Add custom path_is_blocked? method in Program
diff --git a/app/helpers/votes_helper.rb b/app/helpers/votes_helper.rb index abc1234..def5678 100644 --- a/app/helpers/votes_helper.rb +++ b/app/helpers/votes_helper.rb @@ -1,25 +1,30 @@ module VotesHelper + # vote_controls takes a post and outputs the controls seen at the side + # of the post + # + # it does this by seeing which posts a user has voted on and renders the + # appropriate partial def vote_controls(post) ret = "" upvote = find_vote(@user_votes, post, Vote::UPVOTE) downvote = find_vote(@user_votes, post, Vote::DOWNVOTE) - if !upvote.empty? - # current upvote - ret << render(partial: 'votes/destroy', locals: { vote: upvote.first }) - else - # not yet upvoted - ret << render(partial: 'votes/create', locals: { post: post, vote_type_id: 1 }) - end + ret << select_partial(upvote, post, 1) ret << %(<p class="vote-count">#{ post.vote_count }</p>) - if !downvote.empty? - ret << render(partial: 'votes/destroy', locals: { vote: downvote.first }) - else - ret << render(partial: 'votes/create', locals: { post: post, vote_type_id: 2 }) - end + ret << select_partial(downvote, post, 2) ret.html_safe end + + private def find_vote(votes, item, vote_type) votes.select { |v| v.post_type == item.class.to_s && v.post_id == item.id && v.vote_type_id == vote_type } end + + def select_partial(vote, post, type_id) + if !vote.empty? + render(partial: 'votes/destroy', locals: { vote: vote.first }) + else + render(partial: 'votes/create', locals: { post: post, vote_type_id: type_id }) + end + end end
Refactor out similar logic in selecting which partial to render
diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index abc1234..def5678 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -5,15 +5,18 @@ # Base class for all Jobs class ApplicationJob < ActiveJob::Base # Copied from ActiveJob::Exceptions, but uses debug log level. - def self.retry_on(exception, wait: 3.seconds, attempts: 5, queue: nil, priority: nil) + def self.retry_on(exception, wait: 3.seconds, attempts: 5, queue: nil, priority: nil, jitter: ActiveJob::Exceptions.const_get(:JITTER_DEFAULT)) rescue_from exception do |error| if executions < attempts logger.debug "Retrying #{self.class} in #{wait} seconds, due to a #{exception}. The original exception was #{error.cause.inspect}." - retry_job wait: determine_delay(wait), queue: queue, priority: priority + retry_job wait: determine_delay(seconds_or_duration_or_algorithm: wait, executions: executions, jitter: jitter), queue: queue, priority: priority, error: error else if block_given? - yield self, error + instrument :retry_stopped, error: error do + yield self, error + end else + instrument :retry_stopped, error: error logger.debug "Stopped retrying #{self.class} due to a #{exception}, which reoccurred on #{executions} attempts. The original exception was #{error.cause.inspect}." raise error end
Fix custom ActiveJob::Base.rescue_from after upgrading to Rails 6
diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/session_steps.rb +++ b/features/step_definitions/session_steps.rb @@ -1,4 +1,4 @@-Given /^I am (?:a|an) (writer|editor|admin|GDS editor)(?: called "([^"]*)")?$/ do |role, name| +Given /^I am (?:a|an) (writer|editor|admin|GDS editor|importer)(?: called "([^"]*)")?$/ do |role, name| @user = case role when "writer" create(:policy_writer, name: (name || "Wally Writer")) @@ -8,6 +8,8 @@ create(:user) when "GDS editor" create(:gds_editor) + when 'importer' + create(:importer) end login_as @user end
Allow cucumber to login as an importer user.
diff --git a/spec/angus/rspec/examples/describe_errors_spec.rb b/spec/angus/rspec/examples/describe_errors_spec.rb index abc1234..def5678 100644 --- a/spec/angus/rspec/examples/describe_errors_spec.rb +++ b/spec/angus/rspec/examples/describe_errors_spec.rb @@ -0,0 +1,64 @@+require 'spec_helper' + +require 'angus/rspec/support/examples/describe_errors' + +describe Angus::RSpec::Examples::DescribeErrors do + + subject(:descriptor) { Angus::RSpec::Examples::DescribeErrors } + + let(:base) do + Class.new do + def self.get(path, &block) + :get_v0 + end + end + end + + let(:error) { StandardError } + + let(:example) { double(:example, :app => base) } + + describe '.mock_service' do + + it 'mocks app method' do + mocked_app = nil + + descriptor.mock_service(base, error, example) do + mocked_app = example.app + end + + mocked_app.should_not eq(base) + end + + it 'binds to the original app method after running' do + example.app.should eq(base) + descriptor.mock_service(base, error, example) { } + + example.app.should eq(base) + end + + context 'when exception occurs' do + it 'binds to the original app method after running' do + example.app.should eq(base) + + begin + descriptor.mock_service(base, error, example) do + raise StandardError + end + rescue + end + + example.app.should eq(base) + end + + it 'reraises the exception' do + expect { + descriptor.mock_service(base, error, example) do + raise StandardError + end + }.to raise_error(StandardError) + end + end + end + +end
Add describe errors matcher specs. Change-Id: I289ec5ac23a3ea52c8ac11772860173e733b9511
diff --git a/spec/rails_admin/config/fields/types/text_spec.rb b/spec/rails_admin/config/fields/types/text_spec.rb index abc1234..def5678 100644 --- a/spec/rails_admin/config/fields/types/text_spec.rb +++ b/spec/rails_admin/config/fields/types/text_spec.rb @@ -2,12 +2,20 @@ describe RailsAdmin::Config::Fields::Types::Text do describe 'ckeditor_base_location' do + before do + @custom_prefix = '/foo' + @default_prefix = Rails.application.config.assets.prefix + Rails.application.config.assets.prefix = @custom_prefix + end + + after do + Rails.application.config.assets.prefix = @default_prefix + end + it 'allows custom assets prefix' do - custom_prefix = '/foo' - Rails.application.config.assets.prefix = custom_prefix expect( - RailsAdmin.config(FieldTest).fields.find{|f| f.name == :text_field}.with(object: FieldTest.new).ckeditor_base_location[0..(custom_prefix.length-1)] - ).to eq custom_prefix + RailsAdmin.config(FieldTest).fields.find{|f| f.name == :text_field}.with(object: FieldTest.new).ckeditor_base_location[0..(@custom_prefix.length-1)] + ).to eq @custom_prefix end end end
Fix order-dependent failure in spec
diff --git a/spec/support/lib/generators/test_app_generator.rb b/spec/support/lib/generators/test_app_generator.rb index abc1234..def5678 100644 --- a/spec/support/lib/generators/test_app_generator.rb +++ b/spec/support/lib/generators/test_app_generator.rb @@ -21,6 +21,10 @@ generate 'hydra:head', '-f' end + def install_redis_config + copy_file "config/redis.yml" + end + def run_sufia_generator say_status("warning", "GENERATING SUFIA", :yellow) @@ -29,7 +33,4 @@ remove_file 'spec/factories/users.rb' end - def install_redis_config - copy_file "config/redis.yml" - end end
Set up redis.yml first so that subsequent generators don't fail
diff --git a/spec/unit/facter/haveged_startup_provider_spec.rb b/spec/unit/facter/haveged_startup_provider_spec.rb index abc1234..def5678 100644 --- a/spec/unit/facter/haveged_startup_provider_spec.rb +++ b/spec/unit/facter/haveged_startup_provider_spec.rb @@ -9,14 +9,14 @@ Facter.clear } - describe 'haveged_startup_provider with /proc/1/comm' do + context 'haveged_startup_provider with /proc/1/comm' do it { File.stubs(:open).returns("foo\n") expect(Facter.fact(:haveged_startup_provider).value).to eq('foo') } end - describe 'haveged_startup_provider without /proc/1/comm' do + context 'haveged_startup_provider without /proc/1/comm' do it { File.stubs(:open) { raise(StandardException) } expect(Facter.fact(:haveged_startup_provider).value).to eq('init')
Use context in fact tests
diff --git a/config/schedule.rb b/config/schedule.rb index abc1234..def5678 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -1,3 +1,6 @@+# Force manual loading of rails application to get all env variables from dotenv-rails when running whenever cmd +require File.expand_path('../environment', __FILE__) + require 'whenever' require 'yaml'
Fix environment variables loading when running whenever
diff --git a/app/models/feedback.rb b/app/models/feedback.rb index abc1234..def5678 100644 --- a/app/models/feedback.rb +++ b/app/models/feedback.rb @@ -3,4 +3,23 @@ validates_presence_of :rating belongs_to :sender, class_name: "User" belongs_to :recipient, class_name: "User" + + RESET_POINTS = 0 + POINTS_ADJUSTMENT_FACTOR = 10 + MAX_POINTS_FOR_LEVEL = 100 + + def self.possible_ratings_for_select_list + [["One Star", 1], ["Two Stars", 2], ["Three Stars", 3]] + end + + def self.adjust_level_points_for_user(feedback, user) + user.points += feedback.rating * POINTS_ADJUSTMENT_FACTOR if feedback.rating + if user.points >= MAX_POINTS_FOR_LEVEL + curr_level = user.level + user.level = Level.find_by(language_id: curr_level.language_id, + value: curr_level.value + 1) if user.level.value < MAX_POINTS_FOR_LEVEL + user.points = RESET_POINTS + end + user.save + end end
Add helper methods adjusting user points
diff --git a/lib/analyze_student_attendance.rb b/lib/analyze_student_attendance.rb index abc1234..def5678 100644 --- a/lib/analyze_student_attendance.rb +++ b/lib/analyze_student_attendance.rb @@ -36,8 +36,15 @@ select_by_column(column, value).size end + def total + @total ||= data.length + end + def count_versus_total(column, value) - "#{column} => #{count_for_column(column, value)} out of #{data.length}" + count = count_for_column(column, value) + percentage = 100 * count.to_f / total.to_f + + "#{column} => #{count} out of #{total} (#{percentage}%)" end end
Print out percentages for counts
diff --git a/config/initializers/mobile_phone.rb b/config/initializers/mobile_phone.rb index abc1234..def5678 100644 --- a/config/initializers/mobile_phone.rb +++ b/config/initializers/mobile_phone.rb @@ -1,5 +1,5 @@ MOBILE_GATEWAYS = { - 'AT&T' => '%s@mobile.att.net', + 'AT&T' => '%s@txt.att.net', 'CellularOne' => '%s@mobile.celloneusa.com', 'Cingular' => '%s@mobile.mycingular.com', 'Nextel' => '%s@messaging.nextel.com', @@ -8,4 +8,4 @@ 'US Cellular' => '%s@email.uscc.net', 'Verizon' => '%s@vtext.com', 'Virgin Mobile' => '%s@vmobl.com', -}+}
Update AT&T mobile txt gateway address.
diff --git a/app/models/review_period.rb b/app/models/review_period.rb index abc1234..def5678 100644 --- a/app/models/review_period.rb +++ b/app/models/review_period.rb @@ -1,7 +1,4 @@ class ReviewPeriod - def initialize - end - def send_closure_notifications if ENV['REVIEW_PERIOD'] == 'CLOSED' participants.each do |participant|
Remove initializer declaration (not needed)
diff --git a/app/models/search_record.rb b/app/models/search_record.rb index abc1234..def5678 100644 --- a/app/models/search_record.rb +++ b/app/models/search_record.rb @@ -11,7 +11,7 @@ # class SearchRecord < ActiveRecord::Base - STORAGE_LIFETIME = 30.days + STORAGE_LIFETIME = 14.days has_many :search_records_words, dependent: :destroy has_many :words, -> { order('search_records_words.position') }, through: :search_records_words
Reduce SearchRecord STORAGE_LIFETIME to 14 days
diff --git a/lib/em/mqtts/broker_connection.rb b/lib/em/mqtts/broker_connection.rb index abc1234..def5678 100644 --- a/lib/em/mqtts/broker_connection.rb +++ b/lib/em/mqtts/broker_connection.rb @@ -9,7 +9,7 @@ @client_address = client_address @client_port = client_port @gateway_handler = gateway_handler - @topic_id = 1 + @topic_id = 0 @topic_map = {} end
Reset first topic id to 1
diff --git a/lib/perpetuity/data_injectable.rb b/lib/perpetuity/data_injectable.rb index abc1234..def5678 100644 --- a/lib/perpetuity/data_injectable.rb +++ b/lib/perpetuity/data_injectable.rb @@ -17,10 +17,8 @@ id = args.pop object.define_singleton_method(:id) { id } else - object.instance_exec do - def id - @id - end + def object.id + @id end end end
Define method rather than using instance_exec
diff --git a/lib/spree_billing_sisow/engine.rb b/lib/spree_billing_sisow/engine.rb index abc1234..def5678 100644 --- a/lib/spree_billing_sisow/engine.rb +++ b/lib/spree_billing_sisow/engine.rb @@ -1,6 +1,7 @@ module SpreeBillingSisow class Engine < Rails::Engine require 'spree/core' + require 'sisow' isolate_namespace Spree engine_name 'spree_billing_sisow'
Make sure sisow is loaded. Checkout and admin wil otherwise flunk.
diff --git a/lib/thinking_sphinx/core/index.rb b/lib/thinking_sphinx/core/index.rb index abc1234..def5678 100644 --- a/lib/thinking_sphinx/core/index.rb +++ b/lib/thinking_sphinx/core/index.rb @@ -7,10 +7,11 @@ end def initialize(reference, options = {}) - @reference = reference.to_sym - @docinfo = :extern - @options = options - @offset = config.next_offset(reference) + @reference = reference.to_sym + @docinfo = :extern + @charset_type = 'utf-8' + @options = options + @offset = config.next_offset(reference) super "#{options[:name] || reference.to_s.gsub('/', '_')}_#{name_suffix}" end
Use UTF-8 as the default charset (same as previous Thinking Sphinx versions).
diff --git a/lib/vidibus/user/warden/helper.rb b/lib/vidibus/user/warden/helper.rb index abc1234..def5678 100644 --- a/lib/vidibus/user/warden/helper.rb +++ b/lib/vidibus/user/warden/helper.rb @@ -37,6 +37,7 @@ end # Returns current host. + # TODO: return forwarded host, if proxied def host "#{protocol}#{env['HTTP_HOST']}" end
Add note about forwarded hosts
diff --git a/init.rb b/init.rb index abc1234..def5678 100644 --- a/init.rb +++ b/init.rb @@ -1,2 +1,2 @@ # Get long stack traces for easier debugging; you'll thank me later. -Rails.backtrace_cleaner.remove_silencers!+Rails.backtrace_cleaner.remove_silencers! if Rails.respond_to?(:backtrace_cleaner)
[^] Fix undefined method 'backtrace_cleaner' for Rails:Module on rails 2.0.2
diff --git a/config/initializers/90_roll_tape.rb b/config/initializers/90_roll_tape.rb index abc1234..def5678 100644 --- a/config/initializers/90_roll_tape.rb +++ b/config/initializers/90_roll_tape.rb @@ -1,5 +1,3 @@-require 'rack/streaming_proxy' - if defined? Camerasink::BASEDIR camera = Camera.find_by_name(:test) if !camera
Remove an errant rack-streaming-proxy require
diff --git a/config/initializers/registration.rb b/config/initializers/registration.rb index abc1234..def5678 100644 --- a/config/initializers/registration.rb +++ b/config/initializers/registration.rb @@ -7,11 +7,17 @@ "TODO" end +account_path = -> do + Neighborly::Balanced::Bankaccount::Engine. + routes.url_helpers.new_account_path() +end + begin PaymentEngines.register(name: 'balanced-bankaccount', locale: 'en', value_with_fees: value_with_fees, - review_path: review_path) + review_path: review_path, + account_path: account_path) rescue Exception => e puts "Error while registering payment engine: #{e}" end
Add to payment engines register the account path
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,12 @@ module ApplicationHelper + # Get the gravatar picture of a user. + # This take an user object as parameter. + def gravatar_for user, options = { size: 200 } + userEmail = user[:email].strip.downcase + size = options[:size] + gravatar_id = Digest::MD5::hexdigest(userEmail) + gravatar_url = "https://www.gravatar.com/avatar/#{gravatar_id}?s=#{size}" + + image_tag(gravatar_url, alt: user.username, class: "img-circle") + end end
Create gravatar_for helper for get avatars pictures This helper can be used in views for get gravatars pictures linked with the user email. Optionally can pass a size for a better picture quality.
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -14,6 +14,6 @@ end def current_year - DateTime.now.year + Date.today.year end end
Use Date instead of DateTime
diff --git a/app/helpers/hub/request_helper.rb b/app/helpers/hub/request_helper.rb index abc1234..def5678 100644 --- a/app/helpers/hub/request_helper.rb +++ b/app/helpers/hub/request_helper.rb @@ -1,11 +1,5 @@ module Hub module RequestHelper - def wechat_request? - request.user_agent.downcase.match(/micromessenger/) - rescue - false - end - def android_browser_request? ua = request.user_agent.downcase ua.match(/android/) && !ua.start_with?('dalvik')
Move back wechat_request to applications.
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true class ApplicationMailer < ActionMailer::Base - default from: "dashboard@#{ENV['dashboard_url']}" + default from: "dashboard@#{ENV['dashboard_url']}", + reply_to: ENV['default_reply_email'] layout 'mailer' add_template_helper(SurveysUrlHelper) end
Set a default reply-to address
diff --git a/utils/defcon.rb b/utils/defcon.rb index abc1234..def5678 100644 --- a/utils/defcon.rb +++ b/utils/defcon.rb @@ -0,0 +1,29 @@+#!/usr/bin/env ruby -wKU + +$:.unshift(File.expand_path("../../lib", __FILE__)) + +require 'fileutils' +require 'whois' +require 'json' + +def convert(type) + defs = Whois::Server.definitions(type) + json = {} + defs.each do |(allocation, host, options)| + json[allocation] = { host: host } + json[allocation].merge!(options) + end + + JSON.pretty_generate(json) +end + +def write(type, content) + File.open(File.expand_path("../../lib/whois/definitions/#{type}.json", __FILE__), "w+") do |f| + f.write(content) + end +end + + +Whois::Server.definitions.keys.each do |type| + write(type, convert(type)) +end
Add utility to convert existing definitions to JSON
diff --git a/db/migrate/20150518151555_add_geocoding_batching.rb b/db/migrate/20150518151555_add_geocoding_batching.rb index abc1234..def5678 100644 --- a/db/migrate/20150518151555_add_geocoding_batching.rb +++ b/db/migrate/20150518151555_add_geocoding_batching.rb @@ -0,0 +1,16 @@+# encoding: utf-8 + +class AddBatchedToGeocoding < Sequel::Migration + + def up + alter_table :geocodings do + add_column :batched, :boolean + end + end + + def down + alter_table :geocodings do + drop_column :batched + end + end +end
Add migration to store batched field Targetted at hi-res geocodings
diff --git a/app/presenters/field_presenter.rb b/app/presenters/field_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/field_presenter.rb +++ b/app/presenters/field_presenter.rb @@ -32,7 +32,7 @@ def input_defaults(options) data = input_data_defaults(options.fetch(:data, {})) - options.reverse_merge(:label => label, :data => data, :help => comment) + options.reverse_merge(:label => label, :data => data, :help => comment, :include_blank => !field.required) end def input_data_defaults(data)
Allow for an empty choice if field is not required
diff --git a/app/models/ability.rb b/app/models/ability.rb index abc1234..def5678 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -13,5 +13,9 @@ can [ :create, :update ], Lesson do |lesson| lesson.user == user end + + can [ :create ], Blog do |blog| + blog.user == user + end end end
Update Ability for Blog Create Update the Ability model to handle create Blog.
diff --git a/SimpleAuth.podspec b/SimpleAuth.podspec index abc1234..def5678 100644 --- a/SimpleAuth.podspec +++ b/SimpleAuth.podspec @@ -12,6 +12,8 @@ s.dependency 'cocoa-oauth' s.dependency 'SAMCategories' + s.public_header_files = 'SimpleAuth/SimpleAuth.h' + s.ios.deployment_target = '6.0' s.ios.frameworks = 'Accounts', 'Social', 'Security', 'CoreGraphics' end
Hide headers that API consumers don't need.
diff --git a/lib/jefferies_tube/capistrano/s3_assets.rb b/lib/jefferies_tube/capistrano/s3_assets.rb index abc1234..def5678 100644 --- a/lib/jefferies_tube/capistrano/s3_assets.rb +++ b/lib/jefferies_tube/capistrano/s3_assets.rb @@ -1,5 +1,5 @@-task :precompile_and_upload_assets do - on roles(:assets_precompiler) do +task :upload_assets_to_s3 do + on roles(fetch(:assets_roles)) do within release_path do with rails_env: fetch(:rails_env), rails_groups: fetch(:rails_assets_groups) do execute :rake, "assets:precompile"
Use asset_roles to know which server to have upload the assets
diff --git a/lib/stateflow/persistence/active_record.rb b/lib/stateflow/persistence/active_record.rb index abc1234..def5678 100644 --- a/lib/stateflow/persistence/active_record.rb +++ b/lib/stateflow/persistence/active_record.rb @@ -9,7 +9,7 @@ module ClassMethods def add_scope(state) - scope state.name, where("#{machine.state_column}".to_sym => state.name.to_s) + scope state.name, proc { where("#{machine.state_column}".to_sym => state.name.to_s) } end end
Fix ActiveRecord deprecation warning from old-school scope usage. Removes annoying deprecation warnings from Rails output: ``` DEPRECATION WARNING: Using #scope without passing a callable object is deprecated. For example `scope :red, where(color: 'red')` should be changed to `scope :red, -> { where(color: 'red') }`. There are numerous gotchas in the former usage and it makes the implementation more complicated and buggy. (If you prefer, you can just define a class method named `self.red`.). (called from add_scope at /Users/jnh/.rvm/gems/ruby-2.0.0-p247/bundler/gems/stateflow-dbc47eed5c77/lib/stateflow/persistence/active_record.rb:12) ```
diff --git a/actionversion.gemspec b/actionversion.gemspec index abc1234..def5678 100644 --- a/actionversion.gemspec +++ b/actionversion.gemspec @@ -18,6 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.required_ruby_version = '>= 1.9.3' spec.add_dependency "activesupport" spec.add_development_dependency "bundler", "~> 1.6"
Add ruby version support to gemfile
diff --git a/files/default/ohai_plugins/pci.rb b/files/default/ohai_plugins/pci.rb index abc1234..def5678 100644 --- a/files/default/ohai_plugins/pci.rb +++ b/files/default/ohai_plugins/pci.rb @@ -21,10 +21,13 @@ pci2 Mash.new # use the more verbose lspci output: # devices are split by double newlines - `lspci -vmm`.split("\n\n").each do |d| + # -vmm: output format + # -k: add kernel driver + # -nn: add numeric PCI ids + `lspci -vmm -k -nn`.split("\n\n").each do |d| # each device is a list of "key1:\tvalue1\nkey2:..." # we scan this into [ [ 'key1', 'value1' ], [ ... ] ] - a = d.scan(/^(.*?):\t(.*?)\n/) + a = d.scan(/^(.*?):\t(.*?)$/) # make the keys lowercase and turn result into a hash h = a.map { |k, v| [k.downcase, v] }.to_h # remove the 'slot' and use it as the key for the pci2 hash
Extend collected information and fix regex for scan
diff --git a/announcements.gemspec b/announcements.gemspec index abc1234..def5678 100644 --- a/announcements.gemspec +++ b/announcements.gemspec @@ -20,7 +20,7 @@ s.add_development_dependency "rspec" - s.add_runtime_dependency "rails", "~> 3.1" + s.add_runtime_dependency "rails", ">= 3.1.0" s.add_runtime_dependency "jquery-rails" end
Use more permissive version constraint
diff --git a/lib/arrthorizer/group.rb b/lib/arrthorizer/group.rb index abc1234..def5678 100644 --- a/lib/arrthorizer/group.rb +++ b/lib/arrthorizer/group.rb @@ -13,7 +13,12 @@ Role.register(self) end - def applies_to_user?(user, context) + def applies_to_user?(user, _) + is_member?(user) + end + + private + def is_member?(user) Arrthorizer.membership_service.is_member_of?(user, self) end end
Add level of indirection to ease overriding in Groups The applies_to_user? function is used internally by Arrthorizer, but if developers want to override the default behavior, this applies_to_user function makes no semantic sense (for example, it takes a superfluous parameter). The is_member? function makes semantic sense and looks better.
diff --git a/lib/default_variables.rb b/lib/default_variables.rb index abc1234..def5678 100644 --- a/lib/default_variables.rb +++ b/lib/default_variables.rb @@ -0,0 +1,35 @@+module RailsReroute + DEFAULT_VARIABLES = Set.new(%W[ + CONTENT_TYPE + CONTENT_LENGTH + HTTPS + AUTH_TYPE + HTTP_COOKIE + GATEWAY_INTERFACE + PATH_INFO + PATH_TRANSLATED + QUERY_STRING + REMOTE_ADDR + REMOTE_HOST + REMOTE_IDENT + REMOTE_USER + REQUEST_METHOD + SCRIPT_NAME + SERVER_NAME + SERVER_PORT + SERVER_PROTOCOL + SERVER_SOFTWARE + HTTP_TE + HTTP_CONNECTION + HTTP_ACCEPT_ENCODING + HTTP_AKAMAI_ORIGIN_HOP + HTTP_VIA + HTTP_X_AKAMAI_EDGESCAPE + HTTP_X_FORWARDED_FOR + HTTP_TRUE_CLIENT_IP + HTTP_HOST + HTTP_CACHE_CONTROL + HTTP_REFERER + HTTP_USER_AGENT + ]).freeze +end
Add constants to store the default variables
diff --git a/handlers/other/deregister-node.rb b/handlers/other/deregister-node.rb index abc1234..def5678 100644 --- a/handlers/other/deregister-node.rb +++ b/handlers/other/deregister-node.rb @@ -0,0 +1,14 @@+#! /usr/bin/env ruby + +require 'json' +require 'socket' + +hostname = 'localhost' +port = '3030' +socket_input = '{ "name": "test_check", "output": "some output", "status": 1 }' + +a = TCPSocket.open(hostname, port) + +a.print socket_input + +a.close
Add handler to deregister sensu node from dashboard upon shutdown
diff --git a/be_valid_asset.gemspec b/be_valid_asset.gemspec index abc1234..def5678 100644 --- a/be_valid_asset.gemspec +++ b/be_valid_asset.gemspec @@ -7,7 +7,7 @@ gem.name = "be_valid_asset" gem.version = BeValidAsset::VERSION gem.authors = ["Alex Tomlins", "Attila Gyorffy", "Ben Brinckerhoff", "Jolyon Pawlyn", "Sebastian de Castelberg"] - gem.email = ["attila@attilagyorffy.com"] + gem.email = ["github@unboxedconsulting.com"] gem.description = %q{Provides be_valid_markup, be_valid_css and be_valid_feed matchers for RSpec controller and view tests.} gem.summary = %q{Markup and asset validation for RSpec} gem.homepage = "http://github.com/unboxed/be_valid_asset"
Switch back to the organisation email address.
diff --git a/app/models/ability.rb b/app/models/ability.rb index abc1234..def5678 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -3,6 +3,6 @@ def initialize(user) user ||= User.new - can :manage, Club, :user_id => user.id + can :update, Club, :user_id => user.id end end
Update Ability for Club Update (vs Manage) Update the Ability model to change the manage capability to update since a User will only ever update the Club model.
diff --git a/app/models/section.rb b/app/models/section.rb index abc1234..def5678 100644 --- a/app/models/section.rb +++ b/app/models/section.rb @@ -20,4 +20,8 @@ end false end + + def sort_periods + + end end
Add empty function to sort periods in Section model
diff --git a/test/unit/multi_sender_test.rb b/test/unit/multi_sender_test.rb index abc1234..def5678 100644 --- a/test/unit/multi_sender_test.rb +++ b/test/unit/multi_sender_test.rb @@ -0,0 +1,56 @@+# frozen_string_literal: true + +require_relative '../../lib/invoca/utils/multi_sender.rb' +require_relative '../test_helper' + +class MultiSenderTest < Minitest::Test + # create enumerable class for testing + class LinkedList + include Enumerable + + def initialize(head, tail = nil) + @head, @tail = head, tail + end + + def <<(item) + LinkedList.new(item, self) + end + + def inspect + [@head, @tail].inspect + end + + def each(&block) + if block_given? + block.call(@head) + @tail.each(&block) if @tail + else + to_enum(:each) + end + end + end + + context 'MultiSender' do + context 'with custom Enumerable' do + setup do + linked_list = LinkedList.new('some') << 'short' << 'words' + @multi_sender = Invoca::Utils::MultiSender.new(linked_list, :map) + end + + should 'call the same method on each item in an Enumerable and return the results as an array' do + assert_equal([5, 5, 4], @multi_sender.length) + end + + should 'handle methods with arguments' do + assert_equal(['or', 'ho', 'om'], @multi_sender.slice(1, 2)) + end + end + + context 'with built-in Array' do + should 'call the same method on each item in an Array and return the results as an array' do + multi_sender = Invoca::Utils::MultiSender.new(['some', 'short', 'words'], :map) + assert_equal([4, 5, 5], multi_sender.length) + end + end + end +end
Add tests for MultiSender class
diff --git a/spec/classes/dependencies_spec.rb b/spec/classes/dependencies_spec.rb index abc1234..def5678 100644 --- a/spec/classes/dependencies_spec.rb +++ b/spec/classes/dependencies_spec.rb @@ -13,4 +13,8 @@ it { should include_class('rbenv::dependencies::ubuntu') } end + context 'CentOS' do + let(:facts) { { :operatingsystem => 'CentOS' } } + it { should include_class('rbenv::dependencies::centos') } + end end
Add very simple spec for detection of CentOS dependency class
diff --git a/spec/factories/theorem_factory.rb b/spec/factories/theorem_factory.rb index abc1234..def5678 100644 --- a/spec/factories/theorem_factory.rb +++ b/spec/factories/theorem_factory.rb @@ -9,6 +9,7 @@ parent_onto = create :distributed_ontology, :with_versioned_children theorem.ontology = parent_onto.children.first end + theorem.locid = "#{theorem.ontology.locid}//#{theorem.name}" end end end
Fix Theorem factory not setting a locid.
diff --git a/spec/support/controller_macros.rb b/spec/support/controller_macros.rb index abc1234..def5678 100644 --- a/spec/support/controller_macros.rb +++ b/spec/support/controller_macros.rb @@ -0,0 +1,24 @@+# https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-(and-RSpec) + +module ControllerMacros + def login_admin + before(:each) do + @request.env["devise.mapping"] = Devise.mappings[:admin] + sign_in FactoryGirl.create(:admin) # Using factory girl as an example + end + end + + def login_user + before(:each) do + @request.env["devise.mapping"] = Devise.mappings[:user] + user = FactoryGirl.create(:user) + user.confirm! # or set a confirmed_at inside the factory. Only necessary if you are using the "confirmable" module + sign_in user + end + end +end + +RSpec.configure do |config| + config.include Devise::TestHelpers, :type => :controller + config.extend ControllerMacros, :type => :controller +end
Prepare for writing movings request spec
diff --git a/activesupport.gemspec b/activesupport.gemspec index abc1234..def5678 100644 --- a/activesupport.gemspec +++ b/activesupport.gemspec @@ -1,4 +1,4 @@-version = File.read(File.expand_path('../../RAILS_VERSION', __FILE__)).strip +version = '4.2.0.alpha' Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY
Fix gemspec version at 4.2.0.alpha
diff --git a/add_user_to_sqlite.rb b/add_user_to_sqlite.rb index abc1234..def5678 100644 --- a/add_user_to_sqlite.rb +++ b/add_user_to_sqlite.rb @@ -1,17 +1,17 @@ # -*- coding: utf-8 -*- require 'sqlite3' - -@database_yml = ARGV[0] +require 'digest/sha1' @nomnichi_db = SQLite3::Database.new("nomnichi.sqlite3") + print "User : "; user = gets.chomp print "Pass : "; pass = gets.chomp -salt = 'sio'#Time.now.to_s -puts salt -pass_sha = `echo -n '#{salt}#{pass}' | shasum`.chomp.split(' ').first -puts pass_sha +salt = Time.now.to_s + +pass_sha = Digest::SHA1.hexdigest(salt + pass) + max_id_sql = <<SQL select max(id) from user; SQL @@ -22,8 +22,5 @@ SQL @nomnichi_db.execute(add_user_sql) - -# yaml_data = YAML.load_file("./#{@database_yml}") -# into_article_table(yaml_data) @nomnichi_db.close
Fix bug in script to add user to sqlite3
diff --git a/tasks/ffi.rake b/tasks/ffi.rake index abc1234..def5678 100644 --- a/tasks/ffi.rake +++ b/tasks/ffi.rake @@ -4,13 +4,12 @@ `swig -xml -o ioctl_wrap.xml -I/usr/include swig/ioctl.i` `swig -xml -o input_wrap.xml -I/usr/include swig/input.i` - `ffi-gen ioctl_wrap.xml lib/linux_input/generated/ioctl.rb` - `ffi-gen input_wrap.xml lib/linux_input/generated/input.rb` + `ffi-gen ioctl_wrap.xml ioctl.rb` + `ffi-gen input_wrap.xml input.rb` - `sed -i 's/\\([0-9]\\)U/\\1/g' lib/linux_input/generated/ioctl.rb` - `sed -i 's/_IO/IO/g' lib/linux_input/generated/ioctl.rb` - `sed -i 's/ff_effect_u/FfEffectU/g' lib/linux_input/generated/input.rb` + `cat ioctl.rb | sed -e 's/\\([0-9]\\)U/\\1/g' | sed -e 's/_IO/IO/g' > lib/linux_input/generated/ioctl.rb` + `cat input.rb | sed -e 's/ff_effect_u/FfEffectU/g' > lib/linux_input/generated/input.rb` - `rm -f ioctl_wrap.xml input_wrap.xml` + `rm -f ioctl_wrap.xml input_wrap.xml ioctl.rb input.rb` end end
Fix permissions of generated files
diff --git a/looksee.gemspec b/looksee.gemspec index abc1234..def5678 100644 --- a/looksee.gemspec +++ b/looksee.gemspec @@ -6,7 +6,7 @@ s.version = Looksee::VERSION s.authors = ["George Ogata"] s.email = ["george.ogata@gmail.com"] - s.date = Date.today.strftime('%Y-%m-%d') + s.date = Time.now.strftime('%Y-%m-%d') s.summary = "Inspect method lookup paths in ways not possible in plain ruby." s.description = "Inspect method lookup paths in ways not possible in plain ruby." s.homepage = 'http://github.com/oggy/looksee'
Use Time.now instead of Date.today in gemspec. Date.today requires the date library, which is not always loaded by rubygems.
diff --git a/gem_template.gemspec b/gem_template.gemspec index abc1234..def5678 100644 --- a/gem_template.gemspec +++ b/gem_template.gemspec @@ -2,8 +2,8 @@ require File.expand_path('../lib/gem_template/version', __FILE__) Gem::Specification.new do |gem| - gem.add_development_dependency 'maruku', '~> 0.6' gem.add_development_dependency 'rake', '~> 0.9' + gem.add_development_dependency 'rdiscount', '~> 1.6' gem.add_development_dependency 'rspec', '~> 2.6' gem.add_development_dependency 'simplecov', '~> 0.4' gem.add_development_dependency 'yard', '~> 0.7'
Replace maruku with rdiscount for Markdown library
diff --git a/app/models/concerns/adminable/resource_concern.rb b/app/models/concerns/adminable/resource_concern.rb index abc1234..def5678 100644 --- a/app/models/concerns/adminable/resource_concern.rb +++ b/app/models/concerns/adminable/resource_concern.rb @@ -4,7 +4,11 @@ def adminable %i(title name email login id).each do |name| - return OpenStruct.new(name: public_send(name)) unless try(name).nil? + begin + return OpenStruct.new(name: public_send(name)) + rescue NoMethodError + next + end end end end
Refactor resource concern adminable method
diff --git a/Casks/firefox-aurora.rb b/Casks/firefox-aurora.rb index abc1234..def5678 100644 --- a/Casks/firefox-aurora.rb +++ b/Casks/firefox-aurora.rb @@ -1,8 +1,8 @@ class FirefoxAurora < Cask - version '35.0a2' - sha256 'c27899ebdb9d3b44ccac8ad904a03b421b65208e66937c62d795aab1d0014999' + version :latest + sha256 :no_check - url "https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora/firefox-#{version}.en-US.mac.dmg" + url "https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora/firefox-35.0a2.en-US.mac.dmg" homepage 'https://www.mozilla.org/en-US/firefox/aurora/' license :oss
Remove sha check and version from FirefoxAurora Sha is likely to change without notice even for the same dmg filename (was currently broken because of this)
diff --git a/Casks/send_to_kindle.rb b/Casks/send_to_kindle.rb index abc1234..def5678 100644 --- a/Casks/send_to_kindle.rb +++ b/Casks/send_to_kindle.rb @@ -0,0 +1,7 @@+class Send_to_kindle < Cask + url 'http://s3.amazonaws.com/sendtokindle/SendToKindleForMac-installer-v1.0.0.218.pkg' + homepage 'http://www.amazon.com/gp/sendtokindle/mac' + version '1.0.0.218' + sha1 'a1c2759d220e707b12cfefa8fcd1f58f5d3165cf' + install 'SendToKindleForMac-installer-v1.0.0.218.pkg' +end
Send to kindle recipe added.
diff --git a/lib/casino_core/helper/tickets.rb b/lib/casino_core/helper/tickets.rb index abc1234..def5678 100644 --- a/lib/casino_core/helper/tickets.rb +++ b/lib/casino_core/helper/tickets.rb @@ -1,8 +1,15 @@+require 'securerandom' + module CASinoCore module Helper module Tickets + + ALLOWED_TICKET_STRING_CHARACTERS = ('A'..'Z').to_a + ('a'..'z').to_a + ('0'..'9').to_a + def random_ticket_string(prefix, length = 40) - random_string = rand(36**length).to_s(36) + random_string = SecureRandom.random_bytes(length).each_char.map do |char| + ALLOWED_TICKET_STRING_CHARACTERS[(char.ord % ALLOWED_TICKET_STRING_CHARACTERS.length)] + end.join "#{prefix}-#{Time.now.to_i}-#{random_string}" end end
Use SecureRandom to generate ticket strings
diff --git a/lib/catsocket_client/publisher.rb b/lib/catsocket_client/publisher.rb index abc1234..def5678 100644 --- a/lib/catsocket_client/publisher.rb +++ b/lib/catsocket_client/publisher.rb @@ -4,7 +4,8 @@ class Publisher < Struct.new(:url, :api_key) def publish(channel, data) - RestClient.post(url, guid: 0, api_key: api_key, channel: channel, data: data.to_json) + json = data.is_a?(String) ? data : data.to_json + RestClient.post(url, guid: 0, api_key: api_key, channel: channel, data: json) end end
Convert data to json only if it is not already a string
diff --git a/lib/convection/model/cloudfile.rb b/lib/convection/model/cloudfile.rb index abc1234..def5678 100644 --- a/lib/convection/model/cloudfile.rb +++ b/lib/convection/model/cloudfile.rb @@ -9,7 +9,7 @@ # DSL for Cloudfile ## module Cloudfile - extend DSL::Helpers + include DSL::Helpers attribute :name attribute :region
Clean up and expand Helpers modules
diff --git a/lib/llt/diff/parser/reportable.rb b/lib/llt/diff/parser/reportable.rb index abc1234..def5678 100644 --- a/lib/llt/diff/parser/reportable.rb +++ b/lib/llt/diff/parser/reportable.rb @@ -4,10 +4,10 @@ include HashContainable include Comparable - attr_reader :total + attr_reader :id, :total def initialize(id, total = 1) - super + super(id) @total = total end
Fix id handling in Reportable
diff --git a/lib/oauth2/strategy/web_server.rb b/lib/oauth2/strategy/web_server.rb index abc1234..def5678 100644 --- a/lib/oauth2/strategy/web_server.rb +++ b/lib/oauth2/strategy/web_server.rb @@ -13,7 +13,14 @@ # endpoints. def get_access_token(code, options = {}) response = @client.request(:post, @client.access_token_url, access_token_params(code, options)) - params = MultiJson.decode(response) rescue Rack::Utils.parse_query(response) + + params = MultiJson.decode(response) rescue nil + # the ActiveSupport JSON parser won't cause an exception when + # given a formencoded string, so make sure that it was + # actually parsed in an Hash. This covers even the case where + # it caused an exception since it'll still be nil. + params = Rack::Utils.parse_query(response) unless params.is_a? Hash + access = params['access_token'] refresh = params['refresh_token'] expires_in = params['expires_in']
Fix parsing of the access_token response with ActiveRecord::JSON. The JSON parser that is provided by ActiveRecord will not report an exception, causing the string not to be parsed; this in turn will cause a ripple-effect through the code (and indeed specs will fail). With this change, the params value is guaranteed to be an Hash, and thus work as intended.
diff --git a/recipes/agent_windows.rb b/recipes/agent_windows.rb index abc1234..def5678 100644 --- a/recipes/agent_windows.rb +++ b/recipes/agent_windows.rb @@ -9,7 +9,7 @@ download_url = node['go']['agent']['download_url'] if !download_url major_ver = node['go']['version'].split('-', 2).first - download_url = "http://download01.thoughtworks.com/go/#{major_ver}/ga/go-agent-#{node['go']['version']}-setup.exe" + download_url = "http://download.go.cd/gocd/go-agent-#{node['go']['version']}-setup.exe" end windows_package 'Go Agent' do
Fix download_url for windows agent installation The download URL for the windows agent installer is using a different URL pattern than is currently in use on the thoughtworks website. This change updates to use the current pattern. The URL for the server install seems to be fine.
diff --git a/mubi.rb b/mubi.rb index abc1234..def5678 100644 --- a/mubi.rb +++ b/mubi.rb @@ -12,7 +12,7 @@ end def get_runtime_for_movie(movie_id) - doc = Nokogiri::HTML RestClient.get "https://mubi.com/films/#{id}" + doc = Nokogiri::HTML RestClient.get "https://mubi.com/films/#{movie_id}" doc.css('.film-show__film-meta').text.strip.to_i end @@ -24,8 +24,4 @@ puts i + 1 get_runtime_for_movie movie['film_id'] end - - require 'pry'; binding.pry end - -calculate_total_runtime
Add method for calculating total runtime
diff --git a/app/models/ability.rb b/app/models/ability.rb index abc1234..def5678 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -0,0 +1,32 @@+class Ability + include CanCan::Ability + + def initialize(user) + # Define abilities for the passed in user here. For example: + # + # user ||= User.new # guest user (not logged in) + # if user.admin? + # can :manage, :all + # else + # can :read, :all + # end + # + # The first argument to `can` is the action you are giving the user + # permission to do. + # If you pass :manage it will apply to every action. Other common actions + # here are :read, :create, :update and :destroy. + # + # The second argument is the resource the user can perform the action on. + # If you pass :all it will apply to every resource. Otherwise pass a Ruby + # class of the resource. + # + # The third argument is an optional hash of conditions to further filter the + # objects. + # For example, here the user can only update published articles. + # + # can :update, Article, :published => true + # + # See the wiki for details: + # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities + end +end
Use the cancancan gem to restricts what resources a given user is allowed to access.
diff --git a/Casks/zip-cleaner.rb b/Casks/zip-cleaner.rb index abc1234..def5678 100644 --- a/Casks/zip-cleaner.rb +++ b/Casks/zip-cleaner.rb @@ -1,7 +1,7 @@ class ZipCleaner < Cask url 'http://roger-jolly.nl/software/downloads/zipcleaner/ZipCleaner.zip' homepage 'http://roger-jolly.nl/software/#zipcleaner' - version '1.0' - sha1 'cd182d7464bbefec6695647258fd69d38e4a2211' + version 'latest' + no_checksum link 'ZipCleaner.app' end
Use `latest` version scheme per @NanoXD’s feedback
diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb index abc1234..def5678 100644 --- a/Library/Homebrew/build_environment.rb +++ b/Library/Homebrew/build_environment.rb @@ -28,8 +28,16 @@ receiver.instance_eval(&proc) end + def marshal_dump + @settings + end + + def marshal_load(data) + @settings = data + end + def _dump(*) - Marshal.dump(@settings) + Marshal.dump(marshal_dump) end def self._load(s)
Define 1.8 marshal hooks in terms of 1.9+ marshal hooks
diff --git a/NFJTableViewSectionController.podspec b/NFJTableViewSectionController.podspec index abc1234..def5678 100644 --- a/NFJTableViewSectionController.podspec +++ b/NFJTableViewSectionController.podspec @@ -1,14 +1,14 @@ Pod::Spec.new do |s| s.name = 'NFJTableViewSectionController' s.version = '1.0.0' - s.license = :type => 'MIT' + s.license = { :type => 'MIT' } s.homepage = 'https://github.com/naokif/NFJTableViewSectionController' - s.authors = 'Naoki Fujii' => 'dev@nfujii.com' + s.authors = { 'Naoki Fujii' => 'dev@nfujii.com' } # Source Info s.platform = :ios, '7.0' - s.source = :git => 'https://github.com/naokif/NFJTableViewSectionController.git', -:tag => 'v1.0.0' + s.source = { :git => 'https://github.com/naokif/NFJTableViewSectionController.git', +:tag => 'v1.0.0' } s.source_files = 'NFJTableViewSectionController/*.{h,m}' s.requires_arc = true -end+end
Fix a SyntaxError of PodSpec
diff --git a/examples/manual_entry_definition.rb b/examples/manual_entry_definition.rb index abc1234..def5678 100644 --- a/examples/manual_entry_definition.rb +++ b/examples/manual_entry_definition.rb @@ -0,0 +1,14 @@+#!/usr/bin/env ruby -rubygems + +require File.join(File.dirname(__FILE__), 'authentication') + +# define the class that's used for Collection with entry_type "Restaurant" +class Restaurant < StorageRoom::Entry + key :name + key :body + key :rating + + one :location # A LocationField, any embedded Resource or a To-One Association + + many :tags # ArrayField, or a To-Many Association +end
Add manual entry definition example
diff --git a/uchiwa.gemspec b/uchiwa.gemspec index abc1234..def5678 100644 --- a/uchiwa.gemspec +++ b/uchiwa.gemspec @@ -21,6 +21,7 @@ spec.require_paths = ['lib'] spec.add_development_dependency 'bundler', '~> 1.7' + spec.add_development_dependency 'pry' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rubocop' end
Add pry as development dependency
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,6 +1,10 @@ module ApplicationHelper def poster_url(movie, size: 'w342') - "#{configuration.base_url}#{size}#{movie.poster_path}" + if movie.poster_path + "#{configuration.base_url}#{size}#{movie.poster_path}" + else + "http://dummyimage.com/342x513/d9d9d9/000000.png&text=N/A" + end end def youtube_url(source)
Add placeholder for missing images
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,18 @@ module ApplicationHelper + # Define a correct base URL. + # + # To ease the transition between environments, this helper detects if it is on + # a developent box and adjusts the URL's accordingly. + # + # Returns a string of the domain. + def site_url + if ENV['RACK_ENV'] == 'development' + request.protocol + request.host + ':' + request.port.to_s + else + request.protocol + 'rehttp.com' + end + end + # Build the correct site title. # # This helps keep a consistent look across all the site by setting a standard
Add helper to get correct base URL
diff --git a/ruby-sun-times.gemspec b/ruby-sun-times.gemspec index abc1234..def5678 100644 --- a/ruby-sun-times.gemspec +++ b/ruby-sun-times.gemspec @@ -3,20 +3,20 @@ require 'sun_times/version' -Gem::Specification.new do |s| - s.name = 'ruby-sun-times' - s.summary = 'Calculate sunrise and sunset times for a given time and place' - s.version = SunTimes::VERSION::STRING +Gem::Specification.new do |spec| + spec.name = 'ruby-sun-times' + spec.summary = 'Calculate sunrise and sunset times for a given time and place' + spec.version = SunTimes::VERSION::STRING - s.homepage = 'https://github.com/joeyates/ruby-sun-times' - s.author = 'Joe Yates' - s.email = 'joe.g.yates@gmail.com' + spec.homepage = 'https://github.com/joeyates/ruby-sun-times' + spec.author = 'Joe Yates' + spec.email = 'joe.g.yates@gmail.com' - s.files = `git ls-files -z`.split("\0") - s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) } - s.test_files = s.files.grep(%r{^spec/}) - s.require_paths = ['lib'] + spec.files = `git ls-files -z`.split("\0") + spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + spec.test_files = spec.files.grep(%r{^spec/}) + spec.require_paths = ['lib'] - s.add_development_dependency 'pry' - s.add_development_dependency 'rspec' + spec.add_development_dependency 'pry' + spec.add_development_dependency 'rspec' end
Use a more descriptive variable name
diff --git a/app/models/ability.rb b/app/models/ability.rb index abc1234..def5678 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -12,6 +12,7 @@ if JUMU_ROUND == 1 can :create, Performance # TODO: Check that user has access to selected competition can :manage, Performance, competition: { host_id: user.host_ids } + can :read, Participant # TODO: Should allow only "own" participants else # Authorize to read and list performances that advanced from own competition can [:read, :list_current], Performance, Performance.advanced_from_competition(user.competitions) do |p|
Allow read access to all participants, limiting to own competitions doesn't seem to work
diff --git a/app/models/edition.rb b/app/models/edition.rb index abc1234..def5678 100644 --- a/app/models/edition.rb +++ b/app/models/edition.rb @@ -10,7 +10,7 @@ field :title, :type => String field :created_at, :type => DateTime, :default => lambda { Time.now } - accepts_nested_attributes_for :parts + accepts_nested_attributes_for :parts, :allow_destroy => true, :reject_if => :all_blank def build_clone new_edition = self.guide.build_edition(self.title)
Update accepting of nested attributes to allow us to remove parts
diff --git a/govuk_frontend_toolkit.gemspec b/govuk_frontend_toolkit.gemspec index abc1234..def5678 100644 --- a/govuk_frontend_toolkit.gemspec +++ b/govuk_frontend_toolkit.gemspec @@ -11,6 +11,7 @@ s.homepage = 'https://github.com/alphagov/govuk_frontend_toolkit' s.add_dependency "rails", ">= 3.1.0" + s.add_dependency "sass", ">= 3.2.0" s.add_development_dependency "gem_publisher", "~> 1.1.1" s.add_development_dependency "rake", "0.9.2.2" s.add_development_dependency "gemfury", "0.4.8"
Add sass 3.2 as a dependency
diff --git a/bookyt_salary.gemspec b/bookyt_salary.gemspec index abc1234..def5678 100644 --- a/bookyt_salary.gemspec +++ b/bookyt_salary.gemspec @@ -12,7 +12,7 @@ s.summary = "Salary plugin for bookyt" s.description = "This plugin extends bookyt with Salary functionality." - s.files = `git ls-files app lib config`.split("\n") + s.files = `git ls-files app lib config db`.split("\n") s.platform = Gem::Platform::RUBY s.require_path = 'lib' end
Include db directory in gem.
diff --git a/webtail.gemspec b/webtail.gemspec index abc1234..def5678 100644 --- a/webtail.gemspec +++ b/webtail.gemspec @@ -18,6 +18,6 @@ gem.add_dependency "eventmachine" gem.add_dependency "em-websocket" gem.add_dependency "sinatra" - gem.add_dependency "slop" + gem.add_dependency "slop", "~> 3.6" gem.add_dependency "launchy", ">= 2.0.6" end
Fix slop version to 3.6
diff --git a/html-pipeline.gemspec b/html-pipeline.gemspec index abc1234..def5678 100644 --- a/html-pipeline.gemspec +++ b/html-pipeline.gemspec @@ -15,8 +15,8 @@ gem.test_files = gem.files.grep(%r{^test}) gem.require_paths = ["lib"] - gem.add_dependency "nokogiri", RUBY_VERSION < "1.9.2" ? [">= 1.4", "< 1.6"] : "~> 1.4" - gem.add_dependency "activesupport", RUBY_VERSION < "1.9.3" ? [">= 2", "< 4"] : ">= 2" + gem.add_dependency "nokogiri", "~> 1.4" + gem.add_dependency "activesupport", ">= 2" gem.post_install_message = <<msg -------------------------------------------------
Remove RUBY_VERSION conditionals from gemspec Remove the useless conditionals added in ae1f3c828cccd2b5ebf0678ea3edc2bcca10c9f3 since gemspec is turned into a static one at gem publish time, so the version constraints will be adjusted to whatever Ruby version the gem was *published* with, not the one that will eventually run the gem. If someone is still running Ruby 1.8 or 1.9.2, it's their responsibility to adjust their project's Gemfile to prevent Nokogiri or Active Support upgrading to an incompatible version.
diff --git a/filewatcher.gemspec b/filewatcher.gemspec index abc1234..def5678 100644 --- a/filewatcher.gemspec +++ b/filewatcher.gemspec @@ -25,5 +25,5 @@ s.add_development_dependency 'rspec', '~> 3.8' s.add_development_dependency 'rubocop', '~> 1.3.0' s.add_development_dependency 'rubocop-performance', '~> 1.5' - s.add_development_dependency 'rubocop-rspec', '~> 1.43' + s.add_development_dependency 'rubocop-rspec', '~> 2.0' end
Update `rubocop-rspec` to compatible with RuboCop 1.0 version
diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb index abc1234..def5678 100644 --- a/config/initializers/i18n.rb +++ b/config/initializers/i18n.rb @@ -1,5 +1,9 @@ I18n.backend.class.send(:include, I18n::Backend::Fallbacks) I18n.fallbacks.map('ru' => 'en') +I18n.fallbacks.map('nl' => 'en') +I18n.fallbacks.map('sw' => 'en') +I18n.fallbacks.map('el' => 'en') +I18n.fallbacks.map('ro' => 'en') module I18n def self.with_locale(locale, &block)
Add more fallback rules (becuse for some reason the fallbacks defaulted to russia, even though it was not the default_locale)
diff --git a/lib/core_ext/hash/require_keys.rb b/lib/core_ext/hash/require_keys.rb index abc1234..def5678 100644 --- a/lib/core_ext/hash/require_keys.rb +++ b/lib/core_ext/hash/require_keys.rb @@ -1,8 +1,5 @@ class Hash def require_keys(*valid_keys) - unknown_keys = keys - [valid_keys].flatten - raise(ArgumentError, "Unknown key(s): #{unknown_keys.join(", ")}") unless unknown_keys.empty? - missing_keys = [valid_keys].flatten - keys raise(ArgumentError, "Missing some required keys: #{missing_keys.join(", ")}") unless missing_keys.empty? end
Allow keys in hash that aren't required.
diff --git a/wright.gemspec b/wright.gemspec index abc1234..def5678 100644 --- a/wright.gemspec +++ b/wright.gemspec @@ -14,8 +14,8 @@ gem.require_paths = ['lib'] gem.version = Wright::VERSION - gem.add_development_dependency 'simplecov' - gem.add_development_dependency 'rdoc' - gem.add_development_dependency 'rake' - gem.add_development_dependency 'fakefs', '~> 0.4.2' + gem.add_development_dependency 'simplecov', '~> 0.7.1' + gem.add_development_dependency 'rdoc', '~> 4.1.1' + gem.add_development_dependency 'rake', '~> 10.2.2' + gem.add_development_dependency 'fakefs', '~> 0.5.2' end
Add gem versions to Gemfile
diff --git a/bundler-patch.gemspec b/bundler-patch.gemspec index abc1234..def5678 100644 --- a/bundler-patch.gemspec +++ b/bundler-patch.gemspec @@ -19,7 +19,7 @@ spec.executables = ['bundler-patch'] spec.require_paths = ['lib'] - spec.add_dependency 'bundler-advise', '~> 1.1', '>= 1.1.2' + spec.add_dependency 'bundler-advise', '~> 1.1', '>= 1.1.5' spec.add_dependency 'slop', '~> 3.0' spec.add_dependency 'bundler', '~> 1.7'
Use bundle-advise 1.1.5 to obey BUNDLE_GEMFILE Updates travis matrix as well.
diff --git a/rack-protection/spec/frame_options_spec.rb b/rack-protection/spec/frame_options_spec.rb index abc1234..def5678 100644 --- a/rack-protection/spec/frame_options_spec.rb +++ b/rack-protection/spec/frame_options_spec.rb @@ -3,7 +3,7 @@ describe Rack::Protection::FrameOptions do it_behaves_like "any rack application" - it 'should set the X-XSS-Protection' do + it 'should set the X-Frame-Options' do get('/').headers["X-Frame-Options"].should == "sameorigin" end
Fix typo in FrameOptions example description
diff --git a/simple_display.gemspec b/simple_display.gemspec index abc1234..def5678 100644 --- a/simple_display.gemspec +++ b/simple_display.gemspec @@ -8,9 +8,9 @@ spec.version = SimpleDisplay::VERSION spec.authors = ["Marc Riera"] spec.email = ["mrc2407@gmail.com"] - spec.description = %q{Write a gem description} - spec.summary = %q{Write a gem summary} - spec.homepage = "" + spec.description = %q{Display your Rails models easily} + spec.summary = %q{Display your Rails models easily} + spec.homepage = "https://github.com/mrcasals/simple_display" spec.license = "MIT" spec.files = `git ls-files`.split($/)
Add missing data in gemspec
diff --git a/app/models/game.rb b/app/models/game.rb index abc1234..def5678 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -6,19 +6,19 @@ # takes in an array of clues # if there are less than 25 clues - def generate_board(clues) + def generate_board(board_size, clues) clues.shuffle! - if clues.length == 25 + if clues.length == board_size return clues else - if clues.length > 25 - return clues[0...25] + if clues.length > board_size + return clues[0...board_size] else - remaining = 25 % clues.length + remaining = board_size % clues.length if remaining == 0 - generate_board(clues * 25.div(clues.length)) + generate_board(board_size, clues * board_size.div(clues.length)) else - generate_board(clues + clues[0...remaining]) + generate_board(board_size, clues + clues[0...remaining]) end end end
Add board_size to the parameters for generate_baord
diff --git a/SMCalloutView.podspec b/SMCalloutView.podspec index abc1234..def5678 100644 --- a/SMCalloutView.podspec +++ b/SMCalloutView.podspec @@ -10,7 +10,7 @@ s.homepage = "https://github.com/nfarina/calloutview" s.license = 'Apache License, Version 2.0' s.author = { "Nick Farina" => "nfarina@gmail.com" } - s.source = { :git => "https://github.com/nfarina/calloutview.git", :tag => "1.0.1" } + s.source = { :git => "https://github.com/nfarina/calloutview.git", :tag => "1.1" } s.platform = :ios s.source_files = 'SMCalloutView.{h,m}' s.requires_arc = true
Update podspec in preparation for 1.1 release
diff --git a/SVProgressHUD.podspec b/SVProgressHUD.podspec index abc1234..def5678 100644 --- a/SVProgressHUD.podspec +++ b/SVProgressHUD.podspec @@ -14,4 +14,5 @@ s.preserve_paths = 'Demo' s.framework = 'QuartzCore' s.resources = 'SVProgressHUD/SVProgressHUD.bundle' + s.requires_arc = true end
Set podspec's requires_arc to true.
diff --git a/config/environments/production.rb b/config/environments/production.rb index abc1234..def5678 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,5 @@ uncomment_lines "config/environments/production.rb", /config\.force_ssl = true/ +gsub_file "config/environments/production.rb", /\bSTDOUT\b/, "$stdout" gsub_file "config/environments/production.rb", "config.force_ssl = true", 'config.force_ssl = ENV["RAILS_FORCE_SSL"].present?'
Fix RuboCop rule violation for STDOUT
diff --git a/config/software/oc-chef-pedant.rb b/config/software/oc-chef-pedant.rb index abc1234..def5678 100644 --- a/config/software/oc-chef-pedant.rb +++ b/config/software/oc-chef-pedant.rb @@ -16,7 +16,7 @@ name "oc-chef-pedant" -default_version "1.0.73" +default_version "1.0.74" source git: "git@github.com:opscode/oc-chef-pedant.git"
Update oc pedant to 1.0.74
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -18,6 +18,6 @@ # default['lvm']['chef-ruby-lvm']['version'] = '0.4.0' -default['lvm']['chef-ruby-lvm-attrib']['version'] = '0.2.3' +default['lvm']['chef-ruby-lvm-attrib']['version'] = '0.2.5' default['lvm']['cleanup_old_gems'] = true default['lvm']['rubysource'] = 'https://rubygems.org'
Update the attributes gem version from 0.2.3 to 0.2.5 Supports RHEL 7.6
diff --git a/spec/ar_spec_helper.rb b/spec/ar_spec_helper.rb index abc1234..def5678 100644 --- a/spec/ar_spec_helper.rb +++ b/spec/ar_spec_helper.rb @@ -12,7 +12,11 @@ end class Tag < ActiveRecord::Base - has_and_belongs_to_many :albums, :order=>'id DESC' + if ActiveRecord.respond_to?(:version) # Rails 4+ + has_and_belongs_to_many :albums, proc{order('id DESC')} + else + has_and_belongs_to_many :albums, :order=>'id DESC' + end end class SelfRef < ActiveRecord::Base
Make specs run on Rails 3 and Rails 4 (no code changes)