diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/tapjoy/autoscaling_bootstrap/version.rb b/lib/tapjoy/autoscaling_bootstrap/version.rb index abc1234..def5678 100644 --- a/lib/tapjoy/autoscaling_bootstrap/version.rb +++ b/lib/tapjoy/autoscaling_bootstrap/version.rb @@ -2,8 +2,8 @@ module AutoscalingBootstrap module Version MAJOR = 0 - MINOR = 1 - PATCH = 3 + MINOR = 2 + PATCH = 0 end VERSION = [Version::MAJOR, Version::MINOR, Version::PATCH].join('.')
Use specified launch configuration name to feed updated config name
diff --git a/app/controllers/nested_resource_controller.rb b/app/controllers/nested_resource_controller.rb index abc1234..def5678 100644 --- a/app/controllers/nested_resource_controller.rb +++ b/app/controllers/nested_resource_controller.rb @@ -10,16 +10,17 @@ # controllers which are aliased (eg asset => inventory) get the wrong controller name # so we have to deal with those def get_resource_url(resource) - puts resource.inspect + #puts resource.inspect controller_name = resource.class.name.underscore + #puts controller_name if controller_name == 'asset' controller_name = 'inventory' eval("#{controller_name}_url('#{resource.object_key}')") elsif controller_name == 'activity_line_item' - controller_name = "capital_project_activity_line_item" - eval("#{controller_name}_url('[#{resource.capital_project.object_key},#{resource.object_key}]')") + capital_project_activity_line_item_path(resource.capital_project, resource) + else + eval("#{controller_name}_url('#{resource.object_key}')") end - eval("#{controller_name}_url('#{resource.object_key}')") end # Get the class and object key of the commentable object we are operating on. There is a special
Fix nested resource controller for activity line item comments
diff --git a/test/jenkins_sample_test.rb b/test/jenkins_sample_test.rb index abc1234..def5678 100644 --- a/test/jenkins_sample_test.rb +++ b/test/jenkins_sample_test.rb @@ -6,10 +6,15 @@ class JenkinsSampleTest < MiniTest::Unit::TestCase def setup - @webpage = Net::HTTP.get(URI("http://#{ENV['TEST_IP_ADDRESS']}:8000/index.html")) + uri_params = { + :host => ENV['TEST_IP_ADDRESS'] || 'localhost', + :port => (ENV['TEST_PORT'] || '80').to_i, + :path => '/index.html' + } + @webpage = Net::HTTP.get(URI::HTTP.build(uri_params)) end def test_congratulations - assert(@webpage =~ /Congratulations!/) + assert(@webpage =~ /Congratulations/) end -end+end
Change default test port to 80 The test port can be configured with the env variable TEST_PORT.
diff --git a/dashboard/test/ui/step_definitions/eyes_steps.rb b/dashboard/test/ui/step_definitions/eyes_steps.rb index abc1234..def5678 100644 --- a/dashboard/test/ui/step_definitions/eyes_steps.rb +++ b/dashboard/test/ui/step_definitions/eyes_steps.rb @@ -19,4 +19,7 @@ return if @eyes @eyes = Applitools::Eyes.new @eyes.api_key = CDO.applitools_eyes_api_key + # Force eyes to use a consistent host OS identifier for now + # BrowserStack was reporting 6.0 and 6.1, causing different baselines + @eyes.host_os = 'Windows 6x' end
Fix "Windows 6.0" vs "Windows 6.1" alternating baselines in eyes tests
diff --git a/db/migrate/20120308121120_create_default_blog.rb b/db/migrate/20120308121120_create_default_blog.rb index abc1234..def5678 100644 --- a/db/migrate/20120308121120_create_default_blog.rb +++ b/db/migrate/20120308121120_create_default_blog.rb @@ -1,7 +1,7 @@ class CreateDefaultBlog < ActiveRecord::Migration def self.up - @blog = Spree::Blog.create(:name => "Blog", :permalink => "blog") - Spree::Post.update_all(:blog_id => @blog.id) + @blog = Spree::Blog.create(name: "Blog", permalink: "blog") + Spree::Post.update_all(blog_id: @blog.id) end def self.down
Fix reg expression to use spree enabled attributes Signed-off-by: Nathan Lowrie <4f3407de78bccc8cc160ee4d278d5efe7162e6b5@finelineautomation.com>
diff --git a/routes/player_counts.rb b/routes/player_counts.rb index abc1234..def5678 100644 --- a/routes/player_counts.rb +++ b/routes/player_counts.rb @@ -12,6 +12,7 @@ app.get '/player_counts.json' do content_type :json + # Query for the historical data keys = redis.keys("pc:mean:*").sort result = {} @@ -26,6 +27,17 @@ result[server][date] = redis.get(key) end + # Grab the latest counts from the raw data + servers = %w[Darktide Frostfell Harvestgain Leafcull Morningthaw Thistledown Solclaim Verdantine WintersEbb] + today = Time.now.utc.strftime("%Y%m%d") + + servers.each do |server| + next unless result.has_key?(server.downcase) + + latest = PlayerCount.where(server: server).desc(:created_at).limit(1) + result[server.downcase][today] = latest.to_a.first['c'] + end + result.to_json end end
Add latest pop counts to player count chart
diff --git a/Security/caesar_cipher/spec/caesar_cipher_spec.rb b/Security/caesar_cipher/spec/caesar_cipher_spec.rb index abc1234..def5678 100644 --- a/Security/caesar_cipher/spec/caesar_cipher_spec.rb +++ b/Security/caesar_cipher/spec/caesar_cipher_spec.rb @@ -1,11 +1,24 @@ require 'spec_helper' describe CaesarCipher do - it 'has a version number' do - expect(CaesarCipher::VERSION).not_to be nil + + describe 'offset_letter' do + + it "should return an offset alphabet character given the original and the offset" do + letter_offset_hash = { + 0 => { "A" => "A", "B" => "B", "J" => "J", "R" => "R", "Z" => "Z" }, + 1 => { "A" => "B", "B" => "C", "J" => "K", "R" => "S", "Z" => "A" }, + 2 => { "A" => "C", "B" => "D", "J" => "L", "R" => "T", "Z" => "B" }, + 5 => { "A" => "F", "B" => "G", "J" => "O", "R" => "W", "Z" => "E" }, + 25 => { "A" => "Z", "B" => "A", "J" => "I", "R" => "Q", "Z" => "Y" } + } + letter_offset_hash.each do |offset,letter_hash| + letter_hash.each do |letter,offset_letter| + CaesarCipher.offset_letter(letter,offset).should eq(offset_letter) + end + end + end + end - it 'does something useful' do - expect(false).to eq(true) - end end
Add a spec for the offset_letter method.
diff --git a/bronto.gemspec b/bronto.gemspec index abc1234..def5678 100644 --- a/bronto.gemspec +++ b/bronto.gemspec @@ -20,4 +20,7 @@ gem.add_development_dependency "debugger" gem.add_development_dependency "turn" gem.add_development_dependency "shoulda" + + s.homepage = "https://github.com/martingordon/bronto-ruby" + s.license = "MIT" end
Add homepage and license to gemspec.
diff --git a/Casks/beatport-pro.rb b/Casks/beatport-pro.rb index abc1234..def5678 100644 --- a/Casks/beatport-pro.rb +++ b/Casks/beatport-pro.rb @@ -1,6 +1,6 @@ cask :v1 => 'beatport-pro' do - version '2.1.4_150' - sha256 'b7e6e330d77d242a30783141aad8c9a9a9f9d1e67da3afe4cb8daefa6e5545d2' + version '2.1.6_155' + sha256 '21581878a33921082167ba4eaddf031edf5c0b30b36928412c844d8c7572cf63' url "http://pro.beatport.com/mac/#{version}/beatportpro_#{version}.dmg" name 'Beatport'
Upgrade Beatport Pro.app to v2.1.6_155
diff --git a/brite_verify.gemspec b/brite_verify.gemspec index abc1234..def5678 100644 --- a/brite_verify.gemspec +++ b/brite_verify.gemspec @@ -8,8 +8,8 @@ gem.version = BriteVerify::VERSION gem.authors = ["Simon Schoeters"] gem.email = ["hamfilter@gmail.com"] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} + gem.description = %q{Ruby interface for BriteVerify's paying e-mail validation service.} + gem.summary = %q{BriteVerify is a paying e-mail validation service. You pass it an e-mail address and it tells you if the e-mail address is real or not. They offer a typical REST like API. This gem wraps the API in a more Ruby friendly syntax.} gem.homepage = "" gem.files = `git ls-files`.split($/)
Add summary and description to gemspec
diff --git a/omniauth.gemspec b/omniauth.gemspec index abc1234..def5678 100644 --- a/omniauth.gemspec +++ b/omniauth.gemspec @@ -11,7 +11,7 @@ spec.cert_chain = %w(certs/sferik.pem) spec.description = %q{A generalized Rack framework for multiple-provider authentication.} spec.email = ['michael@intridea.com', 'sferik@gmail.com'] - spec.files = `git ls-files`.split($/) + spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) spec.homepage = 'http://github.com/intridea/omniauth' spec.licenses = ['MIT'] spec.name = 'omniauth' @@ -19,6 +19,6 @@ spec.required_rubygems_version = '>= 1.3.5' spec.signing_key = File.expand_path('~/.gem/private_key.pem') if $PROGRAM_NAME =~ /gem\z/ spec.summary = spec.description - spec.test_files = spec.files.grep(%r{^spec/}) + spec.test_files = spec.files.grep(/^spec\//) spec.version = OmniAuth::VERSION end
Fix RuboCop violations in gemspec
diff --git a/mongomodel.gemspec b/mongomodel.gemspec index abc1234..def5678 100644 --- a/mongomodel.gemspec +++ b/mongomodel.gemspec @@ -5,6 +5,7 @@ s.name = "mongomodel" s.version = MongoModel::VERSION s.platform = Gem::Platform::RUBY + s.licenses = ["MIT"] s.authors = ["Sam Pohlenz"] s.email = ["sam@sampohlenz.com"] s.homepage = "http://www.mongomodel.org"
Add MIT license to gemspec
diff --git a/Library/Homebrew/requirements/x11_dependency.rb b/Library/Homebrew/requirements/x11_dependency.rb index abc1234..def5678 100644 --- a/Library/Homebrew/requirements/x11_dependency.rb +++ b/Library/Homebrew/requirements/x11_dependency.rb @@ -38,4 +38,8 @@ def eql?(other) super && min_version == other.min_version end + + def inspect + "#<#{self.class.name}: #{name.inspect} #{tags.inspect} min_version=#{min_version}>" + end end
Add min_version to X11Dependency inspect string
diff --git a/google_analytics.gemspec b/google_analytics.gemspec index abc1234..def5678 100644 --- a/google_analytics.gemspec +++ b/google_analytics.gemspec @@ -22,7 +22,7 @@ test/view_helpers_test.rb lib/rubaidh/google_analytics.rb lib/rubaidh/view_helpers.rb - task/google_analytics.rake) + tasks/google_analytics.rake) s.add_dependency 'actionpack' end
Fix up a typo in the manifest.
diff --git a/lib/email_prefixer/interceptor.rb b/lib/email_prefixer/interceptor.rb index abc1234..def5678 100644 --- a/lib/email_prefixer/interceptor.rb +++ b/lib/email_prefixer/interceptor.rb @@ -1,7 +1,12 @@-require 'active_support/core_ext/module/delegation' - module EmailPrefixer class Interceptor + extend Forwardable + def_delegators :@configuration, :application_name, :stage_name + + def initialize + @configuration = EmailPrefixer.configuration + end + def delivering_email(mail) mail.subject.prepend(subject_prefix) end @@ -9,16 +14,10 @@ private - delegate :application_name, :stage_name, to: :configuration - - def configuration - EmailPrefixer.configuration - end - def subject_prefix prefixes = [] prefixes << application_name - prefixes << stage_name.upcase unless stage_name == "production" + prefixes << stage_name.upcase unless stage_name == 'production' "[#{prefixes.join(' ')}] " end end
Use core Forwardable instead of active support extension
diff --git a/lib/instana/frameworks/sinatra.rb b/lib/instana/frameworks/sinatra.rb index abc1234..def5678 100644 --- a/lib/instana/frameworks/sinatra.rb +++ b/lib/instana/frameworks/sinatra.rb @@ -0,0 +1,9 @@+require "instana/rack" + +# This instrumentation will insert Rack into Sinatra _and_ Padrino since +# the latter is based on Sinatra + +if defined?(::Sinatra) + ::Instana.logger.warn "Instana: Instrumenting Sinatra" + ::Sinatra::Base.use ::Instana::Rack +end
Add Rack support for Sinatra & Padrino
diff --git a/_plugins/asset_img_size.rb b/_plugins/asset_img_size.rb index abc1234..def5678 100644 --- a/_plugins/asset_img_size.rb +++ b/_plugins/asset_img_size.rb @@ -8,6 +8,7 @@ file = file.to_s.split('x') file.map! { |i| if i == '' then '100%' else i + 'px' end } if file.size < 2 then file.push('100%') end + return file else nil end
Fix return point issue when widthx syntax
diff --git a/spec/lazily/concatenating_spec.rb b/spec/lazily/concatenating_spec.rb index abc1234..def5678 100644 --- a/spec/lazily/concatenating_spec.rb +++ b/spec/lazily/concatenating_spec.rb @@ -3,9 +3,6 @@ describe Lazily, "concatenating" do describe ".concat" do - - let(:array1) { [1,5,3] } - let(:array2) { [2,9,4] } it "concatenates multiple Enumerables" do result = Lazily.concat([1,5,3], [2,9,4]) @@ -21,9 +18,6 @@ describe "#concat" do - let(:array1) { [1,5,3] } - let(:array2) { [2,9,4] } - it "concatenates multiple Enumerables" do result = [1,5,3].lazily.concat([2,9,4]) result.to_a.should == [1,5,3,2,9,4]
Remove redundant stuff from specs.
diff --git a/bugsnag.gemspec b/bugsnag.gemspec index abc1234..def5678 100644 --- a/bugsnag.gemspec +++ b/bugsnag.gemspec @@ -10,7 +10,7 @@ s.homepage = "https://github.com/bugsnag/bugsnag-ruby" s.licenses = ["MIT"] - s.files = `git ls-files -z lib`.split("\x0") + s.files = `git ls-files -z lib bugsnag.gemspec VERSION`.split("\x0") s.extra_rdoc_files = [ "LICENSE.txt", "README.md",
Include gemspec and VERSION files These are needed to be able to install the Gem from the built gemfile
diff --git a/app/models/chat_message.rb b/app/models/chat_message.rb index abc1234..def5678 100644 --- a/app/models/chat_message.rb +++ b/app/models/chat_message.rb @@ -1,4 +1,10 @@ class ChatMessage < ActiveRecord::Base belongs_to :chat belongs_to :user + + acts_as_ferret({ :fields => { 'chat_id' => {}, + 'body' => { :boost => 1.5 } + }, :remote => true + }) + end
Add ferret index to instant messages
diff --git a/integration-tests/spec-domain/basic_rack_spec.rb b/integration-tests/spec-domain/basic_rack_spec.rb index abc1234..def5678 100644 --- a/integration-tests/spec-domain/basic_rack_spec.rb +++ b/integration-tests/spec-domain/basic_rack_spec.rb @@ -3,7 +3,7 @@ shared_examples_for "basic rack" do before(:each) do - visit "/basic-rack" + visit context page.should have_content('it worked') end @@ -29,12 +29,13 @@ root: #{File.dirname(__FILE__)}/../apps/rack/basic env: development web: - context: /basic-rack + context: /basic-rack-with-heredoc ruby: version: #{RUBY_VERSION[0,3]} END + let(:context) { '/basic-rack-with-heredoc' } it_should_behave_like "basic rack" end @@ -42,10 +43,11 @@ describe "basic rack test with hash" do deploy( :application => { :root => "#{File.dirname(__FILE__)}/../apps/rack/basic", :env => 'development' }, - :web => { :context => '/basic-rack' }, + :web => { :context => '/basic-rack-with-hash' }, :ruby => { :version => RUBY_VERSION[0,3] } ) - + + let(:context) { '/basic-rack-with-hash' } it_should_behave_like "basic rack" end
Change this integ to workaround TORQUE-908 until it gets fixed
diff --git a/app/models/organization.rb b/app/models/organization.rb index abc1234..def5678 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -3,6 +3,7 @@ # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :registerable, + :confirmable # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation, :remember_me
Clean up and end of iteration 3
diff --git a/app/models/user_session.rb b/app/models/user_session.rb index abc1234..def5678 100644 --- a/app/models/user_session.rb +++ b/app/models/user_session.rb @@ -1,18 +1,23 @@ class UserSession < Authlogic::Session::Base - pds_url Settings.login.pds_url - calling_system Settings.login.calling_system + pds_url (ENV['PDS_URL'] || 'https://login.library.nyu.edu') + calling_system 'primo' anonymous false - + def additional_attributes h = {} return h unless pds_user - h[:access_grid_admin] = true if Settings.login.default_admins.include? pds_user.uid + h[:access_grid_admin] = true if default_admins.include? pds_user.uid return h end - + # Hook to determine if we should attempt to establish a PDS session def attempt_sso? (controller.request.format.json?) ? false : super end -end + private + def default_admins + (Figs.env['PRIVILEGES_DEFAULT_ADMINS'] || []) + end + +end
Use the Figs environment variables for the AuthPds settings
diff --git a/lib/travis/logs/helpers/pusher.rb b/lib/travis/logs/helpers/pusher.rb index abc1234..def5678 100644 --- a/lib/travis/logs/helpers/pusher.rb +++ b/lib/travis/logs/helpers/pusher.rb @@ -18,7 +18,7 @@ def pusher_channel_name(payload) channel = '' - channel << 'private-' if Logs.config.pusher.secure + channel << 'private-' if Travis::Logs.config.pusher.secure channel << "job-#{payload['id']}" channel end
Fix namespace on Logs::Config call
diff --git a/lib/validators/phony_validator.rb b/lib/validators/phony_validator.rb index abc1234..def5678 100644 --- a/lib/validators/phony_validator.rb +++ b/lib/validators/phony_validator.rb @@ -6,7 +6,27 @@ # Validates a String using Phony.plausible? method. def validate_each(record, attribute, value) return if value.blank? - record.errors.add(attribute, options[:message] || :improbable_phone) if not Phony.plausible?(value, cc: options[:country_code] || record.country_number || record.country_code) + + @record = record + @record.errors.add(attribute, error_message) if not Phony.plausible?(value, cc: country_code_or_country_number) + end + + private + + def error_message + options[:message] || :improbable_phone + end + + def country_code_or_country_number + options[:country_code] || record_country_number || record_country_code + end + + def record_country_number + @record.country_number if @record.respond_to?(:country_number) + end + + def record_country_code + @record.country_code if @record.respond_to?(:country_code) end end
Check for record's country_code/country_number attributes If they exist, before calling them and finding out the AR record does not respond to them. This fixes phony_validator specs.
diff --git a/config/initializers/exception_notification.rb b/config/initializers/exception_notification.rb index abc1234..def5678 100644 --- a/config/initializers/exception_notification.rb +++ b/config/initializers/exception_notification.rb @@ -2,5 +2,5 @@ Rails.application.config.middleware.use ExceptionNotifier, :email_prefix => "[#{Rails.application.to_s.split('::').first}] ", :sender_address => %{"Winston Smith-Churchill" <winston@alphagov.co.uk>}, - :exception_recipients => %w{govuk-publishing-platform-notifications@digital.cabinet-office.gov.uk} + :exception_recipients => %w{govuk-dev@digital.cabinet-office.gov.uk} end
Revert "Use notification email address" Wrong email address. This reverts commit 3f1622900b95398017aae49d8887cd2d6abb6118.
diff --git a/test/schema.rb b/test/schema.rb index abc1234..def5678 100644 --- a/test/schema.rb +++ b/test/schema.rb @@ -5,6 +5,6 @@ t.integer :right_position t.integer :level end - add_index :tags, :left_position, :unique => true - add_index :tags, :right_position, :unique => true + # add_index :tags, :left_position, :unique => true + # add_index :tags, :right_position, :unique => true end
Remove indexes, they are in conflict with updating positions after some node is destroyed
diff --git a/spec/models/sanity_check_spec.rb b/spec/models/sanity_check_spec.rb index abc1234..def5678 100644 --- a/spec/models/sanity_check_spec.rb +++ b/spec/models/sanity_check_spec.rb @@ -18,7 +18,6 @@ expect(sanity_check.report[:studies].present?).to eq(true) expect(sanity_check.report[:studies][:row_count]).to eq(1) expect(sanity_check.report[:conditions][:row_count]).to eq(6) - expect(sanity_check.report[:expected_outcomes][:row_count]).to eq(5) end it 'should create a sanity check record with the correct column length information' do
Remove expected outcomes from sanity check.
diff --git a/kitchen-tests/cookbooks/base/recipes/packages.rb b/kitchen-tests/cookbooks/base/recipes/packages.rb index abc1234..def5678 100644 --- a/kitchen-tests/cookbooks/base/recipes/packages.rb +++ b/kitchen-tests/cookbooks/base/recipes/packages.rb @@ -7,7 +7,7 @@ # this is just a list of package that exist on every O/S we test, and often aren't installed by default. you don't # have to get too clever here, you can delete packages if they don't exist everywhere we test. -pkgs = %w{lsof tcpdump strace zsh dmidecode ltrace bc curl wget telnet subversion git traceroute htop tmux } +pkgs = %w{lsof tcpdump strace zsh dmidecode ltrace bc curl wget subversion git traceroute htop tmux } # this deliberately calls the multipackage API N times in order to do one package installation in order to exercise the # multipackage cookbook.
Remove telnet for testing as it break opensuse for odd reasons It's not a chef thing. It's an SUSE thing. Reading installed packages... Resolving package dependencies... Problem: conflicting requests Solution 1: remove lock to allow installation of telnet-1.2-170.3.x86_64[openSUSE-Leap-42.3-Oss] Solution 2: remove lock to allow installation of telnet-1.2-170.3.x86_64[openSUSE-Leap-42.3-0] Solution 3: do not ask to install a solvable providing telnet.x86_64 = 1.2-170.3 Choose from above solutions by number or cancel [1/2/3/c] (c): Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/spec/factories/users.rb b/spec/factories/users.rb index abc1234..def5678 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -7,6 +7,7 @@ phone '+49 30 1234567' password 'please' password_confirmation 'please' + origin 'http://localhost:8000' factory :admin do after(:create) do |user|
Add origin to test data.
diff --git a/lib/skink/rack_test_client/rack_test_response.rb b/lib/skink/rack_test_client/rack_test_response.rb index abc1234..def5678 100644 --- a/lib/skink/rack_test_client/rack_test_response.rb +++ b/lib/skink/rack_test_client/rack_test_response.rb @@ -18,7 +18,11 @@ end def headers - native_response.header + if native_response.is_a? Rack::Response + native_response.header + else + native_response.headers + end end def body
Support older MockRequest API (before rack 1.3.0).
diff --git a/tests/test_epmc.rb b/tests/test_epmc.rb index abc1234..def5678 100644 --- a/tests/test_epmc.rb +++ b/tests/test_epmc.rb @@ -1,13 +1,13 @@ require 'minitest/autorun' require 'vcr' -require_relative '../lib/api_caller' +require_relative '../lib/api_handler' require_relative './vcr_setup' class TestEPMC < Minitest::Unit::TestCase PMID = '9855500' - SUCCESSFUL_EPMC_URL = 'http://www.ebi.ac.uk/europepmc/webservices/rest/search/query=9855500&resultType=core' + SUCCESSFUL_EPMC_URL = 'http://www.ebi.ac.uk/europepmc/webservices/rest/search/query=EXT_ID:9855500&resultType=core' def test_url_creation # Are we creating the URLs correctly? url = create_url(PMID, :epmc) @@ -28,4 +28,4 @@ end end -end+end
Update URL in tester to match stricter EXT_ID URL in EPMC
diff --git a/tincan-api.gemspec b/tincan-api.gemspec index abc1234..def5678 100644 --- a/tincan-api.gemspec +++ b/tincan-api.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "tincan-api" - s.version = "1.0.0" + s.version = "1.0.1" s.date = "2014-05-01" s.summary = "Ruby gem for the TinCan Storage API" s.authors = ["Charles Hollenbeck"]
Update gem version for adding in the documentation
diff --git a/NetworkingKit.podspec b/NetworkingKit.podspec index abc1234..def5678 100644 --- a/NetworkingKit.podspec +++ b/NetworkingKit.podspec @@ -2,7 +2,7 @@ s.name = 'NetworkingKit' s.version = '0.0.3' - s.summary = 'A small wrapper around NSURLSession for iOS' + s.summary = 'A small wrapper around NSURLSession for iOS.' s.homepage = 'https://github.com/ccrazy88/networking-kit' s.author = { 'Chrisna Aing' => 'chrisna@chrisna.org' } s.source = { :git => 'https://github.com/ccrazy88/networking-kit.git',
Add period to Pod specification summary.
diff --git a/turkish_id.gemspec b/turkish_id.gemspec index abc1234..def5678 100644 --- a/turkish_id.gemspec +++ b/turkish_id.gemspec @@ -20,7 +20,7 @@ spec.require_paths = ['lib', 'lib/turkish_id'] spec.add_development_dependency 'bundler', '~> 1.10' - spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rake', '~> 12.3' spec.add_development_dependency 'rspec' spec.add_development_dependency 'pry', '~> 0.10.3' end
Update rake requirement to ~> 12.3 Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/commits/v12.3.1) Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/tvheadend_xmltv.rb b/tvheadend_xmltv.rb index abc1234..def5678 100644 --- a/tvheadend_xmltv.rb +++ b/tvheadend_xmltv.rb @@ -4,7 +4,7 @@ require 'rest-client' require_relative 'config.rb' -require_relative 'tvheadend_common' +require_relative 'tvheadend_common.rb' tvheadend_channels_each { |channel| name = channel["name"]
Add file extension for consistency
diff --git a/lib/capistrano/tasks/symfony.rake b/lib/capistrano/tasks/symfony.rake index abc1234..def5678 100644 --- a/lib/capistrano/tasks/symfony.rake +++ b/lib/capistrano/tasks/symfony.rake @@ -30,7 +30,7 @@ on roles :app do within release_path do # TODO: does this need to be configurable? - execute "./vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php" + execute :php, "./vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php" end end end
Add php binary before build_bootstrap.php
diff --git a/lib/arjdbc/derby/connection_methods.rb b/lib/arjdbc/derby/connection_methods.rb index abc1234..def5678 100644 --- a/lib/arjdbc/derby/connection_methods.rb +++ b/lib/arjdbc/derby/connection_methods.rb @@ -6,7 +6,7 @@ config[:driver] ||= "org.apache.derby.jdbc.EmbeddedDriver" conn = embedded_driver(config) md = conn.jdbc_connection.meta_data - if md.database_major_version < 10 || md.database_minor_version < 5 + if md.database_major_version < 10 || (md.database_major_version == 10 && md.database_minor_version < 5) raise ::ActiveRecord::ConnectionFailed, "Derby adapter requires Derby 10.5 or later" end conn
Fix derby db version check
diff --git a/lib/libraetd/app/helpers/url_helper.rb b/lib/libraetd/app/helpers/url_helper.rb index abc1234..def5678 100644 --- a/lib/libraetd/app/helpers/url_helper.rb +++ b/lib/libraetd/app/helpers/url_helper.rb @@ -17,7 +17,7 @@ def orcid_oauth_button redirect = Rails.application.routes.url_helpers.orcid_landing_url orcid_client_id = ENV['ORCID_CLIENT_ID'] - orcid_scopes = ENV['ORCID_SCOPES'] || '/authenticate' + orcid_scopes = ENV['ORCID_SCOPES'] # eventually add ' /activities/update' to scope button_html = link_to "#{ENV['ORCID_BASE_URL']}/oauth/authorize?client_id=#{orcid_client_id}&response_type=code&scope=#{orcid_scopes}&redirect_uri=#{redirect}",
Remove default orcid scope; this is confusing
diff --git a/lib/linux_admin/registration_system.rb b/lib/linux_admin/registration_system.rb index abc1234..def5678 100644 --- a/lib/linux_admin/registration_system.rb +++ b/lib/linux_admin/registration_system.rb @@ -22,10 +22,10 @@ private def self.registration_type_uncached - if SubscriptionManager.new.registered? + if Rhn.new.registered? + Rhn + elsif SubscriptionManager.new.registered? SubscriptionManager - elsif Rhn.new.registered? - Rhn else self end
Check if registered to RHN first to avoid false positives on SM
diff --git a/lib/lolcation_client/configurations.rb b/lib/lolcation_client/configurations.rb index abc1234..def5678 100644 --- a/lib/lolcation_client/configurations.rb +++ b/lib/lolcation_client/configurations.rb @@ -1,5 +1,5 @@ module LolcationClient module Configurations - URL = "http://localhost:3000/api/v1/localizations" + URL = "https://lolcation-service.loldesign.com.br/api/v1/localizations" end end
Update to right service path
diff --git a/lib/neo/rails/presenter/test_helper.rb b/lib/neo/rails/presenter/test_helper.rb index abc1234..def5678 100644 --- a/lib/neo/rails/presenter/test_helper.rb +++ b/lib/neo/rails/presenter/test_helper.rb @@ -19,9 +19,30 @@ include Sprockets::Helpers::RailsHelper include Sprockets::Helpers::IsolatedHelper end + include ::Rails.application.routes.url_helpers attr_accessor :output_buffer, :params, :controller + + # Configure sprockets-rails + if defined?(VIEW_ACCESSORS) # sprockets-rails version >= 3.0 + app = ::Rails.application + assets_config = app.config.assets + + self.debug_assets = assets_config.debug + self.digest_assets = assets_config.digest + self.assets_prefix = assets_config.prefix + self.assets_precompile = assets_config.precompile + self.assets_environment = app.assets + self.assets_manifest = app.assets_manifest + self.resolve_assets_with = assets_config.resolve_with + self.check_precompiled_asset = assets_config.check_precompiled_asset + self.precompiled_asset_checker = -> logical_path { app.asset_precompiled? logical_path } + + if self.respond_to?(:unknown_asset_fallback=) # sprockets-rails version >= 3.2 + self.unknown_asset_fallback = assets_config.unknown_asset_fallback + end + end end end end
Configure sprockets-rails for versions >= 3
diff --git a/lib/rspec/graphql_matchers/matchers.rb b/lib/rspec/graphql_matchers/matchers.rb index abc1234..def5678 100644 --- a/lib/rspec/graphql_matchers/matchers.rb +++ b/lib/rspec/graphql_matchers/matchers.rb @@ -13,6 +13,7 @@ RSpec::GraphqlMatchers::AcceptArguments.new(expected_args) end + # rubocop:disable Style/PredicateName def have_a_field(field_name) RSpec::GraphqlMatchers::HaveAField.new(field_name) end
Disable rubocop checker on predicate methods
diff --git a/lib/iban_utils/iban_validation.rb b/lib/iban_utils/iban_validation.rb index abc1234..def5678 100644 --- a/lib/iban_utils/iban_validation.rb +++ b/lib/iban_utils/iban_validation.rb @@ -1,5 +1,7 @@ class IbanValidation attr_reader :response + + class EmptyIbanError < StandardError; end def initialize(config) @config = config @@ -17,7 +19,7 @@ def validate_and_get_info(iban) # no need to send a validation request for an obviously invalid ibans unless iban && iban.is_a?(String) && !iban.gsub(/\s/, '').empty? - raise "Iban validation failed due to: No iban provided!" + raise EmptyIbanError, 'Iban validation failed due to: No iban provided!' end request = IbanRequest.new(@config)
[SRP-413] Raise EmptyIbanError as opposed to StandardError on IBAN validation
diff --git a/lib/pacer/filter/object_filter.rb b/lib/pacer/filter/object_filter.rb index abc1234..def5678 100644 --- a/lib/pacer/filter/object_filter.rb +++ b/lib/pacer/filter/object_filter.rb @@ -2,18 +2,28 @@ module Routes module RouteOperations def is(value) - if value.is_a? Symbol - chain_route :filter => :property, :block => proc { |v| v.vars[value] == v } + if value.nil? and graph and defined? Pacer::DexGraph and graph.is_a? Pacer::DexGraph + # NOTE: This is a workaround for https://github.com/tinkerpop/blueprints/issues/178 + only(value) else - chain_route({ :filter => :object, :value => value }) + if value.is_a? Symbol + chain_route :filter => :property, :block => proc { |v| v.vars[value] == v } + else + chain_route({ :filter => :object, :value => value }) + end end end def is_not(value) - if value.is_a? Symbol - chain_route :filter => :property, :block => proc { |v| v.vars[value] != v } + if value.nil? and graph and defined? Pacer::DexGraph and graph.is_a? Pacer::DexGraph + # NOTE: This is a workaround for https://github.com/tinkerpop/blueprints/issues/178 + except(value) else - chain_route({ :filter => :object, :value => value, :negate => true }) + if value.is_a? Symbol + chain_route :filter => :property, :block => proc { |v| v.vars[value] != v } + else + chain_route({ :filter => :object, :value => value, :negate => true }) + end end end end
Work around edge case in Dex
diff --git a/wbench.gemspec b/wbench.gemspec index abc1234..def5678 100644 --- a/wbench.gemspec +++ b/wbench.gemspec @@ -10,7 +10,8 @@ gem.email = ["mario@mariovisic.com"] gem.description = %q{WBench is a tool that uses the HTML5 performance timing API to benchmark end user load times for websites.} gem.summary = %q{Benchmark website loading times} - gem.homepage = "" + gem.homepage = "https://github.com/desktoppr/wbench" + gem.license = "MIT" gem.add_dependency 'capybara' gem.add_dependency 'colorize'
Update gemspec with license and homepage
diff --git a/spec/helpers/bootstrap_flash_helper_spec.rb b/spec/helpers/bootstrap_flash_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/bootstrap_flash_helper_spec.rb +++ b/spec/helpers/bootstrap_flash_helper_spec.rb @@ -8,22 +8,27 @@ bootstrap_flash.should == "<div class=\"alert alert-warning\"><a class=\"close\" data-dismiss=\"alert\">&times;</a>Update Warning!</div>" end - it "should return alert-success message when use notice message" do + it "should return alert-success message when using notice message" do stub!(:flash).and_return({:notice => "Update Success!"}) bootstrap_flash.should == "<div class=\"alert alert-success\"><a class=\"close\" data-dismiss=\"alert\">&times;</a>Update Success!</div>" end - it "should return flash message" do + it "should return alert-error message when using notice error" do stub!(:flash).and_return({:error => "Update Failed!"}) bootstrap_flash.should == "<div class=\"alert alert-error\"><a class=\"close\" data-dismiss=\"alert\">&times;</a>Update Failed!</div>" end - it "should return alert-success message when use notice message" do + it "should return alert-error message when using alert message" do + stub!(:flash).and_return({:alert => "Update Alert!"}) + bootstrap_flash.should == "<div class=\"alert alert-error\"><a class=\"close\" data-dismiss=\"alert\">&times;</a>Update Alert!</div>" + end + + it "should return alert-info message when using info message" do stub!(:flash).and_return({:info => "Update Information!"}) bootstrap_flash.should == "<div class=\"alert alert-info\"><a class=\"close\" data-dismiss=\"alert\">&times;</a>Update Information!</div>" end - it "should return alert-success message when use notice message" do + it "should return no message when using an undefined message" do stub!(:flash).and_return({:undefined => "Update Undefined!"}) bootstrap_flash.should == "" end
Fix spec predicates. Test alert-error case.
diff --git a/spec/presenters/tree_node/iso_image_spec.rb b/spec/presenters/tree_node/iso_image_spec.rb index abc1234..def5678 100644 --- a/spec/presenters/tree_node/iso_image_spec.rb +++ b/spec/presenters/tree_node/iso_image_spec.rb @@ -3,5 +3,5 @@ let(:object) { FactoryBot.create(:iso_image) } include_examples 'TreeNode::Node#key prefix', 'isi-' - include_examples 'TreeNode::Node#icon', 'ff ff-network-card' + include_examples 'TreeNode::Node#icon', 'ff ff-file-iso-o' end
Adjust specs for the IsoImage fonticon change in the decorator
diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb index abc1234..def5678 100644 --- a/app/controllers/spree/checkout_controller_decorator.rb +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -8,9 +8,10 @@ payment_method = PaymentMethod.find(params[:payment_method_id]) skrill_transaction = SkrillTransaction.new - payment = @order.payments.create(:amount => @order.total, + payment = @order.payments.create({:amount => @order.total, :source => skrill_transaction, - :payment_method => payment_method) + :payment_method => payment_method}, + :without_protection => true) payment.started_processing! payment.pend! end
Create payment without mass-assignment protection in Spree::CheckoutController Fixes #6
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -4,7 +4,7 @@ @user = User.find_or_create_for_twitter(request.env["omniauth.auth"]) flash[:notice] = "Signed in with Twitter successfully." # use devise-provided method to redirect the user - if @user.email == "temp@example.com" || @user.phone.nil? + if @user.email == "changeme@changeme.com" || @user.phone.nil? sign_in @user, :event => :authentication redirect_to users_get_path else
Update omniauth extra reg form
diff --git a/app/models/story_distributions/episode_distribution.rb b/app/models/story_distributions/episode_distribution.rb index abc1234..def5678 100644 --- a/app/models/story_distributions/episode_distribution.rb +++ b/app/models/story_distributions/episode_distribution.rb @@ -5,7 +5,7 @@ include PRXAccess include Rails.application.routes.url_helpers - def distribute + def distribute! super add_episode_to_feeder end @@ -15,7 +15,7 @@ podcast = self.distribution.get_podcast episode = podcast.episodes.post(episode_attributes) episode_url = URI.join(feeder_root, episode.links['self'].href).to_s - self.update_column(:url, episode_url) if episode_url + update_attributes!(url: episode_url) if episode_url end def episode_attributes
Fix tests, add more to episode distro controller
diff --git a/virtus-uri.gemspec b/virtus-uri.gemspec index abc1234..def5678 100644 --- a/virtus-uri.gemspec +++ b/virtus-uri.gemspec @@ -9,7 +9,7 @@ spec.authors = ["Brian Cobb"] spec.email = ["bcobb@uwalumni.com"] spec.summary = "Add a URI attribute type to Virtus." - spec.homepage = "" + spec.homepage = "https://github.com/bcobb/virtus-uri" spec.license = "MIT" spec.files = Dir['lib/**/*.rb'] + ['README.markdown']
Add homepage to the gemspec
diff --git a/app/models/biblio_commons_title_content_item.rb b/app/models/biblio_commons_title_content_item.rb index abc1234..def5678 100644 --- a/app/models/biblio_commons_title_content_item.rb +++ b/app/models/biblio_commons_title_content_item.rb @@ -35,6 +35,11 @@ end def glyphicon - "book-open" + case format + when 'EBOOK' then 'ipad' + when 'DVD' then 'film' + when 'MUSIC_CD' then 'music' + else 'book-open' + end end end
Change icon depending on "format'.
diff --git a/app/controllers/ajax/relationship_controller.rb b/app/controllers/ajax/relationship_controller.rb index abc1234..def5678 100644 --- a/app/controllers/ajax/relationship_controller.rb +++ b/app/controllers/ajax/relationship_controller.rb @@ -16,7 +16,7 @@ type: params[:type] ) @response[:success] = true - @response[:message] = t(".success") + @response[:message] = t('messages.friend.create.success') rescue Errors::Base => e @response[:message] = t(e.locale_tag) ensure @@ -30,7 +30,7 @@ type: params[:type] ) @response[:success] = true - @response[:message] = t(".success") + @response[:message] = t('messages.friend.create.success') rescue Errors::Base => e @response[:message] = t(e.locale_tag) ensure
Use full translation key for messages
diff --git a/app/controllers/channels/projects_controller.rb b/app/controllers/channels/projects_controller.rb index abc1234..def5678 100644 --- a/app/controllers/channels/projects_controller.rb +++ b/app/controllers/channels/projects_controller.rb @@ -1,7 +1,7 @@ # coding: utf-8 class Channels::ProjectsController < ProjectsController - belongs_to :channel, finder: :find_by_permalink!, param: :profile_id, polymorphic: true + belongs_to :channel, finder: :find_by_permalink!, param: :profile_id after_filter only: [:create] { @project.channels << @channel } end
Remove polymorphic flag from channels projects For some reason, it was there.
diff --git a/spec/factories/users.rb b/spec/factories/users.rb index abc1234..def5678 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :user do - user_name { Faker::Internet.user_name } + sequence(:user_name) { |n| Faker::Internet.user_name + n.to_s } first_name { Faker::Name.first_name } last_name { Faker::Name.last_name } end
Fix flaky user name uniqueness in specs Apparently Faker doesn't generate unique user names in a sequence of calls and I sometimes get an uniquess violation error because of this. This can be fixed by using FactoryGirl's sequence. Tested: - rspec
diff --git a/spec/factories/users.rb b/spec/factories/users.rb index abc1234..def5678 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -0,0 +1,13 @@+FactoryGirl.define do + factory :user do + user_new_password = "Pass3word:" + + first_name { Faker::Name.first_name } + last_name { Faker::Name.last_name } + street_name{ "King Street W." } + street_num { 220 } + email { Faker::Internet.free_email } + password { user_new_password } + password_confirmation { user_new_password } + end +end
Add Factory Girl For User Model
diff --git a/spec/support/backend.rb b/spec/support/backend.rb index abc1234..def5678 100644 --- a/spec/support/backend.rb +++ b/spec/support/backend.rb @@ -13,4 +13,34 @@ Que.clear! DB[:que_jobs].count.should be 0 end + + describe "when queueing jobs" do + it "should be able to queue a job with arguments" do + pending + end + + it "should be able to queue a job with a specific time to run" do + pending + end + + it "should be able to queue a job with a specific priority" do + pending + end + + it "should be able to queue a job with queueing options in addition to argument options" do + pending + end + + it "should respect a default (but overridable) priority for the job class" do + pending + end + + it "should respect a default (but overridable) run_at for the job class" do + pending + end + + it "should raise an error if given arguments that can't convert to and from JSON unambiguously" do + pending + end + end end
Add some pending specs on queueing jobs.
diff --git a/spec/unit/utils_spec.rb b/spec/unit/utils_spec.rb index abc1234..def5678 100644 --- a/spec/unit/utils_spec.rb +++ b/spec/unit/utils_spec.rb @@ -0,0 +1,24 @@+require 'spec_helper' +require 'nfg-client/utils' + +describe NFGClient::Utils do + + class TestClass + include ::NFGClient::Utils + + end + + let(:test_class) { TestClass.new } + + describe "#build_nfg_soap_request" do + subject { test_class.build_nfg_soap_request('CreateCOF', new_cof_params) } + context "when a text field contains a non-standard character" do + let(:new_cof_params) { create_cof_params.merge({first_name: 'Janet & Peter'}) } + + it "should encode them" do + expect(subject).to match(/Janet &amp; Peter/) + end + end + + end +end
Add a test to ensure values are being encoded
diff --git a/features/step_definitions/background_steps.rb b/features/step_definitions/background_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/background_steps.rb +++ b/features/step_definitions/background_steps.rb @@ -1,4 +1,4 @@-Given(/that I am logged in as a (.*)$/i) do |user| +Given(/that I am logged in as a?(.*)$/i) do |user| # select the appropriate user if user == 'user' user = 'test.user'
Fix background steps to match Given statements with and without 'a'
diff --git a/tokie.gemspec b/tokie.gemspec index abc1234..def5678 100644 --- a/tokie.gemspec +++ b/tokie.gemspec @@ -16,7 +16,7 @@ spec.test_files = Dir["test/**/*"] spec.require_paths = ["lib"] - spec.add_dependency "activesupport", "~> 4.2" + spec.add_dependency "activesupport", ">= 4.2" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake"
Make AS dependency more lenient.
diff --git a/src/plugins/commands/get_abbrv.rb b/src/plugins/commands/get_abbrv.rb index abc1234..def5678 100644 --- a/src/plugins/commands/get_abbrv.rb +++ b/src/plugins/commands/get_abbrv.rb @@ -25,7 +25,9 @@ match_data = module_text.scan(/([A-Z0-9\-]+) = {'#{thing}',/) msg.reply("#{thing} is abbreviated as #{match_data[0][0]}") else - msg.reply('I do not know what happened.') + msg.reply("#{thing} does not appear to be in the abbreviation " \ + 'list, but there were similar non-exact results. ' \ + 'Try something similar.') end else msg.reply("#{thing} does not appear to be in the abbreviation list.")
:bug: Fix unclear message in getabbrv
diff --git a/plugin/hammer.vim/renderers/markdown_renderer.rb b/plugin/hammer.vim/renderers/markdown_renderer.rb index abc1234..def5678 100644 --- a/plugin/hammer.vim/renderers/markdown_renderer.rb +++ b/plugin/hammer.vim/renderers/markdown_renderer.rb @@ -0,0 +1,25 @@+require 'redcarpet' + +# +# Thanks to Steve Klabnik for his blog post about Redcarpet renderers. +# See http://blog.steveklabnik.com/posts/2011-12-21-redcarpet-is-awesome +# +class Hammer::MarkdownRenderer < Redcarpet::Render::HTML + + def block_code code, language + if defined?(Albino) + Albino.safe_colorize(code, language) + else + code + end + end + +end + +markup :redcarpet, /md|mkd|markdown/ do |content| + renderer = Redcarpet::Markdown.new Hammer::MarkdownRenderer.new, + :tables => true, + :fenced_code_blocks => true, + :auto_linl => true + renderer.render(content) +end
Add markdown custom markdown renderer.
diff --git a/app/controllers/admin/enterprise_roles_controller.rb b/app/controllers/admin/enterprise_roles_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/enterprise_roles_controller.rb +++ b/app/controllers/admin/enterprise_roles_controller.rb @@ -7,7 +7,7 @@ end def create - @enterprise_role = EnterpriseRole.new params[:enterprise_role] + @enterprise_role = EnterpriseRole.new enterprise_role_params if @enterprise_role.save render text: Api::Admin::EnterpriseRoleSerializer.new(@enterprise_role).to_json @@ -22,5 +22,11 @@ @enterprise_role.destroy render nothing: true end + + private + + def enterprise_role_params + params.require(:enterprise_role).permit(:user_id, :enterprise_id) + end end end
Handle strong params in enterprise_roles controller
diff --git a/app/controllers/fonelator/concerns/twilio_actions.rb b/app/controllers/fonelator/concerns/twilio_actions.rb index abc1234..def5678 100644 --- a/app/controllers/fonelator/concerns/twilio_actions.rb +++ b/app/controllers/fonelator/concerns/twilio_actions.rb @@ -6,7 +6,7 @@ end def twilio_voice - if params[:AccountSID] == Fonelator::Config::twilio_account_sid + if params[:AccountSid] == Fonelator::Config::twilio_account_sid response = Twilio::TwiML::Response.new do |r| r.Dial do |d| d.Number ENV['TWILIO_FORWARD_NUMBER']
Update twilio webhook sid param lookup
diff --git a/app/controllers/mailkick/subscriptions_controller.rb b/app/controllers/mailkick/subscriptions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/mailkick/subscriptions_controller.rb +++ b/app/controllers/mailkick/subscriptions_controller.rb @@ -1,6 +1,6 @@ module Mailkick class SubscriptionsController < ActionController::Base - before_filter :set_email + before_action :set_email def show end
Change from before_filter to before_action
diff --git a/app/workers/publishing_api_withdrawal_worker.rb b/app/workers/publishing_api_withdrawal_worker.rb index abc1234..def5678 100644 --- a/app/workers/publishing_api_withdrawal_worker.rb +++ b/app/workers/publishing_api_withdrawal_worker.rb @@ -1,10 +1,11 @@ class PublishingApiWithdrawalWorker < PublishingApiWorker - def perform(content_id, explanation, locale) + def perform(content_id, explanation, locale, allow_draft = false) Whitehall.publishing_api_v2_client.unpublish( content_id, type: "withdrawal", locale: locale, - explanation: explanation + explanation: explanation, + allow_draft: allow_draft, ) end end
Add an optional allow_draft parameter to the PublishingApiWithdrawalWorker
diff --git a/application/meta/task_template/new/model_def.rb b/application/meta/task_template/new/model_def.rb index abc1234..def5678 100644 --- a/application/meta/task_template/new/model_def.rb +++ b/application/meta/task_template/new/model_def.rb @@ -20,7 +20,7 @@ table: :template, columns: { content: { type: :json }, - task_action: { type: :varchar, size: 30 } + task_action: { type: :varchar, size: 100 } }, many_to_one: [:component, :module_branch] }
Fix error value too long for type character varying(30) for workflow name
diff --git a/lib/builderator/util/aws_exception.rb b/lib/builderator/util/aws_exception.rb index abc1234..def5678 100644 --- a/lib/builderator/util/aws_exception.rb +++ b/lib/builderator/util/aws_exception.rb @@ -0,0 +1,31 @@+require 'json' +require_relative './task_exception' + +module Builderator + module Util + ## + # Exception raised if a safety limit is exceeded + ## + class AwsException < TaskException + attr_reader :exception + + def initialize(task, exception) + super(:fail, task, :red) + @exception = exception + end + + def operation + @exception.context.operation_name + end + + def parameters + @exception.context.params + end + + def message + "An error occured executing performing task #{ task }. #{ operation }"\ + "(#{ JSON.generate(parameters) }): #{ exception.message }" + end + end + end +end
Add a wrapper exception for AWS-SDK service errors
diff --git a/lib/acts_as_tree/extensions.rb b/lib/acts_as_tree/extensions.rb index abc1234..def5678 100644 --- a/lib/acts_as_tree/extensions.rb +++ b/lib/acts_as_tree/extensions.rb @@ -7,20 +7,13 @@ # subchild1.ancestors # => [child1, root] def ancestors node, nodes = self, [] - - while node.parent do - nodes << node = node.parent - if nodes.include?(node.parent) - break - end - end - + nodes << node = node.parent while node.parent nodes end # Dupe from acts_as_tree gem so Event can use it. def descendants - children.each_with_object(children) {|child, arr| + children.each_with_object(children.to_a) {|child, arr| arr.concat child.descendants }.uniq end
Copy acts_as_tree implementation of ancestors and descendants
diff --git a/lib/bandicoot/dsl.rb b/lib/bandicoot/dsl.rb index abc1234..def5678 100644 --- a/lib/bandicoot/dsl.rb +++ b/lib/bandicoot/dsl.rb @@ -14,7 +14,7 @@ end def paginate_url(url, next_page_path:) - next_page_path = next_page + next_page_path = next_page_path url = url end
Change agument naming in DSL method
diff --git a/sass-media_query_combiner.gemspec b/sass-media_query_combiner.gemspec index abc1234..def5678 100644 --- a/sass-media_query_combiner.gemspec +++ b/sass-media_query_combiner.gemspec @@ -19,7 +19,7 @@ gem.required_ruby_version = '>= 1.9.2' - gem.add_runtime_dependency "sass", "~>3.2.0" + gem.add_runtime_dependency "sass", ">=3.2.0" gem.add_development_dependency "rspec" gem.add_development_dependency "rake"
Allow sass versions greater than 3.2
diff --git a/lib/camayoc/handlers/filter.rb b/lib/camayoc/handlers/filter.rb index abc1234..def5678 100644 --- a/lib/camayoc/handlers/filter.rb +++ b/lib/camayoc/handlers/filter.rb @@ -23,7 +23,7 @@ !proc.call(type,event) end else - @filter = Proc.new {|args| true } + @filter = Proc.new { true } end end
Remove useless |args| in default Filter Proc
diff --git a/lib/dropcaster/contributors.rb b/lib/dropcaster/contributors.rb index abc1234..def5678 100644 --- a/lib/dropcaster/contributors.rb +++ b/lib/dropcaster/contributors.rb @@ -4,11 +4,22 @@ module Dropcaster def self.contributors - cbtors = Octokit.contributors('nerab/dropcaster', true) + octokit = if ENV.include?('GITHUB_TOKEN') + Octokit::Client.new(:access_token => ENV['GITHUB_TOKEN']) + else + Octokit::Client.new + end - cbtors.sort! { |x, y| y.contributions <=> x.contributions } - cbtors.map! { |c| "* [#{Octokit.user(c.login).name}](#{c.html_url}) (#{c.contributions} contributions)" } - - cbtors.join("\n") + octokit.contributors('nerab/dropcaster', true) + .sort { |x, y| y.contributions <=> x.contributions } + .map { |c| + begin + "* [#{octokit.user(c.login).name}](#{c.html_url}) (#{c.contributions} contributions)" + rescue + "* #{c.tr('[]', '()')} (#{c.contributions} contributions)" + end + } + .compact + .join("\n") end end
Fix credit for contributions of non-GH users
diff --git a/lib/dry/validation/contract.rb b/lib/dry/validation/contract.rb index abc1234..def5678 100644 --- a/lib/dry/validation/contract.rb +++ b/lib/dry/validation/contract.rb @@ -35,7 +35,7 @@ end def message(key, tokens: EMPTY_HASH, **opts) - messages[key, **opts] % tokens + messages[key, **opts].(tokens) end end end
Use new callable templates from dry-schema
diff --git a/lib/mdi_cloud_decoder/track.rb b/lib/mdi_cloud_decoder/track.rb index abc1234..def5678 100644 --- a/lib/mdi_cloud_decoder/track.rb +++ b/lib/mdi_cloud_decoder/track.rb @@ -2,6 +2,7 @@ class Track attr_reader :id, :asset, + :location_provided, :latitude, :longitude, :received_at, @@ -19,6 +20,7 @@ @asset = json['asset'] location = json['loc'] || [0,0] + @location_provided = json['loc'].present? @latitude = location[1] @longitude = location[0]
Add location provided field to check if location was present when decoding
diff --git a/lib/reckless/results_parser.rb b/lib/reckless/results_parser.rb index abc1234..def5678 100644 --- a/lib/reckless/results_parser.rb +++ b/lib/reckless/results_parser.rb @@ -45,7 +45,7 @@ element = node.css("tr:last-child td b").first if element - text = element.children.first.text + text = element.children.first.text.gsub("Condition", "") text.scan(/\(([\w\s]+)\)/).flatten.first.to_s.strip end end
Remove 'Condition' text from result condition
diff --git a/lib/ruby-handlebars/context.rb b/lib/ruby-handlebars/context.rb index abc1234..def5678 100644 --- a/lib/ruby-handlebars/context.rb +++ b/lib/ruby-handlebars/context.rb @@ -21,8 +21,7 @@ end def add_items(hash) - return unless @data.respond_to? :merge! - @data.merge! hash + @locals.merge! hash end def save_special_variables @@ -32,8 +31,7 @@ end def restore_special_variables variables - return unless @data.respond_to? :merge! - @data.merge! variables + @locals.merge! variables end private
Use @locals instead of @data when settings first, last and index
diff --git a/lib/cf-release-common.rb b/lib/cf-release-common.rb index abc1234..def5678 100644 --- a/lib/cf-release-common.rb +++ b/lib/cf-release-common.rb @@ -12,6 +12,6 @@ when /java/ blobs.keys.detect { |key| key =~ /java-buildpack-v/ } else - blobs.keys.detect { |key| key =~ /^#{language}-buildpack\// } + blobs.keys.detect { |key| key =~ /^#{language}[-_]buildpack\// } end end
Handle both hwc_buildpack and hwc-buildpack in buildpack name [#149497611]
diff --git a/lib/jpmobile/resolver.rb b/lib/jpmobile/resolver.rb index abc1234..def5678 100644 --- a/lib/jpmobile/resolver.rb +++ b/lib/jpmobile/resolver.rb @@ -22,14 +22,15 @@ !sanitizer[File.dirname(filename)].include?(filename) } - template_paths.map { |template| handler, format = extract_handler_and_format(template, formats) contents = File.binread template + variant = template.match(/.+#{path}(.+)\.#{format.to_sym.to_s}.*$/) ? $1 : '' + virtual_path = variant.blank? ? nil : path + variant ActionView::Template.new(contents, File.expand_path(template), handler, - :virtual_path => path.name + variant, + :virtual_path => virtual_path, :format => format, :updated_at => mtime(template)) }
Fix virtual_path problem in template_errpr
diff --git a/lib/rails_info/engine.rb b/lib/rails_info/engine.rb index abc1234..def5678 100644 --- a/lib/rails_info/engine.rb +++ b/lib/rails_info/engine.rb @@ -1,7 +1,7 @@ module RailsInfo class Engine < ::Rails::Engine config.before_initialize do |app| - if Rails.env.development? + if Rails.env.development? || Rails.env.test? SimpleNavigation.config_file_paths << "#{File.expand_path(File.dirname(__FILE__))}/../../config" end end
Extend navigation path in test environment, too
diff --git a/lib/ruby-os/scheduler.rb b/lib/ruby-os/scheduler.rb index abc1234..def5678 100644 --- a/lib/ruby-os/scheduler.rb +++ b/lib/ruby-os/scheduler.rb @@ -6,8 +6,8 @@ @queue_manager = queue_manager end - def next_proc(queue_identifier) - raise NotImpleplementedError.new + def next_proc(queue_identifier, current_proc=nil) + raise NoQueueFoundError.new queue_identifier if !queue_manager.has_queue? queue_identifier end private @@ -17,4 +17,10 @@ super "Expected RubyOS::QueueManager" end end + + class NoQueueFoundError < ArgumentError + def initialize(identifier) + super "No RubyOS::Queue found identified by '#{identifier}'" + end + end end
Add a more base method on Scheduler
diff --git a/lib/snip_snip/railtie.rb b/lib/snip_snip/railtie.rb index abc1234..def5678 100644 --- a/lib/snip_snip/railtie.rb +++ b/lib/snip_snip/railtie.rb @@ -2,6 +2,7 @@ class Railtie < Rails::Railtie initializer 'snip_snip.load_extensions' do ActiveSupport.on_load(:action_controller) do + before_action { Registry.clear } after_action { Reporter.report(self) } end
Clear the registry before the controller action
diff --git a/twine.gemspec b/twine.gemspec index abc1234..def5678 100644 --- a/twine.gemspec +++ b/twine.gemspec @@ -14,6 +14,8 @@ s.files = %w( Gemfile README.md LICENSE ) s.files += Dir.glob("lib/**/*") s.files += Dir.glob("bin/**/*") + s.files += Dir.glob("test/**/*") + s.test_file = 'tests/twine_test.rb' s.required_ruby_version = ">= 1.8.7" s.add_runtime_dependency('rubyzip', "~> 0.9.5")
Add test files to the gemspec.
diff --git a/lib/gitlab/middleware/proxy_timing.rb b/lib/gitlab/middleware/proxy_timing.rb index abc1234..def5678 100644 --- a/lib/gitlab/middleware/proxy_timing.rb +++ b/lib/gitlab/middleware/proxy_timing.rb @@ -10,11 +10,13 @@ end def call(env) - proxy_start = env['HTTP_GITLAB_WORHORSE_PROXY_START'].to_f / 1_000_000_000 - if proxy_start > 0 - # send measurement - puts "\n\n\n#{(Time.now - proxy_start).to_f}\n\n\n" + trans = Gitlab::Metrics.current_transaction + proxy_start = env['HTTP_GITLAB_WORHORSE_PROXY_START'].presence + if trans && proxy_start + # Time in milliseconds since gitlab-workhorse started the request + trans.set(:proxy_flight_time, Time.now.to_f * 1_000 - proxy_start.to_f / 1_000_000) end + @app.call(env) end end
Send data to InfluxDB instead of stdout
diff --git a/lib/mobility/sequel/column_changes.rb b/lib/mobility/sequel/column_changes.rb index abc1234..def5678 100644 --- a/lib/mobility/sequel/column_changes.rb +++ b/lib/mobility/sequel/column_changes.rb @@ -9,8 +9,6 @@ class ColumnChanges < Module # @param [Array<String>] attributes Backend attributes def initialize(attributes) - @attributes = attributes - attributes.each do |attribute| define_method "#{attribute}=".freeze do |value, **options| if !options[:super] && send(attribute) != value
Remove unneeded variable assignment in ColumnChanges
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -11,8 +11,10 @@ ].each do |model_class| file_path = "#{Dir.pwd}/db/data/csv/#{model_class.table_name}.csv" - CSV.foreach(file_path, headers: true) do |row| - record = model_class.where(id: row["id"]).first_or_create!(row.to_h.except("id")) - puts "#{model_class}: #{record.id}" + model_class.transaction do + CSV.foreach(file_path, headers: true) do |row| + record = model_class.where(id: row["id"]).first_or_create!(row.to_h.except("id")) + puts "#{model_class}: #{record.id}" + end end end
Reduce the number of commits in db:seed for better performance Before ``` % bin/rails db:seed % psql -c 'delete from episodes' annict_development DELETE 1565 % time bin/rails db:seed bin/rails db:seed 26.08s user 1.50s system 36% cpu 1:16.16 total ``` After ``` % bin/rails db:seed % psql -c 'delete from episodes' annict_development DELETE 1565 % time bin/rails db:seed bin/rails db:seed 13.77s user 0.90s system 87% cpu 16.805 total ````
diff --git a/lib/adminpanel/engine.rb b/lib/adminpanel/engine.rb index abc1234..def5678 100644 --- a/lib/adminpanel/engine.rb +++ b/lib/adminpanel/engine.rb @@ -29,8 +29,7 @@ self.twitter_api_secret = nil self.displayable_resources = [ - :users, - :sections + :users ] self.fb_app_id = nil
Remove sections from default displayable resources
diff --git a/lib/metric_fu/utility.rb b/lib/metric_fu/utility.rb index abc1234..def5678 100644 --- a/lib/metric_fu/utility.rb +++ b/lib/metric_fu/utility.rb @@ -4,7 +4,7 @@ module Utility module_function - ESCAPE_CODES_PATTERN = Regexp.new('\e\[\d{1,2}m') + ESCAPE_CODES_PATTERN = Regexp.new('\e\[(?:\d;)?\d{1,2}m') # Removes non-ASCII characters def clean_ascii_text(text)
Make ANSI escape regex more precise
diff --git a/lib/svnx/base/cmdline.rb b/lib/svnx/base/cmdline.rb index abc1234..def5678 100644 --- a/lib/svnx/base/cmdline.rb +++ b/lib/svnx/base/cmdline.rb @@ -11,7 +11,7 @@ end end -class Svnx::CachingCommandLine < System::CachingCommandLine +class Svnx::Base::CachingCommandLine < System::CachingCommandLine def caching? true end @@ -42,7 +42,7 @@ debug "cmdargs: #{cmdargs}" cmdline = if @caching - Svnx::CachingCommandLine.new cmdargs + Svnx::Base::CachingCommandLine.new cmdargs else System::CommandLine.new cmdargs end
Insert Base module into CachingCommandLine name
diff --git a/lib/voting_app/engine.rb b/lib/voting_app/engine.rb index abc1234..def5678 100644 --- a/lib/voting_app/engine.rb +++ b/lib/voting_app/engine.rb @@ -3,7 +3,7 @@ isolate_namespace VotingApp initializer 'votes limit' do |app| - app.config.votes_limit = ENV['VOTES_LIMIT'] || 10 + app.config.votes_limit = ENV['VOTES_LIMIT'].to_i || 10 end end
Convert votes limit env var to integer
diff --git a/WebViewJavascriptBridge.podspec b/WebViewJavascriptBridge.podspec index abc1234..def5678 100644 --- a/WebViewJavascriptBridge.podspec +++ b/WebViewJavascriptBridge.podspec @@ -11,7 +11,7 @@ s.osx.platform = :osx s.ios.source_files = 'WebViewJavascriptBridge/*.{h,m}' s.osx.source_files = 'WebViewJavascriptBridge/*.{h,m}' - s.resource = 'WebViewJavascriptBridgeAbstract/WebViewJavascriptBridge.js.txt' + s.resource = 'WebViewJavascriptBridge/WebViewJavascriptBridge.js.txt' s.ios.framework = 'UIKit' s.osx.framework = 'WebKit' end
Fix resource path in podspec
diff --git a/sqlite_to_yml.rb b/sqlite_to_yml.rb index abc1234..def5678 100644 --- a/sqlite_to_yml.rb +++ b/sqlite_to_yml.rb @@ -0,0 +1,38 @@+######################################## +# sqlite to yml +# ruby sqlite_to_yml nomnichi.sqlite3 > nomnichi.yaml +######################################## + +require 'sqlite3' +require 'yaml' + +@database_sqlite = ARGV[0] + +@nomnichi_db = SQLite3::Database.new("#{@database_sqlite}") + +@nomnichi_db.transaction do + article_sql = <<SQL +select * from article; +SQL + + @nomnichi_db.execute(article_sql).each do |row| + print "-", "\n" + print " member_name: ", "#{row[1]}", "\n" + print " title: ", "#{row[2]}", "\n" + print " perma_link: ", "#{row[3]}", "\n" + print " content: |", "\n" + string = row[4].split("\n") + string.each do |s| + print " #{s}", "\n" + end + print " created_on: ", "#{row[5]}", "\n" + print " updated_on: ", "#{row[6]}", "\n" + print " published_on: ", "#{row[7]}", "\n" + print " approved: ", "#{row[8]}", "\n" + print " count: ", "#{row[9]}", "\n" + print " promote_headline: ", "#{row[10]}", "\n" + print " comment: ", "\n" + end +end + +@nomnichi_db.close
Create a script of sqlite to yml
diff --git a/lib/enom-api.rb b/lib/enom-api.rb index abc1234..def5678 100644 --- a/lib/enom-api.rb +++ b/lib/enom-api.rb @@ -13,6 +13,7 @@ class ResponseError < RuntimeError attr_reader :messages def initialize(error_messages) + super(Array(error_messages).join(", ")) @messages = error_messages end end
Add some information to the EnomAPI::Response
diff --git a/lib/services.rb b/lib/services.rb index abc1234..def5678 100644 --- a/lib/services.rb +++ b/lib/services.rb @@ -24,7 +24,7 @@ end def self.worldwide_api - GdsApi::Worldwide.new(Plek.find("whitehall-admin")) + GdsApi.worldwide end def self.registries
Access Worldwide API via whitehall-frontend To simplify the migration of Whitehall to AWS, calls to the Worldwide API should be directed to whitehall-frontend, not whitehall-admin. Co-authored-by: Christopher Baines <c14e4e2094dd20d1d0dcfc7ec4547168bcc89be2@digital.cabinet-office.gov.uk>
diff --git a/db/migrate/20140717200213_add_tv_to_shares.rb b/db/migrate/20140717200213_add_tv_to_shares.rb index abc1234..def5678 100644 --- a/db/migrate/20140717200213_add_tv_to_shares.rb +++ b/db/migrate/20140717200213_add_tv_to_shares.rb @@ -0,0 +1,22 @@+class AddTvToShares < ActiveRecord::Migration + def self.up + if(Setting.get('initialized') && Setting.get('initialized') == '1') + name = "TV" + sh = Share.where(:name=>name).first + if !sh + sh = Share.new + sh.path = Share.default_full_path(name) + sh.name = name + sh.rdonly = false + sh.visible = true + sh.tags = name.downcase + sh.extras = "" + sh.disk_pool_copies = 0 + sh.save! + end + end + end + + def self.down + end +end
Add migration for tv shares if not exist
diff --git a/deploy/recipes/default.rb b/deploy/recipes/default.rb index abc1234..def5678 100644 --- a/deploy/recipes/default.rb +++ b/deploy/recipes/default.rb @@ -15,7 +15,7 @@ interpreter "bash" cwd "#{deploy[:deploy_to]}/current" code <<-EOH - composer install +composer install EOH end
Add composer install to the deploy process
diff --git a/spec/features/checking_in_spec.rb b/spec/features/checking_in_spec.rb index abc1234..def5678 100644 --- a/spec/features/checking_in_spec.rb +++ b/spec/features/checking_in_spec.rb @@ -2,12 +2,13 @@ RSpec.describe 'Checking in at a worksite', type: :feature do it 'saves the shift event' do - worksite = WorkSite.create! address: '101 Main Street' + work_site = WorkSite.create! address: '101 Main Street' - visit new_check_in_path + visit root_path + click_link work_site.address + fill_in 'Name', with: 'Sam Jones' fill_in 'Email', with: 'my@email.com' - select '101 Main Street', from: 'Work site' fill_in 'Signature', with: 'abcdefg' click_button 'Check In'
Fix feature spec for nesting.
diff --git a/spec/http_service/request_spec.rb b/spec/http_service/request_spec.rb index abc1234..def5678 100644 --- a/spec/http_service/request_spec.rb +++ b/spec/http_service/request_spec.rb @@ -5,20 +5,24 @@ require 'pry' let(:data) {{city: "kathmandu"}} - let(:config) {WeatherReporter::Configuration.new.read_file } + let(:config) {WeatherReporter::Configuration.new } let(:request) do WeatherReporter::HTTPService::Request.new({city: "kathmandu"}, config) end describe '.initialize' do it 'set data of the object from user' do - expect(request.data).to eq(data) + expect(request.data).to(eq(data)) + end + + it 'carries valid configuration' do + expect(request.configuration).to(eq(config.read_file)) end end describe '#report' do - it 'send data to the api' do - expect(request.report).to eq(0) + it 'gets reponce form the API call' do + expect(request.report.class).to(eq(HTTParty::Response)) end end
Test case for the Request class test for the valid configuration test for recieve responce for the api call
diff --git a/spec/models/admin/project_spec.rb b/spec/models/admin/project_spec.rb index abc1234..def5678 100644 --- a/spec/models/admin/project_spec.rb +++ b/spec/models/admin/project_spec.rb @@ -4,14 +4,34 @@ RSpec.describe Admin::Project, type: :model do + let (:project) { FactoryBot.create(:project) } + let (:user) { FactoryBot.create(:user) } + let (:project_admin) { FactoryBot.create(:user) } + let (:project_researcher) { FactoryBot.create(:user) } + before(:each) do + project_admin.add_role_for_project('admin', project) + project_researcher.add_role_for_project('researcher', project) + end + describe '.project_admins' do + it 'project_admins' do + result = project.project_admins + expect(result).not_to be_nil + end + end + + describe '.project_researchers' do + it 'project_researchers' do + result = project.project_researchers + + expect(result).not_to be_nil + end + end # TODO: auto-generated describe '#changeable?' do it 'changeable?' do - project = described_class.new - user = FactoryBot.create(:user) result = project.changeable?(user) expect(result).not_to be_nil
Add tests for project_admins and project_researchers methods