gorilla-patch 2.4.3 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gorilla-patch/transform.rb +22 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c92746c534a356fac88208ce5b848c3abc7a0b39
|
4
|
+
data.tar.gz: 23e6e0a2d2f06f10c42c489001acd0839816e188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acd9931edc33b37a19abd82cfaefce28bbff02b3e709efce2c6e0a6a72f708a17f170158f376c22e73ea55b3ff53b312a03004468d3e670bbb9ff604092118dc
|
7
|
+
data.tar.gz: 5db3c70d3f3887bdf2f3f8251e88c3dfc8274a311bd8a7b3290f2398cf86cc1ad7224588c6d3dedcb8305a4cc757317c76b83e43ab4302dd7c8097f962a44f1b
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GorillaPatch
|
4
|
+
## Module for transformations methods
|
5
|
+
module Transform
|
6
|
+
refine Hash do
|
7
|
+
def transform_values
|
8
|
+
return super if defined? super
|
9
|
+
each_with_object(self.class.new) do |(key, value), result|
|
10
|
+
result[key] = yield value
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def transform_values!
|
15
|
+
return super if defined? super
|
16
|
+
each do |key, value|
|
17
|
+
self[key] = yield value
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorilla-patch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Popov
|
@@ -127,6 +127,7 @@ files:
|
|
127
127
|
- lib/gorilla-patch/namespace.rb
|
128
128
|
- lib/gorilla-patch/slice.rb
|
129
129
|
- lib/gorilla-patch/symbolize.rb
|
130
|
+
- lib/gorilla-patch/transform.rb
|
130
131
|
- lib/gorilla-patch/truncate.rb
|
131
132
|
homepage: https://github.com/AlexWayfer/gorilla-patch
|
132
133
|
licenses:
|