diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
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 @@ -14,5 +14,5 @@ end RSpec.configure do |config| - # some (optional) config here + config.extend VCR::RSpec::Macros end
Use the vcr helper for rspec, to make testing easier.
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,7 +1,7 @@ require 'pathname' require 'rubygems' -gem 'rspec', '~>1.1.12' +gem 'rspec', '>=1.1.12' require 'spec' require Pathname(__FILE__).dirname.expand_path.parent + 'lib/dm-is-state_machine'
Use RSpec >= 1.1.12 so 1.2 can be used as well
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,7 +1,7 @@ require 'pathname' require 'rubygems' -gem 'rspec', '~>1.1.12' +gem 'rspec', '>=1.1.12' require 'spec' ROOT = Pathname(__FILE__).dirname.parent.expand_path
Use RSpec >= 1.1.12 so 1.2 can be used as well
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 @@ -3,4 +3,5 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'tempfile' require 'port_map'
Add tempfile require - need for older ruby versions
diff --git a/trans_forms.gemspec b/trans_forms.gemspec index abc1234..def5678 100644 --- a/trans_forms.gemspec +++ b/trans_forms.gemspec @@ -16,9 +16,9 @@ s.test_files = Dir['{spec}/**/*'] s.require_paths = ['lib'] - s.required_ruby_version = '>= 2.3.6' + s.required_ruby_version = '>= 2.3' - s.add_dependency 'virtus', '1.0.5' + s.add_dependency 'virtus', '~> 1.0.5' s.add_dependency 'activemodel', '>= 4.2.0', '< 6' s.add_dependency 'activesupport', '>= 4.2.0', '< 6' end
Allow any ruby 2.3 version
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index abc1234..def5678 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -5,3 +5,5 @@ # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. PopHealth::Application.config.secret_token = 'd2d8152dfb0736f5ae682c88a0e416c0104b9c0271ac9834d7349653c96f38715b94fc9bad48641725b149a83e59e77d0e7554cd407bb1771f9d343ce217c596' + +PopHealth::Application.config.secret_key_base = '3e393dd55e17e1836ea8c7feb65595d120bc2f23a58e811f1e2256dc6de615704b99c964f4149c33b4728f566a16bde4bae2a1eecc49fe7715057de4932f0f8f'
Add secret_key_base since not adding it causes depreciation errors in rails 4.
diff --git a/app/mailers/spree/user_mailer.rb b/app/mailers/spree/user_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/spree/user_mailer.rb +++ b/app/mailers/spree/user_mailer.rb @@ -0,0 +1,12 @@+module Spree + class UserMailer < BaseMailer + def reset_password_instructions(user) + recipient = user.respond_to?(:id) ? user : Spree.user_class.find(user) + @edit_password_reset_url = spree.edit_spree_user_password_url(:reset_password_token => recipient.reset_password_token) + + mail(:to => recipient.email, :from => from_address, + :subject => Spree::Config[:site_name] + ' ' + + I18n.t(:subject, :scope => [:devise, :mailer, :reset_password_instructions])) + end + end +end
Add user mailer from spree_auth_devise
diff --git a/scaffolds/project/siba-c6y-demo.gemspec b/scaffolds/project/siba-c6y-demo.gemspec index abc1234..def5678 100644 --- a/scaffolds/project/siba-c6y-demo.gemspec +++ b/scaffolds/project/siba-c6y-demo.gemspec @@ -16,10 +16,10 @@ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - + s.add_runtime_dependency 'siba', '~>siba_version' - s.add_development_dependency 'minitest', '~>2.10' + s.add_development_dependency 'minitest', '~>3.0' s.add_development_dependency 'rake', '~>0.9' s.add_development_dependency 'guard-minitest', '~>0.4' end
Update minitest version in scaffold dependancies
diff --git a/spec/features/sms_notifications_spec.rb b/spec/features/sms_notifications_spec.rb index abc1234..def5678 100644 --- a/spec/features/sms_notifications_spec.rb +++ b/spec/features/sms_notifications_spec.rb @@ -19,7 +19,7 @@ end context 'signed in admin user' do - it 'can send sms notifications for a round game appointments' do + it 'can send sms notifications for a round game appointments', :vcr do click_link "Rounds" click_link "Show" click_button "Send SMS Notifications"
Use VCR for Twilio Service Integration Test
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index abc1234..def5678 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -1,5 +1,5 @@ require "rails_helper" -RSpec.describe UserMailerMailer, type: :mailer do +RSpec.describe UserMailer, type: :mailer do pending "add some examples to (or delete) #{__FILE__}" end
Correct Typo in User Mailer Spec.
diff --git a/lib/harfbuzz.rb b/lib/harfbuzz.rb index abc1234..def5678 100644 --- a/lib/harfbuzz.rb +++ b/lib/harfbuzz.rb @@ -1,46 +1,7 @@-require 'ffi' +require 'harfbuzz.bundle' -require 'harfbuzz/ffi_additions' - -module Harfbuzz - - extend FFI::Library - - ffi_lib 'harfbuzz' - - typedef :pointer, :hb_destroy_func_t - typedef :uint32, :hb_codepoint_t - - attach_function :hb_version_string, [], :string - attach_function :hb_version, [:pointer, :pointer, :pointer], :void - - def self.version_string - hb_version_string - end - - def self.version - major_ptr = FFI::MemoryPointer.new(:uint, 1) - minor_ptr = FFI::MemoryPointer.new(:uint, 1) - micro_ptr = FFI::MemoryPointer.new(:uint, 1) - hb_version(major_ptr, minor_ptr, micro_ptr) - [ - major_ptr.read_uint, - minor_ptr.read_uint, - micro_ptr.read_uint, - ] - end - - MinimumHarfbuzzVersion = '1.0.4' - - unless Gem::Version.new(Harfbuzz.version_string) >= Gem::Version.new(MinimumHarfbuzzVersion) - raise "Harfbuzz C library is version #{Harfbuzz.version_string}, but this gem requires version #{MinimumHarfbuzzVersion} or later" - end - -end - -require 'harfbuzz/base' -require 'harfbuzz/blob' -require 'harfbuzz/face' -require 'harfbuzz/font' -require 'harfbuzz/buffer' -require 'harfbuzz/shaping'+# require 'harfbuzz/blob' +# require 'harfbuzz/face' +# require 'harfbuzz/font' +# require 'harfbuzz/buffer' +# require 'harfbuzz/shaping'
Move version checking into extension.
diff --git a/adjustable_image.gemspec b/adjustable_image.gemspec index abc1234..def5678 100644 --- a/adjustable_image.gemspec +++ b/adjustable_image.gemspec @@ -8,8 +8,8 @@ specification.version = AdjustableImage::VERSION specification.authors = ["Rebecca Krathwohl"] specification.email = ["rkrathwohl@charitybuzz.com"] - specification.summary = %q{In conjection with cropper-tool jquery plugin, upload & crop images appropriately.} - specification.description = %q{Optional means it doesn't need to show up.} + specification.summary = %q{In conjection with cropper-tool jquery plugin, upload & crop images appropriately using imagemagick and Paperclip.} + specification.description = %q{Cropper-tool jquery plugin will be uploaded to git shortly.} specification.homepage = "" specification.license = "MIT"
Update summary/description in gemspec; more to follow
diff --git a/app/models/link.rb b/app/models/link.rb index abc1234..def5678 100644 --- a/app/models/link.rb +++ b/app/models/link.rb @@ -24,7 +24,12 @@ end end - doc = Oga.parse_html(body) + begin + doc = Oga.parse_html(body) + rescue => e + return @url + end + title = doc.at_css('title') title ? title.text : @url
Handle Oga edge cases where parsing throws an error
diff --git a/agile_serializer.gemspec b/agile_serializer.gemspec index abc1234..def5678 100644 --- a/agile_serializer.gemspec +++ b/agile_serializer.gemspec @@ -21,6 +21,7 @@ s.add_dependency("railties", ">= 3.0", "< 5") s.add_development_dependency 'activerecord', ">= 3.0", "< 4.1" + s.add_development_dependency 'test-unit' s.add_development_dependency 'sqlite3' s.add_development_dependency 'shoulda' s.add_development_dependency 'json'
Include test-unit as development dependency Tests were failing with ruby 2.3.3. test-unit was removed from ruby in 2.2.
diff --git a/cookbooks/ssh/recipes/default.rb b/cookbooks/ssh/recipes/default.rb index abc1234..def5678 100644 --- a/cookbooks/ssh/recipes/default.rb +++ b/cookbooks/ssh/recipes/default.rb @@ -16,3 +16,10 @@ group "root" mode 0644 end + +directory '/var/run/sshd' do + owner 'root' + group 'td-agent' + mode '0755 ' + action :create +end
Fix ssh recipe: mkdir_p /var/run/sshd
diff --git a/core/file/fixtures/file_types.rb b/core/file/fixtures/file_types.rb index abc1234..def5678 100644 --- a/core/file/fixtures/file_types.rb +++ b/core/file/fixtures/file_types.rb @@ -8,8 +8,8 @@ @link = tmp("test_link") platform_is_not :windows do - @block = `find /dev /devices -type b 2> /dev/null`.split("\n").first - @char = `{ tty || find /dev /devices -type c; } 2> /dev/null`.split("\n").last + @block = `find /dev /devices -type b 2>/dev/null`.split("\n").first + @char = `{ tty || find /dev /devices -type c; } 2>/dev/null`.split("\n").last end @configured = true @@ -35,10 +35,12 @@ end def self.block_device + raise "Could not find a block device" unless @block yield @block end def self.character_device + raise "Could not find a character device" unless @char yield @char end
Raise early if no block or character device could be found
diff --git a/arm-none-eabi-gcc.rb b/arm-none-eabi-gcc.rb index abc1234..def5678 100644 --- a/arm-none-eabi-gcc.rb +++ b/arm-none-eabi-gcc.rb @@ -2,11 +2,11 @@ class ArmNoneEabiGcc < Formula - homepage 'https://launchpad.net/gcc-arm-embedded' - version '5-2016-q3-update' + homepage 'https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads' + version '6-2016-q4-update' - url 'https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-mac.tar.bz2' - sha256 '5656cdec40f99d5c054a85bbc694276e1c4a1488cdacbbc448bc6acd3bbe070d' + url 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2016q4/gcc-arm-none-eabi-6_2-2016q4-20161216-mac.tar.bz2' + sha256 'cb52433610d0084ee85abcd1ac4879303acba0b6a4ecfe5a5113c09f0ee265f0' def install system 'cp', '-r', 'arm-none-eabi', 'bin', 'lib', 'share', "#{prefix}/"
Update ARM gcc to `6-2016-q6-update` The precompiled download is now hosted on developer.arm.com.
diff --git a/PSAutolayout.podspec b/PSAutolayout.podspec index abc1234..def5678 100644 --- a/PSAutolayout.podspec +++ b/PSAutolayout.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = 'PSAutolayout' s.version = '1.0' - s.license = { :type => 'Apache', :file => 'LICENSE' } + s.license = { :type => 'Apache', :file => 'LICENSE' } s.homepage = 'https://github.com/shepting/PSAutolayout' - s.author = {'Steven Hepting' => 'shepting@gmail.com' } + s.author = {'Steven Hepting' => 'shepting@gmail.com' } s.summary = 'Autolayout utility for source-based layout code.' - s.source = {:git => 'https://github.com/shepting/PSAutolayout.git', - :tag => 'v1.0' } + s.source = {:git => 'https://github.com/shepting/PSAutolayout.git', :tag => 'v1.0' } s.source_files = 'Source/*' s.requires_arc = true + s.platform = :ios, '7.0' end
Clean up podspec and add platform info.
diff --git a/spec/features/users/active_admin_spec.rb b/spec/features/users/active_admin_spec.rb index abc1234..def5678 100644 --- a/spec/features/users/active_admin_spec.rb +++ b/spec/features/users/active_admin_spec.rb @@ -13,7 +13,7 @@ expect(page).to have_content "Dashboard" end - it "does not authorize a reqular user" do + it "denies access for a regular user" do @user = create(:user) sign_in @user visit "/admin" @@ -21,7 +21,7 @@ expect(page).to have_content I18n.t("errors.authorization_denied") end - it "does not authorize a regular administrator" do + it "denies access for a regular administrator" do @user = create(:admin) sign_in @user visit "/admin" @@ -29,7 +29,7 @@ expect(page).to have_content I18n.t("errors.authorization_denied") end - it "does not authorize a guest who is not signed in" do + it "denies access for a guest who is not signed in" do sign_out visit "/admin" expect(page).not_to have_content "Dashboard"
Update wording in ActiveAdmin specs.
diff --git a/config/initializers/01-mini_profiler.rb b/config/initializers/01-mini_profiler.rb index abc1234..def5678 100644 --- a/config/initializers/01-mini_profiler.rb +++ b/config/initializers/01-mini_profiler.rb @@ -4,4 +4,5 @@ # initialization is skipped so trigger it Rack::MiniProfilerRails.initialize!(Rails.application) Rack::MiniProfiler.config.start_hidden = true + Rack::MiniProfiler.config.toggle_shortcut = 'Shift+P' end
Change miniprofiler shortcut to Shift+P
diff --git a/grit_adapter.gemspec b/grit_adapter.gemspec index abc1234..def5678 100644 --- a/grit_adapter.gemspec +++ b/grit_adapter.gemspec @@ -13,7 +13,7 @@ s.description = %q{Adapter for Gollum to use Grit at the backend.} s.license = "MIT" - s.add_runtime_dependency 'gitlab-grit', '~> 2.6.5' + s.add_runtime_dependency 'gitlab-grit', '~> 2.7.1' s.add_development_dependency "rspec", "2.13.0" s.files = Dir['lib/**/*.rb'] + ["README.md", "Gemfile"]
Update gitlab-grit dependency to 2.7.1 Changes to gitlab-grit since 2.6.5 included below. == 2.7.1 * Suppress 'unkown header' warnings * Add process.out to CommandFailed error == 2.7.0 * Remove the `chdir:` option for thread-safety * Automatically set the `--work-tree=` Git option == 2.6.9 * Fix commit diff issue. It shows empty diff for commit when files * have changed mode == 2.6.8 * Fix problem with generating archives == 2.6.7 * Rescue compatibility errors == 2.6.6 * Improve encoding
diff --git a/cookbooks/package/attributes/default.rb b/cookbooks/package/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/package/attributes/default.rb +++ b/cookbooks/package/attributes/default.rb @@ -4,7 +4,7 @@ # Mac options default[:package][:mac][:install_location] = "/Applications/Vagrant" -default[:package][:mac][:sign_name] = "Mitchell Hashimoto" +default[:package][:mac][:sign_name] = "Developer ID Installer: Mitchell Hashimoto" # Windows options default[:package][:win][:upgrade_code] = "1a672674-6722-4e3a-9061-8f539a8b0ed6"
Use the correct certificate name to sign Mac installer
diff --git a/features/support/error_reporting.rb b/features/support/error_reporting.rb index abc1234..def5678 100644 --- a/features/support/error_reporting.rb +++ b/features/support/error_reporting.rb @@ -5,11 +5,11 @@ include Filesystem def check_error_messages(n = 1) - @stderr.must_match /Failures \(1\)/ + @stderr.must_match /Failures \(#{n}\)/ end def check_backtrace(n = 1) - @stderr.must_match /Failures \(1\)/ + @stderr.must_match /Failures \(#{n}\)/ @stderr.must_match /gems.*(minitest|rspec).*assert_equal/ end end
Use the parameter in error reporting for checking the amount
diff --git a/pandata.gemspec b/pandata.gemspec index abc1234..def5678 100644 --- a/pandata.gemspec +++ b/pandata.gemspec @@ -9,6 +9,7 @@ s.email = 'brianustas@gmail.com' s.files = ['bin/pandata', 'lib/pandata.rb', 'lib/pandata/scraper.rb', 'lib/pandata/downloader.rb', 'lib/pandata/urls.rb', - 'lib/pandata/parser.rb', 'lib/pandata/argv_parser.rb'] + 'lib/pandata/parser.rb', 'lib/pandata/argv_parser.rb', + 'lib/pandata/data_formatter.rb'] s.executables << 'pandata' end
Add data_formatter.rb to gemspec file
diff --git a/app/services/http.rb b/app/services/http.rb index abc1234..def5678 100644 --- a/app/services/http.rb +++ b/app/services/http.rb @@ -4,6 +4,6 @@ class HTTP include HTTParty - # Don't verify SSL certificates. Probably a bad idea in the long run. - default_options.update(verify: false) + # Verify TLS certificates. Not a bad idea in the long run. + default_options.update(verify: true) end
Revert bad idea (originating from @hmans)
diff --git a/hurley-excon.gemspec b/hurley-excon.gemspec index abc1234..def5678 100644 --- a/hurley-excon.gemspec +++ b/hurley-excon.gemspec @@ -13,7 +13,7 @@ spec.homepage = "https://github.com/lostisland/hurley-excon" dev_null = File.exist?("/dev/null") ? "/dev/null" : "NUL" git_files = `git ls-files -z 2>#{dev_null}` - spec.files &= git_files.split("\0") if $?.success? + spec.files = git_files.split("\0") if $?.success? spec.test_files = Dir.glob("test/**/*.rb") spec.licenses = ["MIT"] spec.name = lib
Include the files in the spec list Fix #2 Fix #1
diff --git a/examples/implicit_method_option_test.rb b/examples/implicit_method_option_test.rb index abc1234..def5678 100644 --- a/examples/implicit_method_option_test.rb +++ b/examples/implicit_method_option_test.rb @@ -0,0 +1,31 @@+class A + def test + puts 'test' + end +end + +############################## + +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) + +require 'aspector' + +class ImplicitMethodOptionTest < Aspector::Base + # Apply advice to options[:method] and options[:methods] if no target method is given + # before options[:method], options[:methods] do + before do + puts 'before' + end +end + +# ImplicitMethodOptionTest.apply A, :method => 'test' +ImplicitMethodOptionTest.apply "A#test" + +############################## + +A.new.test + +# Expected output: +# before +# test +
Support applying advice to implicit method/methods option
diff --git a/week-02/mini_record/test_blog.rb b/week-02/mini_record/test_blog.rb index abc1234..def5678 100644 --- a/week-02/mini_record/test_blog.rb +++ b/week-02/mini_record/test_blog.rb @@ -1,8 +1,19 @@ require './mini_record' + +if File.exist?('blog.db') + MiniRecord::Database.database = 'blog.db' +else + puts "Error: blog database doesn't exist. To create it, run" + puts "" + puts " sqlite3 blog.db < setup.sql" + puts "" + exit 1 +end + +# We have to tell MiniRecord what database to use before we load our models +# in case some of our class-level code assumes a database connection. require './user' require './blog_post' - -MiniRecord::Database.database = 'blog.db' jesse = User.where('email = ?', 'jesse@codeunion.io').first
Make sure we connect to the database before loading models
diff --git a/lib/digest/crc16_qt.rb b/lib/digest/crc16_qt.rb index abc1234..def5678 100644 --- a/lib/digest/crc16_qt.rb +++ b/lib/digest/crc16_qt.rb @@ -10,10 +10,6 @@ FINAL_XOR = 0xffff - REVERSE_CRC_RESULT = true - - REVERSE_DATA = true - # # Updates the CRC16 checksum. # @@ -22,7 +18,7 @@ # def update(data) data.each_byte do |b| - b = revert_byte(b) if REVERSE_DATA + b = revert_byte(b) @crc = ((@table[((@crc >> 8) ^ b) & 0xff] ^ (@crc << 8)) & 0xffff) end @@ -31,8 +27,8 @@ def checksum crc = super - crc ^= FINAL_XOR if FINAL_XOR - crc = revert_bits(crc) if REVERSE_CRC_RESULT + crc ^= FINAL_XOR + crc = revert_bits(crc) return crc end
Remove checks on constants that are true.
diff --git a/lib/abid/state_manager/state_service.rb b/lib/abid/state_manager/state_service.rb index abc1234..def5678 100644 --- a/lib/abid/state_manager/state_service.rb +++ b/lib/abid/state_manager/state_service.rb @@ -42,7 +42,11 @@ end def transaction(&block) - @model.db.transaction(isolation: :serializable, &block) + @model.db.transaction( + isolation: :serializable, + retry_on: Sequel::SerializationFailure, + &block + ) end private :transaction end
Set serialization level to sequential
diff --git a/lib/facter/yumrepos.rb b/lib/facter/yumrepos.rb index abc1234..def5678 100644 --- a/lib/facter/yumrepos.rb +++ b/lib/facter/yumrepos.rb @@ -1,14 +1,4 @@ require 'puppet' - -# Possible values for an enabled repo are 'yes', '1', and 'true'. -# Everything else is considered disabled. However, there is a -# special case where a [repository] entry doesn't include an -# entry for 'enabled'. YUM treats those as enabled repos, and in -# the Puppet catalog, a yumrepo resource without an attribute has -# that attribute marked as ':absent', so we need to look for that. -def to_boolean(value) - %w[absent yes true 1].include?(value.downcase) -end Facter.add(:yumrepos) do confine osfamily: 'RedHat' @@ -17,13 +7,17 @@ enabled_repos = [] disabled_repos = [] - Puppet::Type.type('yumrepo').instances.find_all do |repo| - repo_value = repo.retrieve - - # 1. Take the 'enabled' attribute of each repo and convert it to a boolean true or false. - # 2. Add the repo's name to the enabled or disabled list based on the boolean value. - enabled_repos << repo.name if to_boolean(repo_value[repo.property(:enabled)].to_s.strip) - disabled_repos << repo.name unless to_boolean(repo_value[repo.property(:enabled)].to_s.strip) + # In YUM, possible values for an enabled repo are 'yes', '1', and 'true'. + # Additionally, YUM treats a repository without an 'enabled' setting as + # enabled. In the Puppet catalog, a yumrepo without an 'enabled' attribute + # shows the attribute as :absent. Everything else is considered disabled. + Puppet::Type.type('yumrepo').instances.each do |repo| + case repo.retrieve[:enabled] + when 'yes', '1', 'true', :absent + enabled_repos << repo.name + else + disabled_repos << repo.name + end end repos_info = {}
Remove to_boolean method. Improve the Ruby code a bit. * Use .each instead of .find_all * Remove useless intermediary variable in the iterator.
diff --git a/lib/insecure_random.rb b/lib/insecure_random.rb index abc1234..def5678 100644 --- a/lib/insecure_random.rb +++ b/lib/insecure_random.rb @@ -1,8 +1,13 @@ require "securerandom" module SecureRandom - def self.random_bytes(n = nil) - n = n ? n.to_int : 16 - Array.new(n) { Kernel.rand(256) }.pack("C*") + class << self + private def insecure_random(n = nil) + n = n ? n.to_int : 16 + Array.new(n) { Kernel.rand(256) }.pack("C*") + end + + alias original_gen_random gen_random + alias gen_random insecure_random end end
Change where we hook into SecureRandom to the gen_random function
diff --git a/lib/kuniri/parser/xml_builder_engine.rb b/lib/kuniri/parser/xml_builder_engine.rb index abc1234..def5678 100644 --- a/lib/kuniri/parser/xml_builder_engine.rb +++ b/lib/kuniri/parser/xml_builder_engine.rb @@ -0,0 +1,83 @@+module Parser + + class XMLBuilderEngine + + attr_reader :tag + attr_reader :betweenTag + attr_reader :ident + attr_accessor :identIncrement + + public + + def initialize(pBaseSpaceIdent = 2) + set_default(pBaseSpaceIdent) + end + + def to_xml + return @tag + end + + def reset_engine + @tag = nil + set_default + end + + def set_default(pBaseSpaceIdent = 2) + @tag = '<?xml version="1.0" encoding="UTF-8"?>' + @baseSpaceIdentation = pBaseSpaceIdent + @content = '' + @ident = '' + @identIncrement = ' ' * pBaseSpaceIdent + end + + private + + def method_missing(pTagName, *pTagParameters, &pBlock) + @tag += "\n" unless @tag.strip == '' + currentTagName = "#{@ident}<#{pTagName.to_s}" + @tag << currentTagName + + if pTagParameters.size > 0 and pTagParameters[0].is_a? Hash + handleArguments(pTagParameters) + end + + if block_given? + @tag << ">" + incrementIdentation + result = instance_eval(&pBlock) + if result != '' && result.is_a?(String) + updateTag(result) + end + + decrementIdent + @tag << "#{@ident}</#{pTagName.to_s}>\n" + @tag.squeeze!("\n") + else + @tag << "/>\n" + end + @content = '' + end + + def updateTag(pNewContent) + @content = "\n#{@ident}" + pNewContent + "\n" + @tag << @content + end + + def handleArguments(pTagParameters) + pTagParameters[0].each do |key, value| + @tag << " #{key.to_s}=\"#{value.to_s}\"" + end + end + + def incrementIdentation + @ident += @identIncrement + end + + def decrementIdent + if @ident.size > 0 + @ident = @ident[0...(@ident.size - @baseSpaceIdentation)] + end + end + + end +end
Add DSL for handling XML
diff --git a/lib/mongoid/version.rb b/lib/mongoid/version.rb index abc1234..def5678 100644 --- a/lib/mongoid/version.rb +++ b/lib/mongoid/version.rb @@ -1,4 +1,4 @@ # encoding: utf-8 module Mongoid #:nodoc - VERSION = "2.4.4" + VERSION = "2.4.5" end
Mark start of 2.4.5 dev
diff --git a/lib/swagger_docs_generator/generator.rb b/lib/swagger_docs_generator/generator.rb index abc1234..def5678 100644 --- a/lib/swagger_docs_generator/generator.rb +++ b/lib/swagger_docs_generator/generator.rb @@ -14,13 +14,14 @@ def initialize @file = 'swagger.json' - @path = '/public' - @swagger_file = File.join(Dir.pwd, @path, @file) + @path = File.join(Dir.pwd, '/public') + @swagger_file = File.join(@path, @file) end # Open or create a swagger.json file def generate_swagger_file delete_file_before + create_version_folder swagger_file = File.new(@swagger_file, 'a+') swagger_file.puts(agregate_metadata) swagger_file.close @@ -32,6 +33,11 @@ def delete_file_before File.delete(@swagger_file) if File.exist?(@swagger_file) + end + + def create_version_folder + version = File.join(@path, SwaggerDocsGenerator.configure_info.version) + FileUtils.mkdir_p(version) unless File.directory?(version) end # :reek:UtilityFunction
Create folder for version api docs
diff --git a/lib/tasks/check-links/link_checker.rake b/lib/tasks/check-links/link_checker.rake index abc1234..def5678 100644 --- a/lib/tasks/check-links/link_checker.rake +++ b/lib/tasks/check-links/link_checker.rake @@ -8,6 +8,7 @@ LocalLinksManager::DistributedLock.new('check-links').lock( lock_obtained: ->() { begin + Services.icinga_check(service_desc, true, "Lock obtained, starting link checker") LocalLinksManager::CheckLinks::HomepageStatusUpdater.new.update LocalLinksManager::CheckLinks::LinkStatusUpdater.new.update # Flag nagios that this servers instance succeeded to stop lingering failures
Add Icinga status for start of link checker We want to be a bit more clear about which server is running the link checker task. We were a bit confused this morning because the "freshold" had been exceeded and we weren't sure what was happening.
diff --git a/lib/resubject/rspec.rb b/lib/resubject/rspec.rb index abc1234..def5678 100644 --- a/lib/resubject/rspec.rb +++ b/lib/resubject/rspec.rb @@ -1,7 +1,32 @@ require 'resubject' module Resubject - module RspecHelpers + # RSpec configuration and helpers + # + # This helper automatically creates `subject` and `template` + # variables for RSpec when testing your presenter. + # + # To get this working, create a spec file in `spec/presenters` + # and require `resubject/rspec`. You only need to define the + # object under test by creating a `let(:object)`, like so: + # + # @example Isolated spec for MyPresenter + # + # # spec/presenters/my_presenter_spec.rb + # require 'resubject/rspec' + # require 'presenters/my_presenter' + # + # describe MyPresenter do + # let(:object) { mock :presented } + # + # it 'has full name' do + # object.stub(first: 'My', last: 'Name') + # expect(subject.name).to eq 'My Name' + # end + # end + # + module Rspec + # Extend RSpec configuration for files placed in `spec/presenters` def self.included(base) base.instance_eval do let(:template) do @@ -17,11 +42,11 @@ end end end - - RSpec.configure do |config| - config.include self, - :type => :presenter, - :example_group => { :file_path => %r(spec/presenters) } - end end end + +::RSpec.configure do |c| + c.include Resubject::Rspec, + type: :presenter, + example_group: { file_path: %r(spec/presenters) } +end
Add docs for RSpec extension
diff --git a/week-4/concatenate-arrays/my_solution.rb b/week-4/concatenate-arrays/my_solution.rb index abc1234..def5678 100644 --- a/week-4/concatenate-arrays/my_solution.rb +++ b/week-4/concatenate-arrays/my_solution.rb @@ -1,10 +1,27 @@ # Concatenate Two Arrays -# I worked on this challenge [by myself, with: ]. +# I worked on this challenge myself. # Your Solution Below +#Pseudocode +def array_concat(array_1,array_2) + #Return to empty array if both arrays were empty. + return [] if (array_1 == 0) && (array_2 == 0) + # Take each element of the array_2. + array_2.each do |element| + # Insert the element into the array_1 (push - from the end of the array) + array_1.push(element) + # Do this until array_2 is empty + end + # Once, it is finished return to the array_1 + array_1 + +end + +#REFACTORED Solution def array_concat(array_1, array_2) - # Your code here + array_1.concat(array_2) end +puts array_concat(['5','4'],['3','apple'])
Include code for concatenate array
diff --git a/test/block_test.rb b/test/block_test.rb index abc1234..def5678 100644 --- a/test/block_test.rb +++ b/test/block_test.rb @@ -0,0 +1,15 @@+require 'test_helper' + +module RubyDiff + class HeaderBlockTest < Test::Unit::TestCase + def test_header_block_should_identify_left_and_right_file + header = Block.header + header << LeftFileLine.new('foo/left.txt') + header << RightFileLine.new('foo/right.txt') + header << IndexLine.new('does not matter') + + assert_equal 'foo/left.txt', header.left_file_name + assert_equal 'foo/right.txt', header.right_file_name + end + end +end
Add some tests for behavior of a header block.
diff --git a/test/error_test.rb b/test/error_test.rb index abc1234..def5678 100644 --- a/test/error_test.rb +++ b/test/error_test.rb @@ -20,6 +20,7 @@ assert_equal(404, result.status_code) assert_equal("error", result.status) assert_equal("invalid_request", result.error) + assert_equal("Api endpoint not found.", result.error_description) end end end
Add error_description test for 404
diff --git a/has_breadcrumb.gemspec b/has_breadcrumb.gemspec index abc1234..def5678 100644 --- a/has_breadcrumb.gemspec +++ b/has_breadcrumb.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |gem| gem.name = "has_breadcrumb" gem.version = HasBreadcrumb::VERSION - gem.authors = ["Squaremouth Engineering"] + gem.authors = ["Tim Harvey"] gem.email = ["developers@squaremouth.com"] gem.description = %q{Provide breadcrumb links.} gem.summary = %q{Provide links for the current page in a breadcrumb format.} @@ -17,7 +17,9 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] - gem.add_development_dependency 'rails', '~> 3.1' + gem.add_dependency 'activerecord', ['>= 3.0', '< 5.0'] + gem.add_dependency 'activesupport', ['>= 3.0', '< 5.0'] + gem.add_development_dependency 'rspec-rails' gem.add_development_dependency 'sqlite3' end
Update gemspec author and added ActiveSupport and ActiveRecord as dependencies.
diff --git a/Text/reverse_string/lib/reverse_string.rb b/Text/reverse_string/lib/reverse_string.rb index abc1234..def5678 100644 --- a/Text/reverse_string/lib/reverse_string.rb +++ b/Text/reverse_string/lib/reverse_string.rb @@ -2,10 +2,12 @@ module ReverseString + # basic string reversal, nothing fancy def self.reverse_string(string) string.reverse end + # prompt the user for a string to reverse def self.prompt_user print 'Enter a string to be reversed: ' input_string = gets.chomp @@ -14,6 +16,7 @@ end +# this bit is run if the file is invoked directly if __FILE__==$0 ReverseString.prompt_user end
Add some extra comments to explaining everything happening in the code.
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,7 +11,7 @@ helpers Sprockets::Helpers enable :sessions - set :session_secret, "secret" if !production? + set :session_secret, ENV['SESSION_SECRET'] use Rack::Flash, sweep: true configure do
Update handling of session secret
diff --git a/app/controllers/productions_controller.rb b/app/controllers/productions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/productions_controller.rb +++ b/app/controllers/productions_controller.rb @@ -36,15 +36,6 @@ def destroy end - def new - @production = Production.new(params) - if @production.save - redirect_to :new - else - redirect_to :index - end - end - private def set_production
Remove redundant production 'def new'
diff --git a/examples/all-spinners.rb b/examples/all-spinners.rb index abc1234..def5678 100644 --- a/examples/all-spinners.rb +++ b/examples/all-spinners.rb @@ -0,0 +1,8 @@+require_relative "../lib/whirly" +require "paint" + +Whirly::SPINNERS.keys.sort.each{ |spinner_name| + Whirly.start(spinner: spinner_name, status: spinner_name){ + sleep 1 + } +}
Add example demonstrating all spinners
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -27,4 +27,9 @@ describe "devise_mapping" do it { devise_mapping.should == Devise.mappings[:user] } end + + describe "trim_length" do + it { trim_length("Something Extra Long", 5).should == "Somet..." } + it { trim_length("Something Short", 50).should == "Something Short" } + end end
Add Spec for Trimming Content in View Add spec tests for trimming content to a specific length in the views.
diff --git a/Formula/automake.rb b/Formula/automake.rb index abc1234..def5678 100644 --- a/Formula/automake.rb +++ b/Formula/automake.rb @@ -16,7 +16,7 @@ "--prefix=#{prefix}" system "make install" - (share/"aclocal-#{version}/dirlist").write <<-EOS.undent + (share/"aclocal/dirlist").write <<-EOS.undent /usr/share/aclocal #{HOMEBREW_PREFIX}/share/aclocal EOS
Put dirlist in the right place I fixed this last night, and then somehow committed the wrong version. Don't watch the Oscars while doing Homebrew.
diff --git a/lib/shipit/webhooks.rb b/lib/shipit/webhooks.rb index abc1234..def5678 100644 --- a/lib/shipit/webhooks.rb +++ b/lib/shipit/webhooks.rb @@ -2,31 +2,33 @@ module Shipit module Webhooks - def self.default_handlers - { - 'push' => [Handlers::PushHandler], - 'status' => [Handlers::StatusHandler], - 'membership' => [Handlers::MembershipHandler], - 'check_suite' => [Handlers::CheckSuiteHandler], - } - end + class << self + def default_handlers + { + 'push' => [Handlers::PushHandler], + 'status' => [Handlers::StatusHandler], + 'membership' => [Handlers::MembershipHandler], + 'check_suite' => [Handlers::CheckSuiteHandler], + } + end - def self.handlers - @handlers ||= reset_handler_registry - end + def handlers + @handlers ||= reset_handler_registry + end - def self.reset_handler_registry - @handlers = default_handlers - end + def reset_handler_registry + @handlers = default_handlers + end - def self.register_handler(event, callable = nil, &block) - handlers[event] ||= [] - handlers[event] << callable if callable - handlers[event] << block if block_given? - end + def register_handler(event, callable = nil, &block) + handlers[event] ||= [] + handlers[event] << callable if callable + handlers[event] << block if block_given? + end - def self.for_event(event) - handlers.fetch(event) { [] } + def for_event(event) + handlers.fetch(event) { [] } + end end end end
Define webhook class methods by opening the singleton class
diff --git a/lib/travis/cli/init.rb b/lib/travis/cli/init.rb index abc1234..def5678 100644 --- a/lib/travis/cli/init.rb +++ b/lib/travis/cli/init.rb @@ -12,8 +12,7 @@ def check_already_exists if File.exist?('.travis.yml') - answer = ask(".travis.yml already exists, do you want to overwrite?") - if answer =~ (/(true|t|yes|y|1)$/i) + if agree(".travis.yml already exists, do you want to overwrite?") File.delete('.travis.yml') say "File overwritten!" else
Fix to use agree command
diff --git a/lib/vagrant-butcher.rb b/lib/vagrant-butcher.rb index abc1234..def5678 100644 --- a/lib/vagrant-butcher.rb +++ b/lib/vagrant-butcher.rb @@ -5,6 +5,23 @@ end require 'vagrant-butcher/version' require 'vagrant-butcher/errors' + +# Work around logger spam from hashie +# https://github.com/intridea/hashie/issues/394 +begin + require "hashie" + require "hashie/logger" + # Based on Hashie's recommendation to disable warnings: + # https://github.com/intridea/hashie#how-does-mash-handle-conflicts-with-pre-existing-methods + class Response < Hashie::Mash + disable_warnings + end + # Alternatively, completely silence the logger as done in Berkshelf: + # https://github.com/berkshelf/berkshelf/pull/1668/files + # Hashie.logger = Logger.new(nil) +rescue LoadError + # intentionally left blank +end module Vagrant module Butcher
Fix logger spam caused by Hashie used in Ridley See Hashie [issue](https://github.com/intridea/hashie/issues/394) Solution based on the Hashie recommendation to disable warnings: https://github.com/intridea/hashie#how-does-mash-handle-conflicts-with-pre-existing-methods Alternatively, completely silence the logger as done in Berkshelf: https://github.com/berkshelf/berkshelf/pull/1668/files ``` Hashie.logger = Logger.new(nil) ```
diff --git a/lib/zebra/print_job.rb b/lib/zebra/print_job.rb index abc1234..def5678 100644 --- a/lib/zebra/print_job.rb +++ b/lib/zebra/print_job.rb @@ -24,7 +24,8 @@ def check_existent_printers(printer) existent_printers = Cups.show_destinations - puts "EXISTENT PRINTERS: \n" + existent_printers + puts "EXISTENT PRINTERS: \n" + existent_printers.each { |x| puts x } raise UnknownPrinter.new(printer) unless existent_printers.include?(printer) end
Print all existing printers in array for debugging
diff --git a/guard-foodcritic.gemspec b/guard-foodcritic.gemspec index abc1234..def5678 100644 --- a/guard-foodcritic.gemspec +++ b/guard-foodcritic.gemspec @@ -16,7 +16,7 @@ gem.version = Guard::FOODCRITIC_VERSION gem.add_runtime_dependency "guard", "~> 1.0" - gem.add_runtime_dependency "foodcritic", "~> 1.3" + gem.add_runtime_dependency "foodcritic", ">= 1.3", "< 3.0" gem.add_development_dependency "bundler", "~> 1.0" gem.add_development_dependency "rake", "~> 0.9.0"
Upgrade foodcritic dependency to allow also v2.x
diff --git a/lib/dynamic_paperclip/attachment.rb b/lib/dynamic_paperclip/attachment.rb index abc1234..def5678 100644 --- a/lib/dynamic_paperclip/attachment.rb +++ b/lib/dynamic_paperclip/attachment.rb @@ -13,7 +13,11 @@ style_position = path_with_wildcard.index('dynamic_*') Dir.glob(path_with_wildcard) do |file| - add_dynamic_style! file[style_position..-1].split('/').first + style_name = file[style_position..-1].split('/').first + + # In the event that the style name is used as the filename, + # we want to remove the extension for our style name + add_dynamic_style! File.basename(style_name, File.extname(style_name)) end end end
Fix extraction of existing dynamic styles from FS when style name is used as the file name If we have a dynamic style, dynamic_42x42, and the style name is used as the file name, the file name may be dynamic_42x42.jpg, so when looking at the FS and pulling out our existing dynamic styles, we want the style name (the key in the styles hash) to be "dynamic_42x42", not "dynamic_42x42.jpg".
diff --git a/lib/html-proofer/check/opengraph.rb b/lib/html-proofer/check/opengraph.rb index abc1234..def5678 100644 --- a/lib/html-proofer/check/opengraph.rb +++ b/lib/html-proofer/check/opengraph.rb @@ -27,7 +27,7 @@ elsif !@opengraph.valid? add_issue("#{@opengraph.src} is an invalid URL", line: m.line) elsif @opengraph.remote? - add_to_external_urls(@opengraph.url, m.line) + add_to_external_urls(@opengraph.url) else add_issue("internal open graph #{@opengraph.url} does not exist", line: m.line, content: m.content) unless @opengraph.exists? end
Correct the number of args
diff --git a/lib/neography/property_container.rb b/lib/neography/property_container.rb index abc1234..def5678 100644 --- a/lib/neography/property_container.rb +++ b/lib/neography/property_container.rb @@ -13,22 +13,5 @@ end end - # the arguments are either a Rest instance, or something else - def self.split_args(*args) - db = other = nil - - args.each do |arg| - case arg - when Rest - db = arg - else - other = arg - end - end - db ||= Neography::Rest.new - - [ db, other ] - end - end end
Remove helper method used by deprecated code.
diff --git a/lib/vcloud/cli/utils/create_disk.rb b/lib/vcloud/cli/utils/create_disk.rb index abc1234..def5678 100644 --- a/lib/vcloud/cli/utils/create_disk.rb +++ b/lib/vcloud/cli/utils/create_disk.rb @@ -22,12 +22,15 @@ Fog.mock! if ENV['FOG_MOCK'] puts "Creating disk in #{vdc.id}: #{disk_name} => #{disk_size}" body = vcloud.post_upload_disk(vdc.id, disk_name, disk_size).body - vcloud.process_task(body[:Disk][:Tasks][:Task]) + pp body if options[:debug] + vcloud.process_task(body[:Tasks][:Task]) end arg :identifier arg :disk_name arg :disk_size + + on("--debug", "Debug output") description " "
Add debugging and task management to CreateDisk
diff --git a/db/migrate/20161219105620_change_course_user_invitations.rb b/db/migrate/20161219105620_change_course_user_invitations.rb index abc1234..def5678 100644 --- a/db/migrate/20161219105620_change_course_user_invitations.rb +++ b/db/migrate/20161219105620_change_course_user_invitations.rb @@ -6,12 +6,13 @@ add_column :course_user_invitations, :confirmed_at, :datetime add_index :course_user_invitations, [:course_id, :email], unique: true - Course::UserInvitation.includes(course_user: { user: :emails }).find_each do |invitation| - course_user = invitation.course_user + Course::UserInvitation.find_each do |invitation| + course_user = CourseUser.find(invitation.course_user_id) + email = User::Email.find(invitation.user_email_id) invitation.update_columns( course_id: course_user.course_id, name: course_user.name, - email: invitation.user_email.email, + email: email.email, confirmed_at: course_user.approved? ? course_user.user.created_at : nil ) end
Fix invitation migration script * The migration failed due to association removed
diff --git a/lib/asciidoctor-mathematical/version.rb b/lib/asciidoctor-mathematical/version.rb index abc1234..def5678 100644 --- a/lib/asciidoctor-mathematical/version.rb +++ b/lib/asciidoctor-mathematical/version.rb @@ -1,5 +1,5 @@ module Asciidoctor module Mathematical - VERSION = "0.1.0" + VERSION = "0.2.0.dev" end end
Prepare for next development cycle
diff --git a/lib/bootstrap-sass/compass_functions.rb b/lib/bootstrap-sass/compass_functions.rb index abc1234..def5678 100644 --- a/lib/bootstrap-sass/compass_functions.rb +++ b/lib/bootstrap-sass/compass_functions.rb @@ -18,7 +18,7 @@ options[:sprockets][:context] else # Compatibility with sprockets pre 2.10.0 - options[:custom][:sprockets_context] + options[:importer].context end end end
Use correct reference to context through the importer Fixes #366 in the correct way, hopefully. I can't cite my sources well, since Sprockets is very difficult to follow... but suffice to say the global options hash sent to the Tilt SASS template engine always has a reference to the Sprockets importer, and the importer always has a reference to the context. Tested with Sprockets 2.2.2 with and without Rails.
diff --git a/lib/mgit/registry.rb b/lib/mgit/registry.rb index abc1234..def5678 100644 --- a/lib/mgit/registry.rb +++ b/lib/mgit/registry.rb @@ -1,15 +1,19 @@ module MGit module Registry def self.all - self.load.map { |name, path| Repository.new(name, path) }.sort_by(&:path).select(&:available?) + self.load.map { |name, path| Repository.new(name, path) }.sort_by(&:path) + end + + def self.available + self.all.select(&:available?) end def self.each(&block) - self.all.each(&block) + self.available.each(&block) end def self.chdir_each - self.all.each do |repo| + self.available.select(&:available?).each do |repo| Dir.chdir(repo.path) do yield repo end
Handle broken repositories even better.
diff --git a/CDEvents.podspec b/CDEvents.podspec index abc1234..def5678 100644 --- a/CDEvents.podspec +++ b/CDEvents.podspec @@ -9,5 +9,4 @@ s.platform = :osx, '10.5' s.source_files = '*.{h,m}' s.framework = 'CoreServices' - s.requires_arc = true end
Fix ARC setting in podspec.
diff --git a/lib/generators/que/templates/add_que.rb b/lib/generators/que/templates/add_que.rb index abc1234..def5678 100644 --- a/lib/generators/que/templates/add_que.rb +++ b/lib/generators/que/templates/add_que.rb @@ -3,7 +3,7 @@ class AddQue < ActiveRecord::Migration def self.up # The current version as of this migration's creation. - Que.migrate! :version => 3 + Que.migrate! :version => 4 end def self.down
Update default migration version to include retryable column
diff --git a/Formula/unfs3.rb b/Formula/unfs3.rb index abc1234..def5678 100644 --- a/Formula/unfs3.rb +++ b/Formula/unfs3.rb @@ -1,6 +1,6 @@ class Unfs3 < Formula desc "User-space NFSv3 server" - homepage "http://unfs3.sourceforge.net" + homepage "https://unfs3.sourceforge.io" url "https://downloads.sourceforge.net/project/unfs3/unfs3/0.9.22/unfs3-0.9.22.tar.gz" sha256 "482222cae541172c155cd5dc9c2199763a6454b0c5c0619102d8143bb19fdf1c"
Fix brew audit: sourceforge.io url preferred
diff --git a/spec/exporters/manual_publishing_api_links_exporter_spec.rb b/spec/exporters/manual_publishing_api_links_exporter_spec.rb index abc1234..def5678 100644 --- a/spec/exporters/manual_publishing_api_links_exporter_spec.rb +++ b/spec/exporters/manual_publishing_api_links_exporter_spec.rb @@ -0,0 +1,61 @@+require "fast_spec_helper" +require "support/govuk_content_schema_helpers" + +require "manual_publishing_api_links_exporter" + +describe ManualPublishingAPILinksExporter do + subject { + ManualPublishingAPILinksExporter.new( + export_recipent, + organisation, + manual + ) + } + + let(:export_recipent) { double(:export_recipent, call: nil) } + + let(:organisation) { + { + "web_url" => "https://www.gov.uk/government/organisations/cabinet-office", + "title" => "Cabinet Office", + "details" => { "abbreviation" => "CO", "content_id" => "d94d63a5-ce8e-40a1-ab4c-4956eab27259" }, + } + } + + let(:manual) { + double( + :manual, + id: "52ab9439-95c8-4d39-9b83-0a2050a0978b", + attributes: { + slug: "guidance/my-first-manual", + organisation_slug: "cabinet-office", + }, + documents: documents, + ) + } + + let(:documents) { + [ + double(:document, id: "c19ffb7d-448c-4cc8-bece-022662ef9611"), + double(:document, id: "f9c91a07-6a41-4b97-94a8-ecdc81997d49"), + ] + } + + it "exports links for the manual" do + subject.call + + expect(export_recipent).to have_received(:call).with( + manual.id, + hash_including( + links: { + organisations: [organisation["details"]["content_id"]], + sections: %w[c19ffb7d-448c-4cc8-bece-022662ef9611 f9c91a07-6a41-4b97-94a8-ecdc81997d49], + } + ) + ) + end + + it "exports links valid against the schema" do + expect(subject.send(:exportable_attributes).to_json).to be_valid_against_links_schema("manual") + end +end
Test for manual links exporter
diff --git a/test/lib/eye/patch/value_parser_test.rb b/test/lib/eye/patch/value_parser_test.rb index abc1234..def5678 100644 --- a/test/lib/eye/patch/value_parser_test.rb +++ b/test/lib/eye/patch/value_parser_test.rb @@ -13,6 +13,7 @@ assert_equal 3.2.gigabytes, Eye::Patch::ValueParser.parse("3.2 gigabytes") assert_equal 2.4.megabytes, Eye::Patch::ValueParser.parse("2.4 megabytes") assert_equal 1.kilobyte, Eye::Patch::ValueParser.parse("1 kilobyte") + assert_equal 1.terabyte, Eye::Patch::ValueParser.parse("1 terabyte ") end it "uses strict word boundary characters" do
Add test to allow trailing whitespace
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 @@ -6,10 +6,4 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__) , '..', 'lib')) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__) , 'utilities')) require 'amazon-associates' -require 'filesystem_test_helper' - -AWS_ACCESS_KEY_ID = '0PP7FTN6FM3BZGGXJWG2' -raise "Please specify set your AWS_ACCESS_KEY_ID" if AWS_ACCESS_KEY_ID.empty? - -Amazon::Associates.options.merge!( - :aws_access_key_id => AWS_ACCESS_KEY_ID) +require 'filesystem_test_helper'
Remove the AWS_ACCESS_KEY_ID stuff, which should be set up in ENV anyway
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 @@ -13,6 +13,10 @@ require 'flexmock/test_unit' Minitest::Reporters.use! Minitest::Reporters::DefaultReporter.new(color: true) + +class MiniTest::Spec + include FlexMock::TestCase +end class ActiveSupport::TestCase include FactoryGirl::Syntax::Methods
Add flexmock assertion heleprs to minitest specs
diff --git a/site-cookbooks/jenkins/recipes/rpm.rb b/site-cookbooks/jenkins/recipes/rpm.rb index abc1234..def5678 100644 --- a/site-cookbooks/jenkins/recipes/rpm.rb +++ b/site-cookbooks/jenkins/recipes/rpm.rb @@ -0,0 +1,19 @@+package "java-1.8.0-openjdk" do + action :install +end + +remote_file "#{Chef::Config[:file_cache_path]}/jenkins-1.658-1.1.noarch.rpm" do + source "http://pkg.jenkins-ci.org/redhat/jenkins-1.658-1.1.noarch.rpm" + not_if "rpm -qa | grep -q '^jenkins'" + action :create + notifies :install, "rpm_package[jenkins]", :immediately +end + +rpm_package "jenkins" do + source "#{Chef::Config[:file_cache_path]}/jenkins-1.658-1.1.noarch.rpm" + action :nothing +end + +service "jenkins" do + action [:enable, :start] +end
Add Jenkins ver. 1.658 recipe.
diff --git a/spec/flexible_config/overview_spec.rb b/spec/flexible_config/overview_spec.rb index abc1234..def5678 100644 --- a/spec/flexible_config/overview_spec.rb +++ b/spec/flexible_config/overview_spec.rb @@ -9,14 +9,20 @@ subject { instance.call } let :expected_output do - "subcategory.wrapped_yaml | | " \ - "CATEGORY_SUBCATEGORY_WRAPPED_YAML = testing" + "another_sub.short_syntax | | " \ + "CATEGORY_ANOTHER_SUB_SHORT_SYNTAX = shorty" end # Weird spacing due to sprintf column pattern specify "it outputs the available configuration" do expect( subject['category'].first ).to eq expected_output + end + + specify "it sorts alphabetically" do + expect( + subject['category'].first + ).to be <= subject['category'].last end end
Fix spec & and specs
diff --git a/spec/helpers/divisions_helper_spec.rb b/spec/helpers/divisions_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/divisions_helper_spec.rb +++ b/spec/helpers/divisions_helper_spec.rb @@ -12,20 +12,24 @@ end describe "#majority_strength_in_words" do + before :each do + allow(helper).to receive(:division_score).and_return('1 Aye – 0 No') + end + context "Motion with everyone voting one way" do it { expect(helper.majority_strength_in_words(mock_model(Division, majority_fraction: 1.0))).to eq "unanimously" } end context "Motion with a slight majority" do - it { expect(helper.majority_strength_in_words(mock_model(Division, majority_fraction: 0.2))).to eq "by a small majority" } + it { expect(helper.majority_strength_in_words(mock_model(Division, majority_fraction: 0.2))).to eq "by a <span class=\"has-tooltip\" title=\"1 Aye – 0 No\">small majority</span>" } end context "Motion with a moderate majority" do - it { expect(helper.majority_strength_in_words(mock_model(Division, majority_fraction: 0.5))).to eq "by a moderate majority" } + it { expect(helper.majority_strength_in_words(mock_model(Division, majority_fraction: 0.5))).to eq "by a <span class=\"has-tooltip\" title=\"1 Aye – 0 No\">moderate majority</span>" } end context "Motion with a large majority" do - it { expect(helper.majority_strength_in_words(mock_model(Division, majority_fraction: 0.9))).to eq "by a large majority" } + it { expect(helper.majority_strength_in_words(mock_model(Division, majority_fraction: 0.9))).to eq "by a <span class=\"has-tooltip\" title=\"1 Aye – 0 No\">large majority</span>" } end end end
Update helper tests to include tooltip added in dfc91ad
diff --git a/spec/unit/rip/utilities/scope_spec.rb b/spec/unit/rip/utilities/scope_spec.rb index abc1234..def5678 100644 --- a/spec/unit/rip/utilities/scope_spec.rb +++ b/spec/unit/rip/utilities/scope_spec.rb @@ -8,6 +8,10 @@ specify { expect(scope_foo[:foo]).to be(111) } specify { expect(scope_foo[:zebra]).to be_nil } + + specify do + expect { scope_foo[:foo] = 000 }.to raise_error(Rip::Exceptions::CompilerException) + end context 'extending' do before(:each) { scope_foo[:bar] = 222 }
Add test for when scope key already set
diff --git a/lib/autobots/settings.rb b/lib/autobots/settings.rb index abc1234..def5678 100644 --- a/lib/autobots/settings.rb +++ b/lib/autobots/settings.rb @@ -24,7 +24,7 @@ end def connector - hsh.fetch(:connector, :ghost).to_s + hsh.fetch(:connector, :firefox).to_s end def env
[PH][000000] Change default connector to firefox instead of ghost since everyone uses it during development
diff --git a/test/bane/behaviors/servers/timeout_in_listen_queue_test.rb b/test/bane/behaviors/servers/timeout_in_listen_queue_test.rb index abc1234..def5678 100644 --- a/test/bane/behaviors/servers/timeout_in_listen_queue_test.rb +++ b/test/bane/behaviors/servers/timeout_in_listen_queue_test.rb @@ -13,9 +13,8 @@ end def test_never_connects - pend "Need to review after Ruby 2+ update; now returns Errno:ECONNREFUSED" run_server(Bane::Behaviors::Servers::TimeoutInListenQueue.make(port, Bane::Behaviors::Servers::LOCALHOST)) do - assert_raise(Errno::ETIMEDOUT) { TCPSocket.new('localhost', port) } + assert_raise(Errno::ECONNREFUSED) { TCPSocket.new('localhost', port) } end end
Revert to previous observed failure of TimeoutInListenQueue behavior
diff --git a/lib/dimples/frontable.rb b/lib/dimples/frontable.rb index abc1234..def5678 100644 --- a/lib/dimples/frontable.rb +++ b/lib/dimples/frontable.rb @@ -8,7 +8,7 @@ def read_with_front_matter @contents = File.read(@path) - matches = contents.match(/^(-{3}\n.*?\n?)^(-{3}*$\n?)/m) + matches = @contents.match(/^(-{3}\n.*?\n?)^(-{3}*$\n?)/m) return if matches.nil? metadata = YAML.safe_load(matches[1])
Update read_with_front_matter to use @contents.
diff --git a/lib/juici/build_logic.rb b/lib/juici/build_logic.rb index abc1234..def5678 100644 --- a/lib/juici/build_logic.rb +++ b/lib/juici/build_logic.rb @@ -13,7 +13,11 @@ def kill! warn! "Killed!" if pid = self[:pid] - Process.kill(15, pid) + if pgid = Process.getpgid(pid) + Process.kill(15, -1 * pgid) + else + Process.kill(15, pid) + end end end @@ -25,7 +29,8 @@ :chdir => dir, :in => "/dev/null", :out => @buffer.fileno, - :err => [:child, :out] + :err => [:child, :out], + :pgroup => true ) rescue Errno::ENOENT :enoent
Put children in their own process groups. Nuke entire process groups
diff --git a/lib/kanji/application.rb b/lib/kanji/application.rb index abc1234..def5678 100644 --- a/lib/kanji/application.rb +++ b/lib/kanji/application.rb @@ -1,7 +1,6 @@ require "roda" require "roda/plugins/flow" require "dry-configurable" -require "dry-monitor" module Kanji class Application < ::Roda
Remove unneeded require of dry-monitor
diff --git a/err_merchant.gemspec b/err_merchant.gemspec index abc1234..def5678 100644 --- a/err_merchant.gemspec +++ b/err_merchant.gemspec @@ -21,7 +21,7 @@ spec.require_paths = ["lib"] spec.add_dependency 'rails', '>= 5.0', '< 6.1' - spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rake' spec.add_development_dependency 'combustion' spec.add_development_dependency 'sqlite3' spec.add_development_dependency 'rspec-rails', '~> 3.0'
Remove explicit version requirement for rake
diff --git a/lib/pg_drive/uploader.rb b/lib/pg_drive/uploader.rb index abc1234..def5678 100644 --- a/lib/pg_drive/uploader.rb +++ b/lib/pg_drive/uploader.rb @@ -8,8 +8,9 @@ def call(content) drive = Drive::DriveService.new drive.authorization = credentials + app_name = Rails.application.class.parent_name drive.insert_file( - Drive::File.new(title: "backup-#{Time.now.to_i}"), + Drive::File.new(title: "backup-#{app_name}-#{Time.now.to_i}"), upload_source: gzip(content), content_type: GZIP_MIME_TYPE, options: { retries: RETRY_COUNT }
Add app name to backup file name
diff --git a/spec/git_tracker/commit_message_spec.rb b/spec/git_tracker/commit_message_spec.rb index abc1234..def5678 100644 --- a/spec/git_tracker/commit_message_spec.rb +++ b/spec/git_tracker/commit_message_spec.rb @@ -11,23 +11,28 @@ describe "#mentions_story?" do subject { described_class.new(file) } let(:file) { "COMMIT_EDITMSG" } - before do - File.stub(:read).with(file) { commit_message_text } + + def stub_commit_message(story_text) + File.stub(:read).with(file) { example_commit_message(story_text) } end context "commit message contains the special Pivotal Tracker story syntax" do - let(:commit_message_text) { example_commit_message("[#8675309]") } - it { subject.should be_mentions_story("8675309") } + it "matches just the number" do + stub_commit_message("[#8675309]") + subject.should be_mentions_story("8675309") + end - context "with state change" do - let(:commit_message_text) { example_commit_message("[Fixes #8675309]") } - it { subject.should be_mentions_story("8675309") } + it "matches state change and number" do + stub_commit_message("[Fixes #8675309]") + subject.should be_mentions_story("8675309") end end context "commit message doesn't contain the special Pivotal Tracker story syntax" do - let(:commit_message_text) { example_commit_message("#8675309") } - it { subject.should_not be_mentions_story("8675309") } + it "doesn't match without brackets" do + stub_commit_message("#8675309") + subject.should_not be_mentions_story("8675309") + end end end
Refactor specs for clarity and runway There are several more examples coming and I want it to be easy to add them, and clear to read. Thanks @myronmarston for the suggestion: https://gist.github.com/2142563 [#26437519]
diff --git a/spec/lita/handlers/wolframalpha_spec.rb b/spec/lita/handlers/wolframalpha_spec.rb index abc1234..def5678 100644 --- a/spec/lita/handlers/wolframalpha_spec.rb +++ b/spec/lita/handlers/wolframalpha_spec.rb @@ -1,4 +1,7 @@ require "spec_helper" describe Lita::Handlers::Wolframalpha, lita_handler: true do + + it { is_expected.to route_command("wolframalpha director of movie pi").to(:wolframalpha) } + end
Add a first simple spec
diff --git a/spec/models/arbitration_setting_spec.rb b/spec/models/arbitration_setting_spec.rb index abc1234..def5678 100644 --- a/spec/models/arbitration_setting_spec.rb +++ b/spec/models/arbitration_setting_spec.rb @@ -9,7 +9,7 @@ context 'seeding again' do it 'should not create new records' do - expect { ArbitrationSetting.count }.not_to change(ArbitrationSetting, :count) + expect { ArbitrationSetting.seed }.not_to change(ArbitrationSetting, :count) end end end
Fix minor typo in spec It renders this specific test ineffective.
diff --git a/twingly-url.gemspec b/twingly-url.gemspec index abc1234..def5678 100644 --- a/twingly-url.gemspec +++ b/twingly-url.gemspec @@ -19,7 +19,7 @@ s.add_development_dependency "rake", "~> 12" s.add_development_dependency "rspec", "~> 3" - s.add_development_dependency "pry" + s.add_development_dependency "pry", "~> 0" s.files = Dir.glob("{lib}/**/*") + %w(README.md) s.require_path = 'lib'
Add version constraint for Pry Takes care of the following warning when building the gem: ``` WARNING: open-ended dependency on pry (>= 0, development) is not recommended use a bounded requirement, such as '~> x.y' ```
diff --git a/app/adapters/beeminder_adapter.rb b/app/adapters/beeminder_adapter.rb index abc1234..def5678 100644 --- a/app/adapters/beeminder_adapter.rb +++ b/app/adapters/beeminder_adapter.rb @@ -11,7 +11,7 @@ end def website_link - "https:/www.beeminder.com" + "https://www.beeminder.com" end def title
Fix beeminder link in main page
diff --git a/lib/shhhhh/middleware.rb b/lib/shhhhh/middleware.rb index abc1234..def5678 100644 --- a/lib/shhhhh/middleware.rb +++ b/lib/shhhhh/middleware.rb @@ -4,11 +4,10 @@ def call_app(request, env) # if the path looks like /assets/some/script.js, don't bother logging - # just move on - if env['PATH_INFO'] =~ /\A\/assets\/ + if env['PATH_INFO'] =~ /\A\/assets\// @app.call(env) else - super(request, env) + super end ensure
Remove a comment and modify the super call * Passing the arguments here doesn't have to be explicit.
diff --git a/lib/logstasher/delayed/plugin.rb b/lib/logstasher/delayed/plugin.rb index abc1234..def5678 100644 --- a/lib/logstasher/delayed/plugin.rb +++ b/lib/logstasher/delayed/plugin.rb @@ -0,0 +1,14 @@+require 'delayed_job' +module LogStasher + module Delayed + class Plugin < ::Delayed::Plugin + callbacks do |lifecycle| + lifecycle.before(:invoke_job) do |job, *args, &block| + ::LogStasher.request_context[:request_id] = job.id + ::LogStasher.source = "Delayed::Job" + # perhaps handler#object.first_line and method_name would be interesting too (in store??) + end + end + end + end +end
Support for being called as delayed job and having a proper request_context.
diff --git a/lib/tasks/data_loader.rb b/lib/tasks/data_loader.rb index abc1234..def5678 100644 --- a/lib/tasks/data_loader.rb +++ b/lib/tasks/data_loader.rb @@ -22,7 +22,7 @@ def run_in_shell(command, index) shell = Session::Shell.new shell.outproc = lambda{ |out| puts "process-#{index}: #{ out }" } - shell.errproc = lambda{ |err| puts err } + shell.errproc = lambda{ |err| raise err } puts "Starting process #{index}" puts command shell.execute(command)
Raise an error for an error occurring in a sub shell
diff --git a/lib/piggybak_braintree/engine.rb b/lib/piggybak_braintree/engine.rb index abc1234..def5678 100644 --- a/lib/piggybak_braintree/engine.rb +++ b/lib/piggybak_braintree/engine.rb @@ -12,19 +12,21 @@ Piggybak::Order.send(:include, ::PiggybakBraintree::OrderDecorator) Piggybak::OrdersController.send(:include, ::PiggybakBraintree::OrdersControllerDecorator) end - - config.model Piggybak::Sellable do - label "Sellable" - visible false - edit do - field :sku - field :description - field :price - field :active - field :quantity - field :days - field :unlimited_inventory do - help "If true, backorders on this variant will be allowed, regardless of quantity on hand." + + RailsAdmin.config do |config| + config.model Piggybak::Sellable do + label "Sellable" + visible false + edit do + field :sku + field :description + field :price + field :active + field :quantity + field :days + field :unlimited_inventory do + help "If true, backorders on this variant will be allowed, regardless of quantity on hand." + end end end end
Add wrapper for tails admin model change
diff --git a/lib/rambo/raml_models/headers.rb b/lib/rambo/raml_models/headers.rb index abc1234..def5678 100644 --- a/lib/rambo/raml_models/headers.rb +++ b/lib/rambo/raml_models/headers.rb @@ -23,7 +23,7 @@ if headers.to_a.index(pair) == headers.length - 1 "\t\"#{pair.first}\" => \"#{pair.last}\"\n" # No comma after last item else - "\t\"#{pair.first}\" => \"#{pair.last}\",\n" + "\t\"#{pair.first}\" => \"#{pair.last}\"\n" end }
Delete comma because an extra one was ending up in generated tests
diff --git a/lib/rspec/core/shared_context.rb b/lib/rspec/core/shared_context.rb index abc1234..def5678 100644 --- a/lib/rspec/core/shared_context.rb +++ b/lib/rspec/core/shared_context.rb @@ -17,31 +17,33 @@ # # ... # end module SharedContext - include Hooks - include MemoizedHelpers::ClassMethods - def included(group) - [:before, :after].each do |type| - [:all, :each].each do |scope| - group.hooks[type][scope].concat hooks[type][scope] - end - end - _nested_group_declarations.each do |name, block, *args| - group.describe name, *args, &block + __shared_context_recordings.each do |recording| + recording.playback_onto(group) end end - def describe(name, *args, &block) - _nested_group_declarations << [name, block, *args] + def __shared_context_recordings + @__shared_context_recordings ||= [] end - alias_method :context, :describe + Recording = Struct.new(:method_name, :args, :block) do + def playback_onto(group) + group.__send__(method_name, *args, &block) + end + end - private + def self.record(*methods) + methods.each do |meth| + class_eval <<-EOS, __FILE__, __LINE__ + 1 + def #{meth}(*args, &block) + __shared_context_recordings << Recording.new(:#{meth}, args, block) + end + EOS + end + end - def _nested_group_declarations - @_nested_group_declarations ||= [] - end + record :before, :after, :around, :subject, :let, :its, :describe, :context end end
Rewrite SharedContext to use a simple record/playback mechanism.
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,4 +1,4 @@ class ApplicationMailer < ActionMailer::Base - default from: "\"CQ Manager Admin\" <admin@lunchiatto.com>" + default from: "\"Lunchiatto Admin\" <admin@lunchiatto.com>" layout 'mailer' end
Change default from address for emails
diff --git a/example/dummy_app.rb b/example/dummy_app.rb index abc1234..def5678 100644 --- a/example/dummy_app.rb +++ b/example/dummy_app.rb @@ -3,6 +3,6 @@ class DummyApp < Sinatra::Base get '/' do - Nark.total_requests.inspect + Nark.available_plugins.inspect end end
Change example response to return all include plugins
diff --git a/lib/stradivari/xlsx/generator.rb b/lib/stradivari/xlsx/generator.rb index abc1234..def5678 100644 --- a/lib/stradivari/xlsx/generator.rb +++ b/lib/stradivari/xlsx/generator.rb @@ -13,7 +13,6 @@ end protected - def xlsx Axlsx::Package.new do |package| package.workbook.add_worksheet do |sheet| @@ -28,15 +27,21 @@ bg_color: 'dddddd', fg_color: '000000', border: Axlsx::STYLE_THIN_BORDER - sheet.add_row @columns.map(&:title), style: heading + sheet.add_row @columns.map(&:title), + types: [:string] * @columns.size, + style: heading end def render_body(sheet) @data.each do |object| - sheet.add_row(@columns.map {|col| col.to_s(object) }) + sheet.add_row(@columns.map {|col| col.to_s(object) }, types: types) end end + private + def types + @_types ||= @columns.map {|c| c.opts.fetch(:type, nil)} + end end end end
Add ability to specify XLSX column types
diff --git a/uspec/uspec_spec.rb b/uspec/uspec_spec.rb index abc1234..def5678 100644 --- a/uspec/uspec_spec.rb +++ b/uspec/uspec_spec.rb @@ -49,7 +49,7 @@ !(Array.respond_to? :spec) end -spec 'returns the number of failures' do +spec 'exit code is the number of failures' do capture do 50.times do spec 'fail' do @@ -60,3 +60,15 @@ $?.exitstatus == 50 || $? end + +spec 'if more than 255 failures, exit status is 255' do + capture do + 500.times do + spec 'fail' do + false + end + end + end + + $?.exitstatus == 255 || $? +end
Verify that the exit status won't overflow.
diff --git a/views/opensearch.xml.builder b/views/opensearch.xml.builder index abc1234..def5678 100644 --- a/views/opensearch.xml.builder +++ b/views/opensearch.xml.builder @@ -3,18 +3,22 @@ xml.instruct! xml.OpenSearchDescription 'xmlns' => 'http://a9.com/-/spec/opensearch/1.1/', 'xmlns:moz' => 'http://www.mozilla.org/2006/browser/search/' do + xml.InputEncoding 'UTF-8' + xml.OutputEncoding 'UTF-8' + xml.Language 'en-us' xml.ShortName 'ASCIIwwdc' + xml.Description 'Search ASCIIwwdc' xml.Image 'https://asciiwwdc.com/favicon.ico', 'type' => 'image/x-icon', 'width' => '16', 'height' => '16' - xml.Description "Search ASCIIwwdc" xml.Url 'type' => 'application/opensearchdescription+xml', 'rel' => 'self', 'template' => 'https://asciiwwdc.com/open-search.xml' + xml.Url 'type' => 'application/rss+xml', + 'template' => 'https://asciiwwdc.com/search.rss?q={searchTerms}' xml.Url 'type' => 'text/html', - 'rel' => 'results', - 'method' => 'get', + 'method' => 'GET', 'template' => 'https://asciiwwdc.com/search?q={searchTerms}' xml.tag! 'moz:SearchForm', 'https://asciiwwdc.com/' end
Revert "Disable RSS search results" Fix case in Url tags This reverts commit e8258ac9baeb1e1d3ee2216c6fc42901469c574f.
diff --git a/examples/auth_pub.rb b/examples/auth_pub.rb index abc1234..def5678 100644 --- a/examples/auth_pub.rb +++ b/examples/auth_pub.rb @@ -16,8 +16,7 @@ NATS.on_error { |err| puts "Server Error: #{err}"; exit! } NATS.start(:uri => uri) do - NATS.publish(subject, msg) - NATS.stop + NATS.publish(subject, msg) { NATS.stop } end puts "Published on [#{subject}] : '#{msg}'"
Make sure publish is flushed
diff --git a/rspec-sleeping_king_studios.gemspec b/rspec-sleeping_king_studios.gemspec index abc1234..def5678 100644 --- a/rspec-sleeping_king_studios.gemspec +++ b/rspec-sleeping_king_studios.gemspec @@ -20,10 +20,9 @@ gem.require_path = 'lib' gem.files = Dir["lib/**/*.rb", "LICENSE", "*.md"] - gem.add_runtime_dependency 'rspec', '~> 2.99.beta.2' + gem.add_runtime_dependency 'rspec', '~> 3.0.beta.2' gem.add_development_dependency 'activemodel', '~> 3.0' gem.add_development_dependency 'factory_girl', '~> 4.2' - gem.add_development_dependency 'fuubar', '~> 1.1.1' gem.add_development_dependency 'pry', '~> 0.9.12' end # gemspec
Update RSpec dependency to 3.0.beta.2 Current spec status: 358 examples, 167 failures in 0.1169 seconds; 145 deprecations found.
diff --git a/lib/generators/templates/devise_security_extension.rb b/lib/generators/templates/devise_security_extension.rb index abc1234..def5678 100644 --- a/lib/generators/templates/devise_security_extension.rb +++ b/lib/generators/templates/devise_security_extension.rb @@ -6,7 +6,7 @@ # config.expire_password_after = false # Need 1 char of A-Z, a-z and 0-9 - # config.password_regex = /(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])/ + # config.password_regex = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/ # How many passwords to keep in archive # config.password_archiving_count = 5
Fix mistake in default Regex of initializer
diff --git a/lib/neighborly/balanced/engine.rb b/lib/neighborly/balanced/engine.rb index abc1234..def5678 100644 --- a/lib/neighborly/balanced/engine.rb +++ b/lib/neighborly/balanced/engine.rb @@ -2,6 +2,8 @@ module Balanced class Engine < ::Rails::Engine isolate_namespace Neighborly::Balanced + + config.autoload_paths += Dir["#{config.root}/app/observers/**/"] initializer 'include_user_concern' do |app| ::User.send(:include, Neighborly::Balanced::User)
Add observers path to autoload
diff --git a/lib/spork/run_strategy/forking.rb b/lib/spork/run_strategy/forking.rb index abc1234..def5678 100644 --- a/lib/spork/run_strategy/forking.rb +++ b/lib/spork/run_strategy/forking.rb @@ -20,7 +20,6 @@ end def preload - require test_framework.entry_point test_framework.preload end
Revert "fixes regression where entry point was not being loaded" This reverts commit 28f6da0e4e89d35411b19d5a5977a9d9f305f5f9.
diff --git a/command_line/dash_upper_c_spec.rb b/command_line/dash_upper_c_spec.rb index abc1234..def5678 100644 --- a/command_line/dash_upper_c_spec.rb +++ b/command_line/dash_upper_c_spec.rb @@ -11,6 +11,11 @@ output.should == @tempdir end + it 'does not need a space after -C for the argument' do + output = ruby_exe(@script, options: "-C#{@tempdir}") + output.should == @tempdir + end + it 'changes the PWD when using -e' do output = ruby_exe(nil, options: "-C #{@tempdir} -e 'print Dir.pwd'") output.should == @tempdir
Add spec for ruby -Cdir -e code