sectionx 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sectionx.rb +11 -4
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac8a7ebe2e9fd4d9496e6a5178efbdf4c7293bb2
|
4
|
+
data.tar.gz: be48f55c653c5f40646bcdcb04971f0da2c845e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe2ee4899f715ca458e3d4313dd60946805999969e92f9774924de572861f3973da88f254dddb3357ea39de667ff908b98622efbfe718aa2cf502c390da4b4f7
|
7
|
+
data.tar.gz: b37c6df0eb61153779da654dccf2d4ff88ce657dbfdee9eb939781e3593f6483f7e5b7bc620c7d29f9ea265edd3e894b62e1baf11192f8eb618c4ea01ae44c6d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/sectionx.rb
CHANGED
@@ -154,7 +154,7 @@ class SectionX
|
|
154
154
|
|
155
155
|
|
156
156
|
def parse_root_node(e)
|
157
|
-
|
157
|
+
|
158
158
|
attributes = e.attributes
|
159
159
|
summary = RecordX.new e.xpath('summary/*')
|
160
160
|
summary_methods = (summary.keys - self.public_methods)
|
@@ -175,9 +175,16 @@ class SectionX
|
|
175
175
|
end
|
176
176
|
|
177
177
|
a = e.xpath('sections/section')
|
178
|
-
section1 = a.shift
|
179
|
-
sections = {'' => SectionX.new(section1)}
|
180
178
|
|
179
|
+
return [attributes, summary] if a.empty?
|
180
|
+
|
181
|
+
sections = {}
|
182
|
+
|
183
|
+
if a[0] and a[0].attributes.empty? then
|
184
|
+
section1 = a.shift
|
185
|
+
sections = {'' => SectionX.new(section1)}
|
186
|
+
end
|
187
|
+
|
181
188
|
sections = a.inject(sections) do |r, section|
|
182
189
|
|
183
190
|
h = section.attributes
|
@@ -213,4 +220,4 @@ EOF
|
|
213
220
|
sx.import s
|
214
221
|
puts sx.to_xml pretty: true
|
215
222
|
|
216
|
-
end
|
223
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|