sort_by_key 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/sort_by_key.rb +2 -0
- data/lib/sort_by_key/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49caea9f314e85093e38a5d1fa18ab8d32d488bd
|
4
|
+
data.tar.gz: b295944d8929d9241ec548ad28260ad9b6d1aa56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 747c1410c50f3dae0c925874d3b128bc9eea6a34dfd18573583ca08aeda0fa6c3d5c5c1a876ee595a5b57b820902f309454863310ade8d79c5f9f6e58c5cdf46
|
7
|
+
data.tar.gz: 32a1f9100f986071b4bc90daea8f18f43d8cb2762f8818be502114cc4d3e83772bba1a5fd109daa1b74a81c3a348c656cef35fa765d5efdf7b86d1885990e38e
|
data/CHANGELOG.md
ADDED
data/lib/sort_by_key.rb
CHANGED
@@ -7,6 +7,8 @@ module SortByKey
|
|
7
7
|
v = hash[k]
|
8
8
|
if recursive && v.is_a?(Hash)
|
9
9
|
acc[k] = self.sort_by_key(v, symbolize_keys: symbolize_keys, recursive: recursive, &block)
|
10
|
+
elsif recursive && v.is_a?(Enumerable)
|
11
|
+
acc[k] = v.map { |e| self.sort_by_key(e, symbolize_keys: symbolize_keys, recursive: recursive, &block) }
|
10
12
|
else
|
11
13
|
acc[k] = v
|
12
14
|
end
|
data/lib/sort_by_key/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sort_by_key
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuya Takeyama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
+
- CHANGELOG.md
|
63
64
|
- Gemfile
|
64
65
|
- LICENSE.txt
|
65
66
|
- README.md
|
@@ -90,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
91
|
version: '0'
|
91
92
|
requirements: []
|
92
93
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.6.
|
94
|
+
rubygems_version: 2.6.11
|
94
95
|
signing_key:
|
95
96
|
specification_version: 4
|
96
97
|
summary: Sort keys in Hash
|