Skip to content
Browse files

Remove reference to singleton_class, that's Ruby 1.9 only.

  • Loading branch information...
1 parent 3bd7979 commit 5513b967b2114c1c2fe70b867d539493ff24d91b Michael Bleigh committed
Showing with 4 additions and 4 deletions.
  1. +1 −1 Guardfile
  2. +2 −2 lib/hashie/extensions/indifferent_access.rb
  3. +1 −1 lib/hashie/extensions/merge_initializer.rb
View
2 Guardfile
@@ -1,5 +1,5 @@
guard 'rspec' do
watch(%r{^spec/.+_spec\.rb})
- watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
View
4 lib/hashie/extensions/indifferent_access.rb
@@ -38,7 +38,7 @@ def self.included(base)
# a hash without modifying the actual class. This is what
# allows IndifferentAccess to spread to sub-hashes.
def self.inject!(hash)
- hash.singleton_class.send :include, Hashie::Extensions::IndifferentAccess
+ (class << hash; self; end).send :include, Hashie::Extensions::IndifferentAccess
hash.convert!
end
@@ -103,7 +103,7 @@ def hash_lacking_indifference?(other)
def hash_with_indifference?(other)
other.is_a?(::Hash) &&
other.respond_to?(:indifferent_access?) &&
- other.indifference_access?
+ other.indifferent_access?
end
end
end
View
2 lib/hashie/extensions/merge_initializer.rb
@@ -16,7 +16,7 @@ module Extensions
#
module MergeInitializer
def initialize(hash = {}, default = nil, &block)
- super(default, &block)
+ default ? super(default) : super(&block)
update(hash)
end
end

0 comments on commit 5513b96

Please sign in to comment.
Something went wrong with that request. Please try again.