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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c374c038c92b2995c910d980c7edc761d85b3bfd
4
- data.tar.gz: 1c9d630d8d462013d63ba82c0bd766da6c819b48
3
+ metadata.gz: 49caea9f314e85093e38a5d1fa18ab8d32d488bd
4
+ data.tar.gz: b295944d8929d9241ec548ad28260ad9b6d1aa56
5
5
  SHA512:
6
- metadata.gz: abf530dbdcb5eceea41a8b26395858fdded734c726f1835f517244ba035e90ce744a4d8765925b4201c8938c2067bf0e1191fd9321e166c4d24bf7f266d8d90b
7
- data.tar.gz: '092c6a64cd5018aa8898e2ea547087bb4004b3deb7e5cb950c3474c7df8160c67a396c6ef07952cb76a2e83a177d6d9ef5914450dc0b205da1d2f8070769f3da'
6
+ metadata.gz: 747c1410c50f3dae0c925874d3b128bc9eea6a34dfd18573583ca08aeda0fa6c3d5c5c1a876ee595a5b57b820902f309454863310ade8d79c5f9f6e58c5cdf46
7
+ data.tar.gz: 32a1f9100f986071b4bc90daea8f18f43d8cb2762f8818be502114cc4d3e83772bba1a5fd109daa1b74a81c3a348c656cef35fa765d5efdf7b86d1885990e38e
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Change Log
2
+
3
+ ## [0.2.0] - 2017-08-31
4
+
5
+ ### Changed
6
+
7
+ * With `recursive: true`, sort keys inside `Array` too [#1](https://github.com/yuya-takeyama/sort_by_key/pull/1)
8
+
9
+ ## [0.1.0] - 2017-06-28
10
+
11
+ * Initial release
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
@@ -1,3 +1,3 @@
1
1
  module SortByKey
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.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-06-28 00:00:00.000000000 Z
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.8
94
+ rubygems_version: 2.6.11
94
95
  signing_key:
95
96
  specification_version: 4
96
97
  summary: Sort keys in Hash