diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/spec/attr_deprecated_spec.rb b/spec/attr_deprecated_spec.rb index abc1234..def5678 100644 --- a/spec/attr_deprecated_spec.rb +++ b/spec/attr_deprecated_spec.rb @@ -1,15 +1,33 @@ require 'spec_helper' + +class Foo + attr_accessor :fresh_attribute, :an_unused_attribute +end + describe "Sample spec" do specify "AttrDeprecated is defined" do defined?(AttrDeprecated).should be_true end - specify "A class that extends AttrDeprecated::Model will have attr_deprecated defined" do - Foo = Class.new + describe "A class includes AttrDeprecated" do + before do + Foo.class_eval { include AttrDeprecated } - Foo.class_eval { include AttrDeprecated::Model } + @f = Foo.new + @f.an_unused_attribute = "asdf" + end - Foo.methods.should include(:attr_deprecated) + specify "A class that extends AttrDeprecated::Model will have attr_deprecated defined" do + Foo.methods.should include(:attr_deprecated) + end + + specify "An attribute is defined as deprecated" do + Foo.class_eval { attr_deprecated :an_unused_attribute } + @f.methods.should include(:_an_unused_attribute_deprecated) + + @f.an_unused_attribute.should eq("asdf") + end end + end
Define specs for marking a setter method as deprecated
diff --git a/spec/core/file/umask_spec.rb b/spec/core/file/umask_spec.rb index abc1234..def5678 100644 --- a/spec/core/file/umask_spec.rb +++ b/spec/core/file/umask_spec.rb @@ -16,8 +16,9 @@ end specify "umask should return the current umask value for the process" do - File.umask(0006).should == 18 - File.umask.should == 6 + File.umask(022) + File.umask(006).should == 022 + File.umask.should == 006 end platform :mswin do @@ -28,7 +29,7 @@ # The value used here is the value of _S_IWRITE. it "Returns the current umask value for this process." do File.umask(0000200) - File.umask.should == 128 + File.umask.should == 0000200 end it "raise an exception if the arguments are wrong type or are the incorect number of arguments " do
Make umask spec work with different host process starting umasks, clean up literals to be easier to read through.
diff --git a/spec/helpers/image_helper.rb b/spec/helpers/image_helper.rb index abc1234..def5678 100644 --- a/spec/helpers/image_helper.rb +++ b/spec/helpers/image_helper.rb @@ -2,7 +2,7 @@ def process_image_version(test_file_name, version) result, content = nil, nil - Tempfile.open("specs", :encoding => 'binary') do |file| + Tempfile.open("specs") do |file| file.close version[:target_url] = "file:#{file.path}" @@ -24,7 +24,7 @@ end def extract_dimensions(image_data) - Tempfile.open("specs", :encoding => 'binary') do |file| + Tempfile.open("specs") do |file| file << image_data file.close IO.popen("identify -format '%w %h %[EXIF:Orientation]' '#{file.path}'", 'r') do |f|
Make tests compatible with 1.8.7.
diff --git a/spec/models/document_spec.rb b/spec/models/document_spec.rb index abc1234..def5678 100644 --- a/spec/models/document_spec.rb +++ b/spec/models/document_spec.rb @@ -0,0 +1,65 @@+# == Schema Information +# +# Table name: documents +# +# id :integer(4) not null, primary key +# name :string(255) +# description :text +# data_file_name :string(255) +# data_content_type :string(255) +# data_file_size :integer(4) +# data_updated_at :datetime +# user_id :integer(4) +# created_at :datetime +# updated_at :datetime +# + +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') +require 'digest' +require 'fileutils' + +describe Document do + before(:each) do + @file = File.new(File.join(File.dirname(__FILE__), + "..", + "fixtures", + "5k.png"), 'rb') + + @valid_attributes = { + :name => "a_file", + :description => "value for description", + :data => @file, + :user_id => "1" + } + @doc = Document.create!(@valid_attributes) + end + + + after do + @file.close + FileUtils::rm_rf("#{RAILS_ROOT}/file-storage/datas/#{@doc.id}") unless @doc.nil? + end + + it "should create a new instance given valid attributes" do + @doc = Document.create!(@valid_attributes) + + source_sum = Digest::SHA512::file(@file.path) + dest_sum = nil + proc do + dest_sum = Digest::SHA512::file("#{RAILS_ROOT}/file-storage/datas/#{@doc.id}/original/5k.png") + end.should_not raise_error + + dest_sum.should == source_sum + end + + it "should delete uploaded files when deleted" do + @doc.destroy + proc do + File::open("#{RAILS_ROOT}/file-storage/datas/#{@doc.id}/original/5k.png") + end.should raise_error(Errno::ENOENT) + end + + it "should return the path to the file" do + @doc.data.path.should == "#{RAILS_ROOT}/file-storage/datas/#{@doc.id}/original/5k.png" + end +end
Fix of weird conflict file
diff --git a/serialize_typed_attributes.gemspec b/serialize_typed_attributes.gemspec index abc1234..def5678 100644 --- a/serialize_typed_attributes.gemspec +++ b/serialize_typed_attributes.gemspec @@ -16,5 +16,5 @@ s.add_development_dependency "test-unit" s.add_development_dependency "pg" - s.add_development_dependency "activerecord-postgres-hstore" + s.add_development_dependency "activerecord-postgres-hstore", ">= 0.7.6" end
Upgrade to latest activerecord-postgres-hstore gem
diff --git a/lib/bundler/cli/add.rb b/lib/bundler/cli/add.rb index abc1234..def5678 100644 --- a/lib/bundler/cli/add.rb +++ b/lib/bundler/cli/add.rb @@ -13,6 +13,10 @@ # raise error when no gems are specified raise InvalidOption, "Please specify gems to add." if @gems.empty? + + # show warning when options are used with mutiple gems + # for time being they will be applied to the last gem + Bundler.ui.warn "All the options will be applied to all gems`." version = @options[:version].nil? ? nil : @options[:version].split(",").map(&:strip)
Add warning when using options with mutiple gems
diff --git a/spec/helpers_spec.rb b/spec/helpers_spec.rb index abc1234..def5678 100644 --- a/spec/helpers_spec.rb +++ b/spec/helpers_spec.rb @@ -1 +1,36 @@ require 'spec_helper' + +describe Cyclid::UI::Helpers do + include Rack::Test::Methods + + subject { Class.new { extend Cyclid::UI::Helpers } } + + describe '#csrf_token' do + it 'returns a CSRF token' do + env = Rack::MockRequest.env_for('http://example.com/test', {'rack.session' => {'username' => 'test'}}) + expect{subject.csrf_token(env)}.to_not raise_error + end + end + + describe '#csrf_tag' do + it 'returns a CSRF tag' do + env = Rack::MockRequest.env_for('http://example.com/test', {'rack.session' => {'username' => 'test'}}) + expect{subject.csrf_tag(env)}.to_not raise_error + end + end + + describe '#halt_with_401' do + it 'returns an HTTP 401 response' do + flash = double('flash') + expect(flash).to receive(:[]=).with(:login_error, 'Invalid username or password') + expect(flash).to receive(:now).and_return({login_error: nil}) + + expect(subject).to receive(:flash).twice.and_return(flash) + expect(subject).to receive(:halt).with(401, nil).and_return(401) + + res = nil + expect{res = subject.halt_with_401}.to_not raise_error + expect(res).to eq(401) + end + end +end
Add tests for the helper methods
diff --git a/bob.gemspec b/bob.gemspec index abc1234..def5678 100644 --- a/bob.gemspec +++ b/bob.gemspec @@ -6,8 +6,8 @@ Gem::Specification.new do |spec| spec.name = "bob" spec.version = Bob::VERSION - spec.authors = ["Giorgos Avramidis"] - spec.email = ["avramidggmail.com"] + spec.authors = ["Giorgos Avramidis", "Dario Hamidi"] + spec.email = ["avramidg@gmail.com", "dario.hamidi@gmail.com"] spec.description = %q{Bob, the Job Fetcher} spec.summary = %q{Fetch Job Posting Information} spec.homepage = ""
Add myself to the contributors.
diff --git a/lib/ethon.rb b/lib/ethon.rb index abc1234..def5678 100644 --- a/lib/ethon.rb +++ b/lib/ethon.rb @@ -20,5 +20,9 @@ # see how others use Ethon look at the Typhoeus code. # # @see https://www.github.com/typhoeus/typhoeus Typhoeus +# +# @note Please update to the latest libcurl version in order +# to benefit from all features and bugfixes. +# http://curl.haxx.se/download.html module Ethon end
Add docs about latest libcurl version.
diff --git a/lib/hanzo.rb b/lib/hanzo.rb index abc1234..def5678 100644 --- a/lib/hanzo.rb +++ b/lib/hanzo.rb @@ -10,7 +10,9 @@ module Hanzo def self.run(command) print(command, :green) - Bundler.with_clean_env { `#{command}` } + output = nil + ::Bundler.with_clean_env { output = `#{command}` } + output end def self.print(text, *colors)
Make Hanzo.run return the output
diff --git a/lib/nrser.rb b/lib/nrser.rb index abc1234..def5678 100644 --- a/lib/nrser.rb +++ b/lib/nrser.rb @@ -1,4 +1,8 @@-module NRSER; end +require 'pathname' + +module NRSER + ROOT = ( Pathname.new(__FILE__).dirname / '..' ).expand_path +end require_relative './nrser/version' require_relative './nrser/no_arg'
Add NRSER::ROOT pointing to Gem root dir.
diff --git a/lib/table.rb b/lib/table.rb index abc1234..def5678 100644 --- a/lib/table.rb +++ b/lib/table.rb @@ -1,8 +1,12 @@ class Table def initialize(width,height) - @width = width - @height = height + @width = 0..width + @height = 0..height + end + + def valid_position?(x,y) + @width.include?(x) and @height.include?(y) end end
Check for valid range in Table Class
diff --git a/rufus-scheduler.gemspec b/rufus-scheduler.gemspec index abc1234..def5678 100644 --- a/rufus-scheduler.gemspec +++ b/rufus-scheduler.gemspec @@ -32,8 +32,8 @@ s.add_runtime_dependency 'fugit', '~> 1.1', '>= 1.1.1' - s.add_development_dependency 'rspec', '~> 3.4' - s.add_development_dependency 'chronic' + s.add_development_dependency 'rspec', '~> 3.7' + s.add_development_dependency 'chronic', '~> 0.10' s.require_path = 'lib' end
Upgrade Rspec, peg Chronic at 0.10
diff --git a/nobrainer.gemspec b/nobrainer.gemspec index abc1234..def5678 100644 --- a/nobrainer.gemspec +++ b/nobrainer.gemspec @@ -15,7 +15,7 @@ s.description = "ORM for RethinkDB" s.license = 'MIT' - s.add_dependency "rethinkdb", "~> 1.10.0" + s.add_dependency "rethinkdb", "~> 1.11.0" s.add_dependency "activemodel", ">= 3.2.0", "< 5" s.add_dependency "middleware", "~> 0.1.0"
Update to latest rethinkdb library (v1.11.0)
diff --git a/spec/support/connection_helpers.rb b/spec/support/connection_helpers.rb index abc1234..def5678 100644 --- a/spec/support/connection_helpers.rb +++ b/spec/support/connection_helpers.rb @@ -1,4 +1,8 @@ module ConnectionHelpers + def foreign_keys_for(table_name) + ActiveRecord::Base.connection.foreign_keys(table_name) + end + def postgresql_db? ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql' end
Add helper to retrieve foreign keys for the received table
diff --git a/orats.gemspec b/orats.gemspec index abc1234..def5678 100644 --- a/orats.gemspec +++ b/orats.gemspec @@ -26,5 +26,5 @@ spec.add_development_dependency 'bundler', '~> 1.5' spec.add_development_dependency 'rake', '~> 0' spec.add_development_dependency 'minitest', '~> 5.3' - spec.add_development_dependency 'rubocop', '~> 0.41' + spec.add_development_dependency 'rubocop', '~> 0.49' end
Update rubocop to fix vulnerability in < 0.48.1
diff --git a/app/helpers/rnp_helper.rb b/app/helpers/rnp_helper.rb index abc1234..def5678 100644 --- a/app/helpers/rnp_helper.rb +++ b/app/helpers/rnp_helper.rb @@ -8,7 +8,8 @@ module RnpHelper def requirements_url - "https://wiki.rnp.br/pages/viewpage.action?pageId=89112372#ManualdoUsuáriodoserviçodeconferênciaweb-Requisitosdeuso" + # "https://wiki.rnp.br/pages/viewpage.action?pageId=89112372#ManualdoUsuáriodoserviçodeconferênciaweb-Requisitosdeuso" + check_bigbluebutton_server_url(BigbluebuttonServer.default) end def service_page_url
Replace the requirements URL with a link to /check
diff --git a/app/models/agenda_time.rb b/app/models/agenda_time.rb index abc1234..def5678 100644 --- a/app/models/agenda_time.rb +++ b/app/models/agenda_time.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true class AgendaTime < ApplicationRecord - has_many :agendas, dependent: :nullify + has_many :agendas, foreign_key: :time_id, dependent: :nullify, + inverse_of: :time belongs_to :day, class_name: 'AgendaDay', inverse_of: :times validates :label, presence: true
Fix foreign_key not correct for agneda and time
diff --git a/src/vsphere_cpi/spec/integration/spec_helper.rb b/src/vsphere_cpi/spec/integration/spec_helper.rb index abc1234..def5678 100644 --- a/src/vsphere_cpi/spec/integration/spec_helper.rb +++ b/src/vsphere_cpi/spec/integration/spec_helper.rb @@ -7,17 +7,18 @@ # before(:suite) and before(:all) seem to run in different contexts # so we can't assign directly to @stemcell; using a closure instead stemcell_id = nil + suite_cpi = nil rspec_config.before(:suite) do setup_global_config fetch_global_properties - @suite_cpi = VSphereCloud::Cloud.new(cpi_options) + suite_cpi = VSphereCloud::Cloud.new(cpi_options) Dir.mktmpdir do |temp_dir| stemcell_image = stemcell_image(@stemcell_path, temp_dir) # stemcell uploads are slow on local vSphere, only upload once - stemcell_id = @suite_cpi.create_stemcell(stemcell_image, nil) + stemcell_id = suite_cpi.create_stemcell(stemcell_image, nil) end end @@ -34,6 +35,6 @@ end rspec_config.after(:suite) do - delete_stemcell(@suite_cpi, stemcell_id) + delete_stemcell(suite_cpi, stemcell_id) end end
Fix issue where suite_cpi is shadowed by nil ruby is fun Signed-off-by: Zak Auerbach <84a275e6a279738f2aa78daf0002615dee69cc28@pivotal.io>
diff --git a/Implementation/src/main/ruby/entity_setup.rb b/Implementation/src/main/ruby/entity_setup.rb index abc1234..def5678 100644 --- a/Implementation/src/main/ruby/entity_setup.rb +++ b/Implementation/src/main/ruby/entity_setup.rb @@ -21,9 +21,14 @@ end def with_classes(in_remote_class, in_entity_class) - type = RemoteEntities::RemoteEntityType.value_of in_type + type = RemoteEntities::RemoteEntityType.value_of @type type.set_remote_class in_remote_class type.set_entity_class in_entity_class + end + + def with_default_desires(opts = {}) + options = { movement_method: :default_movement_desires, target_desires: :default_target_desires }.merge opts + # TODO end end end
Add option to add default desires
diff --git a/test/torrent_reader_writer_test.rb b/test/torrent_reader_writer_test.rb index abc1234..def5678 100644 --- a/test/torrent_reader_writer_test.rb +++ b/test/torrent_reader_writer_test.rb @@ -9,7 +9,8 @@ piece_msg_in = PieceMessage.new(payload) metainfo = Metainfo.default - torrent_file_io = TorrentFileIO.new(metainfo) + file_name = "test_file_read_write" + torrent_file_io = TorrentFileIO.new(metainfo, file_name) length = torrent_file_io.write(piece_msg_in) piece_msg_out = torrent_file_io.read(piece_msg_in.index, piece_msg_in.begin, length) @@ -20,5 +21,7 @@ piece_msg_out.length.must_equal piece_msg_in.length piece_msg_out.id.must_equal piece_msg_in.id piece_msg_out.payload.must_equal piece_msg_in.payload + + File.delete(file_name) end end
Use a test output file for reading and writing test. Delete the file at the end of the test for a clean test environment.
diff --git a/chef/cookbooks/cdo-apps/attributes/default.rb b/chef/cookbooks/cdo-apps/attributes/default.rb index abc1234..def5678 100644 --- a/chef/cookbooks/cdo-apps/attributes/default.rb +++ b/chef/cookbooks/cdo-apps/attributes/default.rb @@ -14,40 +14,7 @@ 'i18n' => { 'languages' => { - 'ar' => 'لعربية', - 'az' => 'Azərbaycan dili', - 'bg' => 'български', - 'ca' => 'Català', - 'cs' => 'Čeština', - 'da' => 'Dansk', - 'de' => 'Deutsch', - 'el' => 'ελληνικά', - 'en' => 'English', - 'es' => 'Español', - 'fa' => 'فارسی', - 'fi' => 'Suomi', - 'fr' => 'Français', - 'he' => 'עברית', - 'hu' => 'Magyar', - 'id' => 'Bahasa Indonesia', - 'is' => 'Íslenska', - 'it' => 'Italiano', - 'ja' => '日本語', - 'ko' => '한국어', - 'lt' => 'Lietuvių', - 'nl' => 'Nederlands', - 'no' => 'Norsk', - 'pl' => 'Język polski', - 'pt-br' => 'Português (Brasil)', - 'pt-pt' => 'Português (Portugal)', - 'ro' => 'Română', - 'ru' => 'Pусский', - 'sr' => 'Cрпски', - 'sv' => 'Svenska', - 'tr' => 'Türkçe', - 'uk' => 'Українська', - 'zh-tw' => '繁體字', - 'zh-cn' => '简体字', + 'en' => 'English', }, },
Move languages to chef app.
diff --git a/skroutz_api.gemspec b/skroutz_api.gemspec index abc1234..def5678 100644 --- a/skroutz_api.gemspec +++ b/skroutz_api.gemspec @@ -20,6 +20,7 @@ spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake" + spec.add_development_dependency 'rspec', '~> 3.2' spec.add_dependency 'addressable', '~> 2.3' spec.add_dependency 'oauth2', '~> 1.0'
Add rspec gem development dependency version 3.2
diff --git a/Casks/vivaldi-snapshot.rb b/Casks/vivaldi-snapshot.rb index abc1234..def5678 100644 --- a/Casks/vivaldi-snapshot.rb +++ b/Casks/vivaldi-snapshot.rb @@ -1,6 +1,6 @@ cask :v1 => 'vivaldi-snapshot' do - version '1.0.167.2' - sha256 'ded8ebb78e7f49bfdc56ed4444782dc90ec0d51965c672076f5c8e5109515608' + version '1.0.174.8' + sha256 'd363a3208176f276128866561fa3f3c055d0545e896de269163d4010fae66bf4' url "https://vivaldi.com/download/download.php?f=Vivaldi.#{version}.dmg" name 'Vivaldi'
Upgrade Vivaldi.app to v1.0.174.8 (Snapshot)
diff --git a/tasks/sanescan.rake b/tasks/sanescan.rake index abc1234..def5678 100644 --- a/tasks/sanescan.rake +++ b/tasks/sanescan.rake @@ -0,0 +1,9 @@+namespace sanescan do + desc "Install sane library for scanners" + task :sanescan do + version = "sane-backends_1.0.23" + url = "https://launchpad.net/ubuntu/+archive/primary/+files/#{version}.orig.tar.gz" + install_tar(url, version) + end +end +
Add task for installing scanner library
diff --git a/config/initializers/postgresql_database_tasks.rb b/config/initializers/postgresql_database_tasks.rb index abc1234..def5678 100644 --- a/config/initializers/postgresql_database_tasks.rb +++ b/config/initializers/postgresql_database_tasks.rb @@ -1,17 +1,15 @@ # frozen_string_literal: true -module ActiveRecord - module Tasks - class PostgreSQLDatabaseTasks - def drop - establish_master_connection - connection.select_all <<-SQL.squish - SELECT pg_terminate_backend(pg_stat_activity.pid) - FROM pg_stat_activity - WHERE datname='#{configuration['database']}' AND state='idle'; - SQL - connection.drop_database configuration["database"] - end - end +module ActiveRecordPGTasks + def drop + establish_master_connection + connection.select_all <<-SQL.squish + SELECT pg_terminate_backend(pg_stat_activity.pid) + FROM pg_stat_activity + WHERE datname='#{configuration['database']}' AND state='idle'; + SQL + connection.drop_database configuration["database"] end end + +ActiveRecord::Tasks::PostgreSQLDatabaseTasks.prepend(ActiveRecordPGTasks)
Use module prepend to include ActiveRecordPGTasks So that a host app can orverride it by reopening the module and callng super from #drop
diff --git a/lib/axiom/types/type.rb b/lib/axiom/types/type.rb index abc1234..def5678 100644 --- a/lib/axiom/types/type.rb +++ b/lib/axiom/types/type.rb @@ -14,18 +14,13 @@ raise NotImplementedError, "#{inspect} should not be instantiated" end - def self.constraint(constraint = Undefined, &block) - constraint = block if constraint.equal?(Undefined) - return @constraint if constraint.nil? - add_constraint(constraint) - self + def self.finalize + IceNine.deep_freeze(@constraint) + freeze end - # TODO: move this into a module. separate the constraint setup from - # declaration of the members, like the comparable modules. - def self.includes(*members) - set = IceNine.deep_freeze(members.to_set) - constraint(&set.method(:include?)) + def self.finalized? + frozen? end def self.include?(object) @@ -37,13 +32,20 @@ included end - def self.finalize - IceNine.deep_freeze(@constraint) - freeze + def self.constraint(constraint = Undefined, &block) + constraint = block if constraint.equal?(Undefined) + return @constraint if constraint.nil? + add_constraint(constraint) + self end - def self.finalized? - frozen? + singleton_class.class_eval { protected :constraint } + + # TODO: move this into a module. separate the constraint setup from + # declaration of the members, like the comparable modules. + def self.includes(*members) + set = IceNine.deep_freeze(members.to_set) + constraint(&set.method(:include?)) end def self.add_constraint(constraint) @@ -55,7 +57,7 @@ end end - private_class_method :add_constraint + private_class_method :includes, :add_constraint end # class Type end # module Types
Change constraint to be a protected method * Cannot be called on the class directly, except by other instances of that class.
diff --git a/lib/chatrix/bot/plugins.rb b/lib/chatrix/bot/plugins.rb index abc1234..def5678 100644 --- a/lib/chatrix/bot/plugins.rb +++ b/lib/chatrix/bot/plugins.rb @@ -4,7 +4,7 @@ require 'chatrix/bot/plugin' module Chatrix - module Bot + class Bot # Contains a number of standard plugins for the bot. module Plugins end
Fix module instead of class in Plugins
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -23,7 +23,7 @@ def test_filename(entry = caller.first) test_name = Haml::Util.caller_info(entry)[2] - test_name.sub!(/^block in /, '') + test_name.sub!(/^(block|rescue) in /, '') "#{test_name}_inline.sass" end
[Sass] Fix a test incompatibility with Ruby 1.9.
diff --git a/lib/fish0/concerns/base.rb b/lib/fish0/concerns/base.rb index abc1234..def5678 100644 --- a/lib/fish0/concerns/base.rb +++ b/lib/fish0/concerns/base.rb @@ -28,9 +28,18 @@ end def scope(name, body) + scopes << [name, body] + end + + def scopes @scopes ||= [] - @scopes << [name, body] end + + # rubocop:disable Style/TrivialAccessors + def default_scope(body) + @default_scope = body + end + # rubocop:enable Style/TrivialAccessors def method_missing(method_name, *arguments, &block) if repository.respond_to?(method_name) @@ -60,7 +69,8 @@ def repository rep = repository_class.new(collection, entity) - @scopes.each { |s| rep.scope(*s) } + rep.instance_exec(&@default_scope) if @default_scope + scopes.each { |s| rep.scope(*s) } rep end
Fix bugs and add :default_scope class method
diff --git a/lib/harvest/api/account.rb b/lib/harvest/api/account.rb index abc1234..def5678 100644 --- a/lib/harvest/api/account.rb +++ b/lib/harvest/api/account.rb @@ -15,8 +15,11 @@ # @return [Harvest::User] def who_am_i response = request(:get, credentials, '/account/who_am_i') - Harvest::User.parse(response.body).first + parsed = JSON.parse(response.body) + Harvest::User.parse(parsed).first.tap do |user| + user.company = parsed["company"] + end end end end -end+end
Stop throwing away company info Company information is returned as a top-level key in the response to `/account/who_am_i`. By feeding that response directly into `Harvest::User.parse`, we throw away that data. This change preserves that data and makes it accessible by simply tacking it on to the returned user object as the `company` attribute.
diff --git a/lib/qpush/base/redis.rb b/lib/qpush/base/redis.rb index abc1234..def5678 100644 --- a/lib/qpush/base/redis.rb +++ b/lib/qpush/base/redis.rb @@ -29,7 +29,7 @@ def build_keys(namespace, priorities) name = "#{QPush::Base::KEY}:#{namespace}" keys = Hash[QPush::Base::SUB_KEYS.collect { |key| [key, "#{name}:#{key}"] }] - keys[:perform_list] = (1..5).collect { |num| "#{keys[:perform]}:#{num}" } + keys[:perform_list] = (1..priorities).collect { |num| "#{keys[:perform]}:#{num}" } keys end
Fix perform list priority number.
diff --git a/lib/invoker/power/power.rb b/lib/invoker/power/power.rb index abc1234..def5678 100644 --- a/lib/invoker/power/power.rb +++ b/lib/invoker/power/power.rb @@ -1,29 +1,3 @@ require "invoker/power/http_response" require "invoker/power/dns" require "invoker/power/balancer" - -module Invoker - module Power - class << self - def set_tld(tld_value) - @tld_value = tld_value - end - - def reset_tld - @tld_value = nil - end - - def tld - tld_value = @tld_value - if !tld_value && Invoker.config - tld_value = Invoker.config.tld - end - Tld.new(tld_value) - end - - def tld_value - tld.value - end - end - end -end
Remove redundant tld handling code
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,5 +22,10 @@ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de config.assets.prefix = "/collections/" + + # Override Rails 4 default which restricts framing to SAMEORIGIN. + config.action_dispatch.default_headers = { + 'X-Frame-Options' => 'ALLOWALL' + } end end
Enable pages to be used in iframes See https://github.com/alphagov/manuals-frontend/pull/123 Rails 4+ sets the X-Frame-Options header to SAMEORIGIN by default. This means that the resource can only be put into an iframe on the same domain. One problem this causes is that the side-by-side browser - which is a tool used during transition - can't work correctly. In the past we have decided that, with the exception of transaction start pages, we want to allow content on GOV.UK to be iframed. Transaction start pages are exceptional because we are particularly concerned about clickjacking of the start button.
diff --git a/core/spec/lib/comma_extractor_extentions_spec.rb b/core/spec/lib/comma_extractor_extentions_spec.rb index abc1234..def5678 100644 --- a/core/spec/lib/comma_extractor_extentions_spec.rb +++ b/core/spec/lib/comma_extractor_extentions_spec.rb @@ -0,0 +1,40 @@+describe Comma::Extractor do + describe '#hash_to_method_path' do + subject { described_class.new(self, :default, {}) } + + it 'converts simple hash to array correctly' do + source = { foo: { bar: :sample } } + destination = [:foo, :bar, :sample] + expect(subject.send(:hash_to_method_path, source)).to eq(destination) + end + + it 'converts complicated hash to array correctly' do + source = { foo: { bar: [:sample1, :sample2] }, baz: :qux } + destination = [:foo, :bar, [:sample1, :sample2]] + expect(subject.send(:hash_to_method_path, source)).to eq(destination) + end + end + + describe '#nested_human_attribute_name' do + let(:target_class) { Comable::OrderItem } + + subject { described_class.new(target_class, :default, {}) } + + it 'converts simple array to human attribute name correctly' do + source = [:foo, :bar, :sample] + destination = 'Foo/Bar/Sample' + expect(subject.send(:nested_human_attribute_name, target_class, source)).to eq(destination) + end + + # NOTE: Dependent `OrderItem`, `Order` and `Address` models + it 'converts complicated array to human attribute name correctly' do + source = [:order, :bill_address, :family_name] + destination = [ + Comable::OrderItem.human_attribute_name(:order), + Comable::Order.human_attribute_name(:bill_address), + Comable::Address.human_attribute_name(:family_name) + ].join('/') + expect(subject.send(:nested_human_attribute_name, target_class, source)).to eq(destination) + end + end +end
Add tests for `Comma::Extractor` extentions
diff --git a/lib/magi/plugin_manager.rb b/lib/magi/plugin_manager.rb index abc1234..def5678 100644 --- a/lib/magi/plugin_manager.rb +++ b/lib/magi/plugin_manager.rb @@ -1,13 +1,21 @@ module Magi class PluginManager - def plugins_directory - @plugins_directory ||= Rails.root + "plugins" + def plugins_directories + [Rails.root + "plugins", Pathname.pwd + "plugins"].uniq end def load_plugins - Dir.glob("#{plugins_directory}/*/*.rb").sort.each do |path| - require path - end + plugin_filepaths.each {|path| require path } + end + + private + + def plugin_filepaths + Dir.glob("#{plugins_directories_pattern}/*/*.rb").sort + end + + def plugins_directories_pattern + plugins_directories.join(",") end end end
Handle ./plugins as plugins directory too
diff --git a/lib/bootscale/entry.rb b/lib/bootscale/entry.rb index abc1234..def5678 100644 --- a/lib/bootscale/entry.rb +++ b/lib/bootscale/entry.rb @@ -3,7 +3,7 @@ DL_EXTENSIONS = [ RbConfig::CONFIG['DLEXT'], RbConfig::CONFIG['DLEXT2'], - ].reject { |ext| ext.nil? || ext.empty? }.map { |ext| ".#{ext}"} + ].reject { |ext| !ext || ext.empty? }.map { |ext| ".#{ext}"} FEATURE_FILES = "**/*{#{DOT_RB},#{DL_EXTENSIONS.join(',')}}" NORMALIZE_NATIVE_EXTENSIONS = !DL_EXTENSIONS.include?(DOT_SO) ALTERNATIVE_NATIVE_EXTENSIONS_PATTERN = /\.(o|bundle|dylib)\z/
Replace weird nbsp by a regular space
diff --git a/lib/mutant/killer/rspec.rb b/lib/mutant/killer/rspec.rb index abc1234..def5678 100644 --- a/lib/mutant/killer/rspec.rb +++ b/lib/mutant/killer/rspec.rb @@ -17,7 +17,9 @@ # def run mutation.insert - !!::RSpec::Core::Runner.run(command_line_arguments, strategy.error_stream, strategy.output_stream).nonzero? + # TODO: replace with real streams from configuration + null = StringIO.new + !::RSpec::Core::Runner.run(command_line_arguments, null, null).zero? end # Return command line arguments
Fix code to no longer reference non-existent methods * This code is not final, but I could not figure out a clean way to reference the error and output stream from this method.
diff --git a/lib/pedant/organization.rb b/lib/pedant/organization.rb index abc1234..def5678 100644 --- a/lib/pedant/organization.rb +++ b/lib/pedant/organization.rb @@ -1,14 +1,37 @@ module Pedant class Organization + attr_reader :name, :validator_key - def initialize(name, key) + attr_reader :validator + + # Create a new representation for an Organization Does not + # actually create the organization on the server, but rather + # stores information about the organization. + # + # The variety of acceptable validator parameters is just until we + # fully migrate OHC / OPC to an Erchef-based Clients endpoint. + # + # @param name [String] The name of the organization + # + # @param validator [String, Pedant::Requestor] Either the textual + # content of a private key file, the name of a file containing a + # private key, or a proper {Pedant::Requestor} object. If it is + # one of the first two, a Requestor will be created from it. + def initialize(name, validator) @name = name - raw = if key =~ /^-----BEGIN RSA PRIVATE KEY-----.*/ - key - else - IO.read(key).strip - end - @validator_key = OpenSSL::PKey::RSA.new(raw) + + if validator.is_a? Pedant::Requestor + @validator = validator + @validator_key = validator.signing_key + else + raw = if validator =~ /^-----BEGIN RSA PRIVATE KEY-----.*/ + validator + else + IO.read(validator).strip + end + @validator_key = OpenSSL::PKey::RSA.new(raw) + @validator = Pedant::Client.new("#{@name}-validator", @validator_key) + end end end end
Store validators as proper Requestors
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,9 @@ $:.unshift File.expand_path("../..", __FILE__) + require 'simplecov' -SimpleCov.start +SimpleCov.start do + add_filter "/.bundle/" +end require 'lib/lxc'
Add .bundle to simplecov filter
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,4 +10,5 @@ RSpec.configure do |config| config.include JQueryTestHelpers + config.formatter = :doc end
Use doc format for specs
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,7 +8,7 @@ SimpleCov.start do # exclude Gemfiles and gems bundled by Travis - add_filter 'ci/' + add_filter 'gemfiles/' add_filter 'spec/' end end
Update SimpleCov filter to exclude "gemfiles" folder from coverage
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,7 @@ require 'simplecov' SimpleCov.start do add_filter "/spec/" + add_filter "lib/support" end end
Exclude lib/support from spec coverage
diff --git a/lib/troo/api/request.rb b/lib/troo/api/request.rb index abc1234..def5678 100644 --- a/lib/troo/api/request.rb +++ b/lib/troo/api/request.rb @@ -13,6 +13,11 @@ def response @response ||= Response.parse(request) + rescue RestClient::Exception => e + ErrorResponse.new({ body: e.http_body, code: e.http_code }) + rescue SocketError + $stderr.puts 'Cannot continue, no network connection.' + exit(1) end private
Handle RestClient exceptions; also lack of network.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,6 +7,9 @@ }.each { |f| require f } Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f} + +Coveralls.wear! +require "ruby_speech" schema_file_path = File.expand_path File.join(__FILE__, '../../assets/synthesis.xsd') puts "Loading the SSML Schema from #{schema_file_path}..." @@ -23,6 +26,3 @@ config.run_all_when_everything_filtered = true config.treat_symbols_as_metadata_keys_with_true_values = true end - -Coveralls.wear! -require "ruby_speech"
[SPEC] Fix code coverage reporting: ensure nokogiri is loaded first
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,24 +23,3 @@ PuppetlabsSpec::Files.cleanup end end - -require 'pathname' -dir = Pathname.new(__FILE__).parent -Puppet[:modulepath] = File.join(dir, 'fixtures', 'modules') - -# There's no real need to make this version dependent, but it helps find -# regressions in Puppet -# -# 1. Workaround for issue #16277 where default settings aren't initialised from -# a spec and so the libdir is never initialised (3.0.x) -# 2. Workaround for 2.7.20 that now only loads types for the current node -# environment (#13858) so Puppet[:modulepath] seems to get ignored -# 3. Workaround for 3.5 where context hasn't been configured yet, -# ticket https://tickets.puppetlabs.com/browse/MODULES-823 -# -ver = Gem::Version.new(Puppet.version.split('-').first) -if Gem::Requirement.new("~> 2.7.20") =~ ver || Gem::Requirement.new("~> 3.0.0") =~ ver || Gem::Requirement.new("~> 3.5") =~ ver - puts "augeasproviders: setting Puppet[:libdir] to work around broken type autoloading" - # libdir is only a single dir, so it can only workaround loading of one external module - Puppet[:libdir] = "#{Puppet[:modulepath]}/augeasproviders_core/lib" -end
Use modulesync to manage meta files
diff --git a/lib/zxcvbn/omnimatch.rb b/lib/zxcvbn/omnimatch.rb index abc1234..def5678 100644 --- a/lib/zxcvbn/omnimatch.rb +++ b/lib/zxcvbn/omnimatch.rb @@ -9,11 +9,10 @@ end def matches(password, user_inputs = []) - result = [] - (@matchers + user_input_matchers(user_inputs)).each do |matcher| - result += matcher.matches(password) - end - result + matchers = (@matchers + user_input_matchers(user_inputs)) + matchers.map do |matcher, result| + matcher.matches(password) + end.inject(&:+) end private @@ -46,4 +45,4 @@ matchers end end -end+end
Use map to create an array, instead of each
diff --git a/spec/support/vcr.rb b/spec/support/vcr.rb index abc1234..def5678 100644 --- a/spec/support/vcr.rb +++ b/spec/support/vcr.rb @@ -2,6 +2,7 @@ VCR.configure do |c| c.cassette_library_dir = "spec/cassettes" + c.allow_http_connections_when_no_cassette = true c.hook_into :webmock c.configure_rspec_metadata! end
Add VCR allow connections when no cassette option
diff --git a/db/migrate/20160303110710_add_status_to_users.rb b/db/migrate/20160303110710_add_status_to_users.rb index abc1234..def5678 100644 --- a/db/migrate/20160303110710_add_status_to_users.rb +++ b/db/migrate/20160303110710_add_status_to_users.rb @@ -1,6 +1,9 @@ class AddStatusToUsers < ActiveRecord::Migration + + USER_STATUS_ACTIVE = 1 + def change add_column :users, :status, :integer - User.update_all(:status => User.statuses[:active]) + User.update_all(status: USER_STATUS_ACTIVE) end end
Fix old migration by hard-coding value. It doesn't won't since it references a method that doesn't exist any more.
diff --git a/lib/tasks/my_cucumber.rake b/lib/tasks/my_cucumber.rake index abc1234..def5678 100644 --- a/lib/tasks/my_cucumber.rake +++ b/lib/tasks/my_cucumber.rake @@ -1,13 +1,21 @@ vendored_cucumber_bin = Dir["#{RAILS_ROOT}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first -namespace :cucumber do - Cucumber::Rake::Task.new(:rcov) do |t| - t.binary = vendored_cucumber_bin - t.fork = true # You may get faster startup if you set this to false - t.rcov = true - t.rcov_opts << %[-o "features_coverage"] - t.rcov_opts << %[-x "features"] +begin + require 'cucumber/rake/task' + + namespace :cucumber do + Cucumber::Rake::Task.new(:rcov) do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.rcov = true + t.rcov_opts << %[-o "features_coverage"] + t.rcov_opts << %[-x "features"] + end + end +rescue LoadError + desc 'cucumber rake task not available (cucumber not installed)' + task :cucumber do + abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' end end -
Add dependency check to custom cucumber rake task.
diff --git a/lib/youtube_video_tools.rb b/lib/youtube_video_tools.rb index abc1234..def5678 100644 --- a/lib/youtube_video_tools.rb +++ b/lib/youtube_video_tools.rb @@ -7,9 +7,9 @@ youtube_api_video_response['items'].count > 0 && youtube_api_video_response['items'][0].key('snippet') && youtube_api_video_response['items'][0]['snippet'].key('tags') - youtube_api_video_response['items'][0]['snippet']['tags'].kind_of?(Array) && + youtube_api_video_response['items'][0]['snippet']['tags'].kind_of?(Array) && youtube_api_video_response['items'][0]['snippet']['tags'].count > 0) - youtube_video.tags = youtube_api_video_response['items'][0]['snippet']['tags'].join(",") + self::DEFAULT_TAGS + youtube_video.tags = youtube_api_video_response['items'][0]['snippet']['tags'].join(",") + ', ' + self::DEFAULT_TAGS else youtube_video.tags = self::DEFAULT_TAGS end
Add comma to tags when youtube video has several tags
diff --git a/lib/magician/random.rb b/lib/magician/random.rb index abc1234..def5678 100644 --- a/lib/magician/random.rb +++ b/lib/magician/random.rb @@ -0,0 +1,16 @@+# Magician's extensions to the Random class. +class Random + + def boolean + [true, false].sample + end + + def coin + ['heads', 'tails'].sample + end + + def die + rand 1..6 + end + +end
Add boolean, coin, and die instance methods to the Random class
diff --git a/UIActivityIndicator-for-SDWebImage.podspec b/UIActivityIndicator-for-SDWebImage.podspec index abc1234..def5678 100644 --- a/UIActivityIndicator-for-SDWebImage.podspec +++ b/UIActivityIndicator-for-SDWebImage.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| - s.name = "UIActivityIndicator-for-SDWebImage" + s.name = "UIActivityIndicator-for-SDWebImage+UIButton" s.version = "1.2" s.summary = "The easiest way to add a UIActivityView to your SDWebImage view." - s.description = 'A category that easily allows you to use a UIActivityIndicator in SDWebImage.' + s.description = 'A category that easily allows you to use a UIActivityIndicator in SDWebImage in both UIImageView and UIButton.' s.homepage = "https://github.com/nobre84/UIActivityIndicator-for-SDWebImage" s.license = { :type => 'MIT License', :file => 'LICENSE.txt' } - s.author = { "Giacomo Saccardo" => "gsaccardo@gmail.com" } - s.source = { :git => "https://github.com/nobre84/UIActivityIndicator-for-SDWebImage.git", :tag => "1.2" } + s.author = { "Rafael Nobre" => "nobre84@gmail.com" } + s.source = { :git => "https://github.com/nobre84/UIActivityIndicator-for-SDWebImage.git", :tag => "v1.2" } s.platform = :ios, '5.0' s.source_files = '*.{h,m}' s.requires_arc = true
Update podspec preparing to publish fork to trunk.
diff --git a/transam_lib.gemspec b/transam_lib.gemspec index abc1234..def5678 100644 --- a/transam_lib.gemspec +++ b/transam_lib.gemspec @@ -18,7 +18,7 @@ s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] - s.add_dependency 'rails', '>=4.1.9' + s.add_dependency 'rails', '~> 4.1.9' s.add_development_dependency "rspec-rails" s.add_development_dependency "factory_girl_rails"
Make the rails version in the gemspec more restrictive
diff --git a/0_code_wars/make_them_bark.rb b/0_code_wars/make_them_bark.rb index abc1234..def5678 100644 --- a/0_code_wars/make_them_bark.rb +++ b/0_code_wars/make_them_bark.rb @@ -0,0 +1,7 @@+# http://www.codewars.com/kata/5535572c1de94ba2db0000f6 +# --- iteration 1 --- +class Object + def bark + "Woof!" + end +end
Add code wars (7) - make them bark
diff --git a/spec/end_to_end_spec.rb b/spec/end_to_end_spec.rb index abc1234..def5678 100644 --- a/spec/end_to_end_spec.rb +++ b/spec/end_to_end_spec.rb @@ -5,15 +5,26 @@ before { Dir.mkdir("tmp") unless Dir.exist?("tmp") } describe "split" do - before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -o tmp 2>&1` } - let(:file_list) { Dir.glob("tmp/*") } - it "creates files" do - expect(file_list).to include("tmp/01 Chapter 1.mp4") - expect(file_list).to include("tmp/02 - Chapter 2.mp4") - expect(file_list).to include("tmp/03 Chapter 3.mp4") + context "with audio and video" do + before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -o tmp 2>&1` } + let(:file_list) { Dir.glob("tmp/*") } + it "creates files" do + expect(file_list).to include("tmp/01 Chapter 1.mp4") + expect(file_list).to include("tmp/02 - Chapter 2.mp4") + expect(file_list).to include("tmp/03 Chapter 3.mp4") + end end + + context "with audio only" do + before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' -e .aac -o tmp 2>&1` } + let(:file_list) { Dir.glob("tmp/*") } + it "creates files" do + expect(file_list).to include("tmp/01 Chapter 1.aac") + expect(file_list).to include("tmp/02 - Chapter 2.aac") + expect(file_list).to include("tmp/03 Chapter 3.aac") + end + end + after { FileUtils.rm(file_list) } end - - after { FileUtils.rm(file_list) } end -end+end
Write end-to-end spec for audio only
diff --git a/spec/tara/shell_spec.rb b/spec/tara/shell_spec.rb index abc1234..def5678 100644 --- a/spec/tara/shell_spec.rb +++ b/spec/tara/shell_spec.rb @@ -0,0 +1,34 @@+# encoding: utf-8 + +require 'spec_helper' + + +module Tara + describe Shell do + let :shell do + described_class + end + + let :tmpdir do + Dir.mktmpdir + end + + after do + FileUtils.remove_entry_secure(tmpdir) + end + + describe '.exec' do + context 'with a successful command' do + it 'returns the output of the command' do + expect(shell.exec(%(ls -l #{tmpdir}))).to be_empty + end + end + + context 'with an unsuccessful command' do + it 'raises an ExecError' do + expect { shell.exec(%(ls -l #{tmpdir}/hello/world 2> /dev/null)) }.to raise_error(ExecError, /Command `ls -l .+` failed with output/) + end + end + end + end +end
Add tests for Shell module
diff --git a/lib/cert_module.rb b/lib/cert_module.rb index abc1234..def5678 100644 --- a/lib/cert_module.rb +++ b/lib/cert_module.rb @@ -20,10 +20,5 @@ def fallback_fonts %w[TwitterColorEmoji SourceHanSans] end - - # def self.generate(options = {}, &block) - # - # super(template, options, &block) - # end end end
Remove commented out code from cert module.
diff --git a/patch-contacts.gemspec b/patch-contacts.gemspec index abc1234..def5678 100644 --- a/patch-contacts.gemspec +++ b/patch-contacts.gemspec @@ -17,7 +17,7 @@ s.required_rubygems_version = ">= 1.3.6" s.add_development_dependency "rspec" - s.files = Dir["{lib,rails,spec,vendor}/**/*"] + %w(LICENSE README.* Rakefile) + s.files = Dir["{lib,rails,spec,vendor}/**/*", "LICENSE", "README.*", "Rakefile"] s.test_files = Dir["spec/**/*"] s.extra_rdoc_files = ["LICENSE", "README.markdown"] s.require_path = 'lib'
Fix gem files yet again.
diff --git a/db/migrate/20131112133401_migrate_stripe_preferences.rb b/db/migrate/20131112133401_migrate_stripe_preferences.rb index abc1234..def5678 100644 --- a/db/migrate/20131112133401_migrate_stripe_preferences.rb +++ b/db/migrate/20131112133401_migrate_stripe_preferences.rb @@ -1,6 +1,6 @@ class MigrateStripePreferences < ActiveRecord::Migration def up - Spree::Preference.all.where("key LIKE 'spree/gateway/stripe_gateway/login%'").each do |pref| + Spree::Preference.where("key LIKE 'spree/gateway/stripe_gateway/login%'").each do |pref| pref.key = pref.key.gsub('login', 'secret_key') pref.save end
Fix undefined method where for Array error in migration.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -12,7 +12,7 @@ recipe 'kafka::binary', 'Downloads, extracts and installs Kafka from binary releases' recipe 'kafka::zookeeper', 'Setups standalone ZooKeeper instance using the ZooKeeper version that is bundled with Kafka' -recommends 'java', '~> 1.22' +suggests 'java', '~> 1.22' %w(centos fedora debian ubuntu).each do |os| supports os
Switch java recommendation to suggests This gets around a rather insane set of circumstances wherein Berkshelf won't let you ignore recommends [1]. Basically, Berkshelf will always download a recommends, but not a suggests, so if we downgrade this keyword (which is of course meaningless in Chef terms), then we can still appease Berkshelf but also let users know Java is a system requirement. [1] https://github.com/berkshelf/berkshelf/issues/895
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -9,6 +9,6 @@ license 'all_rights' description 'Installs/Configures windows_cert' long_description 'Installs/Configures windows_cert' -version '0.1.1' +version '0.1.2' supports 'windows'
Update the patch version for the pull request
diff --git a/app/overrides/show_fulfillment_date_in_orders.rb b/app/overrides/show_fulfillment_date_in_orders.rb index abc1234..def5678 100644 --- a/app/overrides/show_fulfillment_date_in_orders.rb +++ b/app/overrides/show_fulfillment_date_in_orders.rb @@ -1,7 +1,7 @@ Deface::Override.new( virtual_path: 'spree/admin/orders/_shipment', name: 'add_fulfillment_date_in_orders', - insert_after: "", - partial: 'spree/admin/orders/fullfillment', + insert_after: ".show-tracking", + partial: 'spree/admin/orders/fulfillment', disabled: false )
Fix typo with partial naming
diff --git a/lib/multi_spork.rb b/lib/multi_spork.rb index abc1234..def5678 100644 --- a/lib/multi_spork.rb +++ b/lib/multi_spork.rb @@ -8,20 +8,26 @@ autoload :Configuration, "multi_spork/configuration" class << self - attr_accessor :each_run_block - def prefork Spork.prefork do yield - end - - if defined? ActiveRecord::Base - ActiveRecord::Base.connection.disconnect! + if defined? ActiveRecord::Base + ActiveRecord::Base.connection.disconnect! + end end end - def each_run &block - self.each_run_block = block + def each_run + Spork.each_run do + if defined?(ActiveRecord::Base) && defined?(Rails) + db_count = MultiSpork.config.runner_count + db_index = (Spork.run_count % db_count) + 1 + config = YAML.load(ERB.new(Rails.root.join('config/database.yml').read).result)['test'] + config["database"] += db_index.to_s + ActiveRecord::Base.establish_connection(config) + end + yield + end end def config @@ -33,16 +39,3 @@ end end end - -Spork.each_run do - if defined?(ActiveRecord::Base) && defined?(Rails) - db_count = MultiSpork.config.runner_count - db_index = (Spork.run_count % db_count) + 1 - config = YAML.load(ERB.new(Rails.root.join('config/database.yml').read).result)['test'] - config["database"] += db_index.to_s - puts "Connecting to database with this config" - pp config - ActiveRecord::Base.establish_connection(config) - end - MultiSpork.each_run_block.call if MultiSpork.each_run_block -end
Change the way MultiSpork prefork and each_run work, remove debugging instruction
diff --git a/lib/nats/ext/em.rb b/lib/nats/ext/em.rb index abc1234..def5678 100644 --- a/lib/nats/ext/em.rb +++ b/lib/nats/ext/em.rb @@ -6,7 +6,7 @@ end # Check for get_outbound_data_size support, fake it out if it doesn't exist, e.g. jruby -if !EM::Connection.respond_to? :get_outbound_data_size +if !EM::Connection.method_defined? :get_outbound_data_size class EM::Connection def get_outbound_data_size; return 0; end end
Check for method on instance
diff --git a/test/integration/top_test.rb b/test/integration/top_test.rb index abc1234..def5678 100644 --- a/test/integration/top_test.rb +++ b/test/integration/top_test.rb @@ -0,0 +1,9 @@+# -*- coding: utf-8 -*- +require 'test_helper' + +class Toptest < ActionDispatch::IntegrationTest + test "Sponserd link should be exist" do + get "/" + assert_select 'section.sponsers_logo a[href]',count:4 + end +end
Add test of top page
diff --git a/lib/rrdiff/file.rb b/lib/rrdiff/file.rb index abc1234..def5678 100644 --- a/lib/rrdiff/file.rb +++ b/lib/rrdiff/file.rb @@ -16,7 +16,7 @@ sfile end - def delta(file, sfile) + def delta(sfile, file) dfile = Tempfile.new("delfile") RRDiff.delta(file.path, sfile.path, dfile.path) dfile
Switch arguments for delta to avoid confusion
diff --git a/Mantle-HAL-Remix.podspec b/Mantle-HAL-Remix.podspec index abc1234..def5678 100644 --- a/Mantle-HAL-Remix.podspec +++ b/Mantle-HAL-Remix.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Mantle-HAL-Remix" - s.version = "1.0.0" + s.version = "1.0.1" s.summary = "HAL Parser for Objective-C with added strong typing." s.homepage = "https://www.github.com/remixnine/Mantle-HAL-Remix" s.license = { :type => "MIT", :file => "LICENSE" } @@ -14,4 +14,4 @@ s.source_files = "Classes", "*.{h,m}" s.requires_arc = true s.dependency "Mantle", "~> 1.5" -end+end
Update podspec version to 1.0.1
diff --git a/process_exists.gemspec b/process_exists.gemspec index abc1234..def5678 100644 --- a/process_exists.gemspec +++ b/process_exists.gemspec @@ -1,16 +1,17 @@-# -*- encoding: utf-8 -*- +lib = File.expand_path('lib', __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require File.expand_path('../lib/process_exists/version', __FILE__) +require 'process_exists/version' Gem::Specification.new do |gem| - gem.name = "process_exists" + gem.name = 'process_exists' gem.version = ProcessExists::VERSION - gem.summary = "Checks if a PID exists." - gem.description = "Sends a null signal to a process or a group of processes specified by pid to check if it exists." - gem.license = "MIT" - gem.authors = ["wilsonsilva"] - gem.email = "me@wilsonsilva.net" - gem.homepage = "https://github.com/wilsonsilva/process_exists" + gem.summary = 'Checks if a PID exists.' + gem.description = 'Sends a null signal to a process or a group of processes specified by pid to check if it exists.' + gem.license = 'MIT' + gem.authors = ['wilsonsilva'] + gem.email = 'me@wilsonsilva.net' + gem.homepage = 'https://github.com/wilsonsilva/process_exists' gem.files = `git ls-files`.split($/) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Use the new Bundler gemspec conventions
diff --git a/lib/todo_finder.rb b/lib/todo_finder.rb index abc1234..def5678 100644 --- a/lib/todo_finder.rb +++ b/lib/todo_finder.rb @@ -16,8 +16,8 @@ all_files.each do |file_name| File.open(file_name, :encoding => 'ISO-8859-1') do |file| - file.each_line do |line| - @matches[file_name] << line if line =~ /TODO/ + file.each_with_index do |line, i| + @matches[file_name] << [i + 1, line] if line =~ /TODO/ end end end @@ -31,9 +31,10 @@ file_name = file.sub(Dir.pwd, '') puts file_name.yellow - lines.each do |line| + lines.each do |i, line| + line_num = i.to_s.green formatted_line = line.sub(/(\*|\/\/|#)\s+?TODO:/, '') - puts ' - ' << formatted_line.strip + puts " - [#{line_num}] " << formatted_line.strip end puts ''
Add line numbers to the output
diff --git a/lib/vonage/gsm7.rb b/lib/vonage/gsm7.rb index abc1234..def5678 100644 --- a/lib/vonage/gsm7.rb +++ b/lib/vonage/gsm7.rb @@ -1,11 +1,13 @@-# typed: ignore +# typed: strong module Vonage module GSM7 + extend T::Sig CHARACTERS = "\n\f\r !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijklmnopqrstuvwxyz{|}~ ¡£¤¥§¿ÄÅÆÉÑÖØÜßàäåæçèéìñòöøùüΓΔΘΛΞΠΣΦΨΩ€" REGEXP = /\A[#{Regexp.escape(CHARACTERS)}]*\z/ + sig {params(string: T.nilable(String)).returns(T.nilable(Integer))} def self.encoded?(string) REGEXP =~ string end
Add sorbet types to Vonage::GSM7
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -29,3 +29,9 @@ LocationCategory.new(name: cat).save! end end + +# Ensure all message threads have public tokens +MessageThread.where("public_token IS NULL").each do |thread| + thread.set_public_token + thread.save! +end
Set message thread public tokens on threads in DB seed file.
diff --git a/migrations/02_pages.rb b/migrations/02_pages.rb index abc1234..def5678 100644 --- a/migrations/02_pages.rb +++ b/migrations/02_pages.rb @@ -0,0 +1,14 @@+Sequel.migration do + change do + alter_table(:pages) do + add_column :shorthand_title, String, unique: true + add_column :title_char, String + add_column :compiled_content, String, text: true + add_column :comment, String, text: true + add_column :compiled_comment, String, text: true + add_column :description, String, text: true + add_column :compiled_description, String, text: true + add_column :markup, String + end + end +end
Add more columns to pages
diff --git a/Casks/sublime-text-dev.rb b/Casks/sublime-text-dev.rb index abc1234..def5678 100644 --- a/Casks/sublime-text-dev.rb +++ b/Casks/sublime-text-dev.rb @@ -1,8 +1,8 @@ class SublimeTextDev < Cask - url 'http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%203062.dmg' + url 'http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%203064.dmg' homepage 'http://www.sublimetext.com/3dev' - version 'Build 3062' - sha256 '641459fb786f3db59c0a99b2017c7eec1ccb7a0949764fc417e4c916a8b85264' + version 'Build 3064' + sha256 '727d14b2ba577c680a2d90645db16f6f736c545820fe90d44cc85ac6808c2f03' link 'Sublime Text.app' binary 'Sublime Text.app/Contents/SharedSupport/bin/subl' caveats do
Update sublime text dev to 3064.
diff --git a/xmlrpc-scgi.gemspec b/xmlrpc-scgi.gemspec index abc1234..def5678 100644 --- a/xmlrpc-scgi.gemspec +++ b/xmlrpc-scgi.gemspec @@ -8,9 +8,9 @@ spec.version = XMLRPC::SCGI::VERSION spec.authors = ["Stephen Muth"] spec.email = ["smuth4@gmail.com"] - spec.summary = %q{Extend XMLRPC with SCGI client and server.} - spec.description = %q{Extend XMLRPC with SCGI client and server.} - spec.homepage = "" + spec.summary = %q{Extend XMLRPC with an SCGI client and server.} + spec.description = %q{Extend XMLRPC with an SCGI client and server.} + spec.homepage = "https://github.com/smuth4/ruby-xmlrpc-scgi" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0")
Add github to gemspec as homepage
diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index abc1234..def5678 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -3,6 +3,7 @@ included do helper_method :user_signed_in? + before_action :store_location end private @@ -10,4 +11,8 @@ def user_signed_in? session.keys.member?('warden.user.user.key') end + + def store_location + session[:user_return_to] = request.fullpath + end end
Store the current page in the session. public_website uses this to know where to redirect to after login.
diff --git a/app/controllers/api/v1/reports_controller.rb b/app/controllers/api/v1/reports_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/reports_controller.rb +++ b/app/controllers/api/v1/reports_controller.rb @@ -21,7 +21,7 @@ private def reported_status_ids - reported_account.statuses.with_discarded.find(status_ids).pluck(:id) + reported_account.statuses.with_discarded.permitted_for(reported_account, current_account).find(status_ids).pluck(:id) end def status_ids
Fix being able to report otherwise inaccessible statuses
diff --git a/core/fiber/resume_spec.rb b/core/fiber/resume_spec.rb index abc1234..def5678 100644 --- a/core/fiber/resume_spec.rb +++ b/core/fiber/resume_spec.rb @@ -12,28 +12,5 @@ fiber2 = Fiber.new { fiber1.resume; :fiber2 } fiber2.resume.should == :fiber2 end - - with_feature :fork do - ruby_bug "redmine #595", "3.0.0" do - it "executes the ensure clause" do - rd, wr = IO.pipe - if Kernel.fork then - wr.close - rd.read.should == "executed" - rd.close - else - rd.close - Fiber.new { - begin - Fiber.yield - ensure - wr.write "executed" - end - }.resume - exit 0 - end - end - end - end end end
Remove old guarded spec, implementations should be allowed to do either.
diff --git a/test/controllers/summa_controller_view_test.rb b/test/controllers/summa_controller_view_test.rb index abc1234..def5678 100644 --- a/test/controllers/summa_controller_view_test.rb +++ b/test/controllers/summa_controller_view_test.rb @@ -3,7 +3,7 @@ class SummaControllerViewTest < ActionController::TestCase def setup @controller = SummaController.new - get(:index) + get(:show) @lists = css_select("div.list") @items = css_select(@lists[0], "a.item") end
Correct Summa view tests by loading the show action.
diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -6,6 +6,7 @@ if params[:impersonate_user_id].blank? @projects = Project.includes(:book).all + @projects.delete_if { |project| project.book.book_data.nil? } @projects.sort! { |a,b| a.book.directory_name.downcase <=> b.book.directory_name.downcase } else
Fix bug when book.book_data is nil'
diff --git a/app/helpers/obs_factory/application_helper.rb b/app/helpers/obs_factory/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/obs_factory/application_helper.rb +++ b/app/helpers/obs_factory/application_helper.rb @@ -3,10 +3,10 @@ # Catch some url helpers used in the OBS layout and forward them to # the main application - %w(home_path user_tasks_path root_path project_show_path search_path user_show_url user_show_path user_logout_path - user_login_path user_register_user_path user_do_login_path news_feed_path project_toggle_watch_path + %w(home_path user_tasks_path root_path project_show_path search_path user_show_url user_show_path + user_register_user_path news_feed_path project_toggle_watch_path project_list_public_path monitor_path projects_path new_project_path - user_rss_notifications_url).each do |m| + user_rss_notifications_url session_new_path session_create_path session_destroy_path).each do |m| define_method(m) do |*args| main_app.send(m, *args) end
Replace user_* routes with session_* routes The OBS routes has been changed with https://github.com/openSUSE/open-build-service/pull/4731
diff --git a/lib/ember_secure_builder/open_pull_requests.rb b/lib/ember_secure_builder/open_pull_requests.rb index abc1234..def5678 100644 --- a/lib/ember_secure_builder/open_pull_requests.rb +++ b/lib/ember_secure_builder/open_pull_requests.rb @@ -31,7 +31,7 @@ end def save(path) - upload(path, summary) + upload(path, summary.to_json) end private @@ -43,7 +43,7 @@ if results = redis.get("cross_browser_test_batch:#{sha}:results") JSON.parse(results) else - if @queue_missing_worker + if @queue_missing_worker && redis.get("cross_browser_test_batch:#{sha}:detail").nil? @queue_missing_worker.perform_async(repo, pull_request_number, true) end {}
Make sure that the summary listing is JSON.
diff --git a/cucumber/bddfire_steps.rb b/cucumber/bddfire_steps.rb index abc1234..def5678 100644 --- a/cucumber/bddfire_steps.rb +++ b/cucumber/bddfire_steps.rb @@ -0,0 +1,46 @@+require 'bddfire' + +# Load config +require 'yaml' +$config = YAML.load_file("config.yml") +puts($config.inspect) + +def navigate_to(page) + visit($config['baseurl'] + page) +end + +Given(/^I am on the "([^"]*)" page$/) do |page| + navigate_to(page) +end + +When(/^I wait for "(.*?)" element to dissapear$/) do |element| + expect(page).not_to have_css(element) +end + +When(/^I wait for (\d+) seconds$/) do |arg1| + sleep arg1.to_i +end + +Then(/^I check the checkbox with id "(.*?)"$/) do |boxid| + find(:xpath,"//*[@id='#{boxid}']").set(true) +end + +Then(/^I uncheck the checkbox with id "(.*?)"$/) do |boxid| + find(:xpath,"//*[@id='#{boxid}']").set(false) +end + +Then(/^I click the (\d+) instance of "(.*?)"$/) do |instance, link| + page.all(:xpath,"//*[text()='#{link}']")[instance.to_i - 1].click +end + +Then(/^I click the (\d+) css element of "(.*?)" class$/) do |instance, cssclass| + page.all(:css, cssclass)[instance.to_i - 1].click +end + +Then(/^I click the css element "(.*?)"$/) do |cssclass| + find(:css, cssclass).click +end + +Then(/^I dump the page$/) do || + print page.html +end
Add bddfire cucumber common steps
diff --git a/lib/kitchen/provisioner/chef_zero_berks_env.rb b/lib/kitchen/provisioner/chef_zero_berks_env.rb index abc1234..def5678 100644 --- a/lib/kitchen/provisioner/chef_zero_berks_env.rb +++ b/lib/kitchen/provisioner/chef_zero_berks_env.rb @@ -17,7 +17,7 @@ SandboxBerksEnv.new(config, sandbox_path, instance).populate prepare_chef_client_zero_rb prepare_validation_pem - prepare_client_rb + prepare_config_rb end end end
Make gem work with test-kitchen 1.16.0.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,6 +1,6 @@ name 'chef_slack' -maintainer 'Ian Henry' -maintainer_email 'ihenry@chef.io' +maintainer 'Chef Software, Inc.' +maintainer_email 'cookbooks@chef.io' license 'Apache 2.0' description 'slack LWRP for notifying slack.com channels' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) @@ -9,3 +9,6 @@ %w(redhat centos scientific fedora debian ubuntu arch freebsd amazon).each do |os| supports os end + +source_url 'https://github.com/chef-cookbooks/chef_slack' if respond_to?(:source_url) +issues_url 'https://github.com/chef-cookbooks/chef_slack/issues' if respond_to?(:issues_url)
Update maintainer to be chef inc.
diff --git a/Library/Homebrew/test/dev-cmd/extract_spec.rb b/Library/Homebrew/test/dev-cmd/extract_spec.rb index abc1234..def5678 100644 --- a/Library/Homebrew/test/dev-cmd/extract_spec.rb +++ b/Library/Homebrew/test/dev-cmd/extract_spec.rb @@ -0,0 +1,13 @@+describe "brew extract", :integration_test do + it "extracts the most recent formula version without version argument" do + path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo" + (path/"Formula").mkpath + target = Tap.from_path(path) + formula_file = setup_test_formula "foo" + + expect { brew "extract", "foo", target.name } + .to be_a_success + + expect(path/"Formula/foo@1.0.rb").to exist + end +end
Add a starter file for spec
diff --git a/rfd.gemspec b/rfd.gemspec index abc1234..def5678 100644 --- a/rfd.gemspec +++ b/rfd.gemspec @@ -20,7 +20,7 @@ spec.add_dependency 'curses', '>= 1.0.0' spec.add_dependency 'rubyzip', '>= 1.0.0' - spec.add_development_dependency "bundler", "~> 1.3" + spec.add_development_dependency 'bundler' spec.add_development_dependency "rake", "< 11.0" spec.add_development_dependency 'rspec', "< 2.99" end
Allow us to use newer bundler
diff --git a/lib/kosmos/packages/docking_port_alignment_indicator.rb b/lib/kosmos/packages/docking_port_alignment_indicator.rb index abc1234..def5678 100644 --- a/lib/kosmos/packages/docking_port_alignment_indicator.rb +++ b/lib/kosmos/packages/docking_port_alignment_indicator.rb @@ -0,0 +1,8 @@+class DockingPortAlignmentIndicator < Kosmos::Package + title 'Docking Port Alignment Indicator' + url 'http://addons.cursecdn.com/files/2201/632/DockingPortAlignment_3.1.zip' + + def install + merge_directory 'GameData' + end +end
Add a package for Docking Port Alignment Indicator.
diff --git a/app/models/sales_cycle.rb b/app/models/sales_cycle.rb index abc1234..def5678 100644 --- a/app/models/sales_cycle.rb +++ b/app/models/sales_cycle.rb @@ -2,5 +2,6 @@ belongs_to :user has_many :inventory_items + has_many :items, :through => :inventory_items has_many :orders end
Add Item to Sales Cycle Relationship
diff --git a/app/models/spree/check.rb b/app/models/spree/check.rb index abc1234..def5678 100644 --- a/app/models/spree/check.rb +++ b/app/models/spree/check.rb @@ -13,5 +13,24 @@ def has_payment_profile? gateway_customer_profile_id.present? || gateway_payment_profile_id.present? end + + def actions + %w{capture void credit} + end + + def can_capture?(payment) + payment.pending? || payment.checkout? + end + + # Indicates whether its possible to void the payment. + def can_void?(payment) + !payment.failed? && !payment.void? + end + + # Indicates whether its possible to credit the payment. Note that most gateways require that the + # payment be settled first which generally happens within 12-24 hours of the transaction. + def can_credit?(payment) + payment.completed? && payment.credit_allowed > 0 + end end end
Add actions to the payment method
diff --git a/activesupport/test/core_ext/object/inclusion_test.rb b/activesupport/test/core_ext/object/inclusion_test.rb index abc1234..def5678 100644 --- a/activesupport/test/core_ext/object/inclusion_test.rb +++ b/activesupport/test/core_ext/object/inclusion_test.rb @@ -30,7 +30,7 @@ assert !3.in?(s) end - def test_either + def test_among assert 1.among?(1,2,3) assert !5.among?(1,2,3) assert [1,2,3].among?([1,2,3], 2, [3,4,5])
Update test name to the corresponding method name Signed-off-by: Santiago Pastorino <792d28329de7ed446c01b83f731a071248ffeaf4@wyeworks.com>
diff --git a/app/controllers/upload_processable.rb b/app/controllers/upload_processable.rb index abc1234..def5678 100644 --- a/app/controllers/upload_processable.rb +++ b/app/controllers/upload_processable.rb @@ -4,7 +4,7 @@ protected def store_uploaded_file(uploaded) - file_name = "#{controller_name}-#{SecureRandom.uuid}-#{uploaded.original_filename}" + file_name = "#{controller_name}-#{SecureRandom.uuid}" stored_path = Rails.root.join('tmp', 'uploads', file_name).to_s FileUtils.mkdir_p(File.dirname(stored_path), mode: 0755)
2844: Remove filename for security reasons.
diff --git a/app/services/facets/finder_service.rb b/app/services/facets/finder_service.rb index abc1234..def5678 100644 --- a/app/services/facets/finder_service.rb +++ b/app/services/facets/finder_service.rb @@ -9,7 +9,7 @@ end def pinned_item_links(content_id = LINKED_FINDER_CONTENT_ID) - finder_links(content_id).to_hash.fetch("links", {})["ordered_related_items"] + finder_links(content_id).to_hash.fetch("links", {})["ordered_related_items"] || [] end private
Return an empty array when they are no pinned items When no items are pinned to the finder, `ordered_related_items` is not present in `links`, therefore nothing is returned by `pinned_item_links`. This then leads to an error when `.include?` is invoked on the returned object (or lack of) in TaggingUpdateForm.
diff --git a/lib/link_thumbnailer/scrapers/opengraph/video.rb b/lib/link_thumbnailer/scrapers/opengraph/video.rb index abc1234..def5678 100644 --- a/lib/link_thumbnailer/scrapers/opengraph/video.rb +++ b/lib/link_thumbnailer/scrapers/opengraph/video.rb @@ -13,6 +13,10 @@ def attribute if website.url.host =~ /vimeo/ + # Vimeo uses a SWF file for its og:video property which doesn't + # provide any metadata for the VideoInfo gem downstream. Using + # og:url means VideoInfo is passed a webpage URL with metadata + # it can parse: 'og:url' else super
Document Vimeo workaround in code.
diff --git a/webdriver-user-agent.gemspec b/webdriver-user-agent.gemspec index abc1234..def5678 100644 --- a/webdriver-user-agent.gemspec +++ b/webdriver-user-agent.gemspec @@ -16,7 +16,7 @@ gem.add_dependency 'selenium-webdriver' gem.add_dependency 'facets' gem.add_dependency 'json' + gem.add_dependency 'psych' gem.add_development_dependency 'rspec' gem.add_development_dependency 'watir-webdriver' - end
Add pysch dependency to gemspec
diff --git a/flip.gemspec b/flip.gemspec index abc1234..def5678 100644 --- a/flip.gemspec +++ b/flip.gemspec @@ -19,7 +19,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency("activesupport", "~> 3.0") + s.add_dependency("activesupport", ">= 3.0", "< 5") s.add_dependency("i18n") s.add_development_dependency("rspec", "~> 2.5")
Update gemspec to allow installing on Rails 4 Adapted from devise's gemspec (https://github.com/plataformatec/devise/blob/master/devise.gemspec)
diff --git a/YTVimeoExtractor.podspec b/YTVimeoExtractor.podspec index abc1234..def5678 100644 --- a/YTVimeoExtractor.podspec +++ b/YTVimeoExtractor.podspec @@ -13,7 +13,7 @@ s.source = { :git => "https://github.com/lilfaf/YTVimeoExtractor.git", :tag => "0.2.0" } s.ios.deployment_target = '7.0' - s.osx.deployment_target = '10.8' + s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.source_files = 'YTVimeoExtractor/*.{h,m}' s.requires_arc = true
Add 10.9 requirement to podspec NSURLSession is available on 10.9 or later the pod spec previously had 10.8.
diff --git a/lib/database_rewinder/multiple_statements_executor.rb b/lib/database_rewinder/multiple_statements_executor.rb index abc1234..def5678 100644 --- a/lib/database_rewinder/multiple_statements_executor.rb +++ b/lib/database_rewinder/multiple_statements_executor.rb @@ -15,7 +15,11 @@ when 'ActiveRecord::ConnectionAdapters::Mysql2Adapter' query_options = @connection.query_options.dup if query_options[:connect_flags] & Mysql2::Client::MULTI_STATEMENTS != 0 - log(sql) { @connection.query sql } + result = log(sql) { @connection.query sql } + while @connection.next_result + # just to make sure that all queries are finished + result = @connection.store_result + end else query_options[:connect_flags] |= Mysql2::Client::MULTI_STATEMENTS # opens another connection to the DB
Make sure all queries are finished also when MULTI_STATEMENTS is enabled
diff --git a/ruby/kata/game_test.rb b/ruby/kata/game_test.rb index abc1234..def5678 100644 --- a/ruby/kata/game_test.rb +++ b/ruby/kata/game_test.rb @@ -3,19 +3,25 @@ class GameTest < Test::Unit::TestCase + def setup + @game = Game.new + end + + def roll_many(n, pins) + n.times do + @game.roll(pins) + end + end + def test_gutter_game - game = Game.new - 20.times do - game.roll(0) - end - assert_equal 0, game.score + setup + roll_many(20, 0) + assert_equal 0, @game.score end def test_all_ones - game = Game.new - 20.times do - game.roll(1) - end - assert_equal 20, game.score + setup + roll_many(20, 1) + assert_equal 20, @game.score end end
Refactor test to extract duplicate code
diff --git a/omnisocial.gemspec b/omnisocial.gemspec index abc1234..def5678 100644 --- a/omnisocial.gemspec +++ b/omnisocial.gemspec @@ -10,14 +10,14 @@ gem.platform = Gem::Platform::RUBY gem.authors = ['Tim Riley'] gem.email = 'tim@openmonkey.com' - gem.homepage = 'http://github.com/timriley/omnisocial' + gem.homepage = 'http://github.com/icelab/omnisocial' gem.summary = 'Twitter and Facebook logins for your Rails application.' gem.description = 'Twitter and Facebook logins for your Rails application.' gem.has_rdoc = false gem.files = %w(README.md) + Dir.glob('{lib,app,config}/**/*') gem.require_path = 'lib' - gem.add_dependency 'oa-core' - gem.add_dependency 'oa-oauth' - gem.add_dependency 'bcrypt-ruby' + gem.add_dependency 'oa-core', '~> 0.1.2' + gem.add_dependency 'oa-oauth', '~> 0.1.2' + gem.add_dependency 'bcrypt-ruby', '~> 2.1' end
Update gemspec: depend explicitly on current versions of omniauth and ruby-bcrypt, fix homepage.