summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Goldstein <peter.m.goldstein@gmail.com>2022-01-27 18:59:24 -0800
committerGitHub <noreply@github.com>2022-01-27 18:59:24 -0800
commit3e57eb531f2d028cb56cd1ddab9bb07c70b93abf (patch)
treeca47e5a94dde4b16d7fcd841a9becfb6cb6d9245 /lib
parent4dc015eb522abfaa2323c36024bc214ab8ccb9cc (diff)
downloadhashie-3e57eb531f2d028cb56cd1ddab9bb07c70b93abf.tar.gz
Add Ruby 3.1 to CI (#558)
* Add Ruby 3.1 to CI Update Rubocop for recent Rubies Disable Rubocop run for Rubies before Ruby 2.4 Quote '3.0' in the CI configuration to ensure it loads a 3.0.x Ruby Set RUBYOPT="--disable_error_highlight" so Ruby 3.1 error matchers pass * Add CHANGELOG.md entry * Re-add deleted line from CHANGELOG.md * Set minimum supported Ruby version to 2.4. Remove a number of code bits designed to support Rubies below version 2.4 * Bump version. Remove unneeded require from Gemfile. Add require to spec/support file
Diffstat (limited to 'lib')
-rw-r--r--lib/hashie/extensions/coercion.rb9
-rw-r--r--lib/hashie/mash.rb22
-rw-r--r--lib/hashie/version.rb2
3 files changed, 11 insertions, 22 deletions
diff --git a/lib/hashie/extensions/coercion.rb b/lib/hashie/extensions/coercion.rb
index a12490a..37d2d7c 100644
--- a/lib/hashie/extensions/coercion.rb
+++ b/lib/hashie/extensions/coercion.rb
@@ -17,14 +17,7 @@ module Hashie
}.freeze
ABSTRACT_CORE_TYPES =
- if RubyVersion.new(RUBY_VERSION) >= RubyVersion.new('2.4.0')
- { Numeric => [Integer, Float, Complex, Rational] }
- else
- {
- Integer => [Fixnum, Bignum],
- Numeric => [Fixnum, Bignum, Float, Complex, Rational]
- }
- end
+ { Numeric => [Integer, Float, Complex, Rational] }
def self.included(base)
base.send :include, InstanceMethods
diff --git a/lib/hashie/mash.rb b/lib/hashie/mash.rb
index d5cb308..21bcadb 100644
--- a/lib/hashie/mash.rb
+++ b/lib/hashie/mash.rb
@@ -322,22 +322,18 @@ module Hashie
self.class.new(other_hash).merge(self)
end
- with_minimum_ruby('2.3.0') do
- def dig(*keys)
- super(*keys.map { |key| convert_key(key) })
- end
+ def dig(*keys)
+ super(*keys.map { |key| convert_key(key) })
end
- with_minimum_ruby('2.4.0') do
- def transform_values(&blk)
- self.class.new(super(&blk))
- end
+ def transform_values(&blk)
+ self.class.new(super(&blk))
+ end
- # Returns a new instance of the class it was called on, with nil values
- # removed.
- def compact
- self.class.new(super)
- end
+ # Returns a new instance of the class it was called on, with nil values
+ # removed.
+ def compact
+ self.class.new(super)
end
with_minimum_ruby('2.5.0') do
diff --git a/lib/hashie/version.rb b/lib/hashie/version.rb
index 1c97af1..d19e3fe 100644
--- a/lib/hashie/version.rb
+++ b/lib/hashie/version.rb
@@ -1,3 +1,3 @@
module Hashie
- VERSION = '5.0.1'.freeze
+ VERSION = '5.1.0'.freeze
end