Skip to content

Commit 72b2515

Browse files
chore: remove custom transform_keys monkey-patch, bump to 0.4.7.persona
Ruby has included Hash#transform_keys natively since 2.5, so the custom implementation is no longer needed. Ported from upstream PR bhgames#37. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3ce7704 commit 72b2515

3 files changed

Lines changed: 2 additions & 18 deletions

File tree

json_logic.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
1818
end
1919
spec.require_paths = ['lib']
2020

21-
spec.required_ruby_version = '>= 2.2'
21+
spec.required_ruby_version = '>= 2.5'
2222

2323
spec.add_development_dependency 'bundler', '>= 2.0.1'
2424
spec.add_development_dependency 'rake', '>= 10.0'

lib/core_ext/stringify_keys.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
class Hash
2-
# Stolen from ActiveSupport
3-
def transform_keys
4-
return enum_for(:transform_keys) { size } unless block_given?
5-
result = {}
6-
each_key do |key|
7-
result[yield(key)] = self[key]
8-
end
9-
result
10-
end
11-
12-
# Returns a new hash with all keys converted to strings.
13-
#
14-
# hash = { name: 'Rob', age: '28' }
15-
#
16-
# hash.stringify_keys
17-
# # => {"name"=>"Rob", "age"=>"28"}
182
def stringify_keys
193
transform_keys(&:to_s)
204
end

lib/json_logic/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module JSONLogic
2-
VERSION = '0.4.6.persona'
2+
VERSION = '0.4.7.persona'
33
end

0 commit comments

Comments
 (0)