gorilla-patch 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gorilla-patch/hash.rb +14 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a787dd5c74b109548f43bb4bd596e8a3636ca8bd
|
4
|
+
data.tar.gz: dc6bca77019542a8123c4b9886b78bc3ce6f7599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c95104711ff03680d77866e9dcabcc47040f6ec385dc48894af6ab39e49532ba7ed2bd75c48ace8bbc95431230e0680c0001db37a64804ef7550fc90d91e8405
|
7
|
+
data.tar.gz: ed84ec1f229035b0c213c0a39917b39a12a3a69a4738553da48349cb7e4fab590b3d89e8294fe771c00a775de2207c052caf1146b3747ca274b0943b431d4113
|
data/lib/gorilla-patch/hash.rb
CHANGED
@@ -4,24 +4,33 @@ module GorillaPatch
|
|
4
4
|
refine Hash do
|
5
5
|
|
6
6
|
def keys_to_sym
|
7
|
-
|
7
|
+
each_with_object({}) { |(key, val), hash_sym| hash_sym[key.to_sym] = val }
|
8
8
|
end
|
9
9
|
|
10
10
|
def keys_to_sym!
|
11
11
|
hash_sym = keys_to_sym
|
12
|
-
|
12
|
+
clear.merge! hash_sym
|
13
13
|
end
|
14
14
|
|
15
15
|
def keys_to_s
|
16
|
-
|
16
|
+
each_with_object({}) { |(key, val), hash_s| hash_s[key.to_s] = val }
|
17
17
|
end
|
18
18
|
|
19
19
|
def keys_to_s!
|
20
20
|
hash_s = keys_to_s
|
21
|
-
|
21
|
+
clear.merge! hash_s
|
22
|
+
end
|
23
|
+
|
24
|
+
def except(*keys)
|
25
|
+
dup.except!(*keys)
|
26
|
+
end
|
27
|
+
|
28
|
+
def except!(*keys)
|
29
|
+
keys.each { |key| delete(key) }
|
30
|
+
self
|
22
31
|
end
|
23
32
|
|
24
33
|
end
|
25
34
|
|
26
35
|
end
|
27
|
-
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorilla-patch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Popov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Refine Ruby Core classes.
|
14
14
|
email: alex.wayfer@gmail.com
|
@@ -40,7 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
40
|
version: '0'
|
41
41
|
requirements: []
|
42
42
|
rubyforge_project:
|
43
|
-
rubygems_version: 2.4.5
|
43
|
+
rubygems_version: 2.4.5.1
|
44
44
|
signing_key:
|
45
45
|
specification_version: 4
|
46
46
|
summary: Monkey patch, Core extensions
|