iteraptor 0.8.0 → 0.8.1

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: 18e8c89d415a12358783e4e1a063a64dfcbacb0f
4
- data.tar.gz: c88f67156a520789a37dd3985c4b1bb3b38f41d8
3
+ metadata.gz: 6233b7b0b6e3df8f2a9d839325ce0bb0b98c71db
4
+ data.tar.gz: b4253266ab34631d9f16a4f699cc75e418d683db
5
5
  SHA512:
6
- metadata.gz: 0f4455a4152188b0b02f0362e1489a17c6e6a21ff20ec20e8bd74f2f91f2ed0ebed5a2fd2c43f45d7844deda17df6034f6903e87ec64eef25a779533120c8691
7
- data.tar.gz: fbac0c9ccb98eb321de7c5a49773e7ab173e5046dd7508853c33dfc080e370b0d56d54a1c4f4d0d274b18b79c603a466cfa75a5e7c324277a24a565d19ee37e2
6
+ metadata.gz: 6727ba65fc3958b1aaa207146cdf1ce882cc5cd456ca42b1266e1b141c6c3a392d7758e1d240f9436d061c5f76af261003fb7da231ee445f32e648f5804159db
7
+ data.tar.gz: aad08a5fb9bf7dc75d8dea35164a5c236d9061c4890d1d7204ac5c6a0d6c6686ebea8646598f0a2f6d5cd8485232ea5706eab00ee6a4c562d42334f1853e0d98
@@ -1,3 +1,3 @@
1
1
  module Iteraptor
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
data/lib/iteraptor.rb CHANGED
@@ -33,12 +33,16 @@ module Iteraptor
33
33
  end
34
34
 
35
35
  def compactar **params
36
- mapa(yield_all: true) do |p, (k, v)|
37
- v.is_a?(Array) ? [k, v.compact] : [k, v]
38
- end.mapa(**params) do |parent, (k, v)|
39
- p = parent.split(H.iteraptor_delimiter(params)).last
40
- (p.to_i.to_s != p && v.nil?) ? nil : [k, v]
41
- end
36
+ (is_a?(Array) ? compact : self).
37
+ mapa(yield_all: true) do |p, (k, v)|
38
+ v.is_a?(Array) ? [k, v.compact] : [k, v]
39
+ end.mapa(**params) do |parent, (k, v)|
40
+ p = parent.split(H.iteraptor_delimiter(params)).last
41
+ puts [p, parent, k, v].inspect
42
+ (p.to_i.to_s != p && v.nil?) ? nil : [k, v]
43
+ end.tap do |this|
44
+ break {} if this.empty? && is_a?(Hash)
45
+ end
42
46
  end
43
47
 
44
48
  # rubocop:disable Style/Alias
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iteraptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksei Matiushkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-31 00:00:00.000000000 Z
11
+ date: 2018-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler