polyrex-schema 0.1.16 → 0.1.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98bb3cbb54255cdc9332cccd236b81b35aa947d4
4
- data.tar.gz: 8cbd82a5f729e04f88a7d44f5416551520b2e0e6
3
+ metadata.gz: 4a1a0668efd811efca1389a0700f6a5782f843b9
4
+ data.tar.gz: 8887f1f767e999ffc2e180f398cf3596332d10a2
5
5
  SHA512:
6
- metadata.gz: 29dc42a6f336942cfe830657e71611c4ae4d6bb02dc3868489353660fb304817fd0eaf8a91574139b9793796e8921c899cad2b3ca72ba04079af6ba50c2a0f78
7
- data.tar.gz: a6cb3fb25065d772f52df814fcd67da042d7ea265de6a12ef165f59152e371fda43948bafc1d880841959586f5b931979227a23acc74fbdcb6ed5ddcbe419296
6
+ metadata.gz: c3e8e7bd83ef16eee381734f75bd5991c1395c12d5546a6bce001f491d97c5e45473786cc9a38c32fedb8ceb553d428703e904f1edce110c0c0cd2f1fab895f0
7
+ data.tar.gz: ae7fc9b730aff2155853fb2e136c955df4beaefcf2e81e7d67781342b237cd20765592956ae8e26d0f5491ae29d843621f0ffd3a06d3bc6d795243818d700376
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- E�m�LӨq�J'pb�a�6��D7:��t�.O�t�E
2
- a���p�a俁���
1
+
2
+ n�������O�.��� ��ӯ{<��Ш�‹�kr����f�
3
+ �s$'
data.tar.gz.sig CHANGED
Binary file
@@ -16,7 +16,7 @@ class PolyrexSchema
16
16
  end
17
17
 
18
18
  def to_a()
19
- scan_to_a(@doc.root.element 'records/.')
19
+ scan_to_a(@doc.root.xpath 'records/.')
20
20
  end
21
21
 
22
22
  def to_doc()
@@ -65,18 +65,22 @@ class PolyrexSchema
65
65
  )
66
66
  end
67
67
 
68
- def scan_to_a(r)
68
+ def scan_to_a(nodes)
69
69
 
70
- a = r.xpath('summary/*/name()') # => ["entry", "format_mask"]
71
- fields = (a - ["format_mask"]).map(&:to_sym)
72
- node = r.element 'records/.'
70
+ nodes.map do |r|
73
71
 
74
- if node then
75
- children = scan_to_a(node)
76
- [r.name.to_sym, *fields, children]
77
- else
78
- [r.name.to_sym, *fields]
72
+ a = r.xpath('summary/*/name()') # => ["entry", "format_mask"]
73
+ fields = (a - ["format_mask"]).map(&:to_sym)
74
+ node = r.xpath 'records/.'
75
+
76
+ if node.any? then
77
+ children = scan_to_a(node)
78
+ [r.name.to_sym, *fields, children]
79
+ else
80
+ [r.name.to_sym, *fields]
81
+ end
79
82
  end
83
+
80
84
  end
81
85
 
82
86
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex-schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  x3ppGgUf/zri8F8syPC4U/PhiV9ZBYGjFZDoQWr9TW6gJ1rEPuB1RYH9RPLaSYy4
32
32
  SFJGImVxuM2M+Q==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-06-10 00:00:00.000000000 Z
34
+ date: 2014-06-11 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexle
metadata.gz.sig CHANGED
Binary file