sectionx 0.4.0 → 0.4.1

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: eb55c370128a3ed86e53695f3573fd767b56c5de
4
- data.tar.gz: 4e198c9a6f8ff374eb1f95d2e09e88f8d63ee625
3
+ metadata.gz: ac8a7ebe2e9fd4d9496e6a5178efbdf4c7293bb2
4
+ data.tar.gz: be48f55c653c5f40646bcdcb04971f0da2c845e9
5
5
  SHA512:
6
- metadata.gz: fcb197e99e30d892ec8410121925249b70c4814cc65a1bd6a4c1170f0613102bfc41370f211cb79e66326125a106bf1729f277e1a1b35b28987c2d66647e8bc4
7
- data.tar.gz: 98dd6b1b0cdd40418df1ff5aa6cf3a4c04c24bf76cfc1ef17881f263f3f06230f7f75c6cb512edbac7975769d42819593c4b1dd0275233ab83078f5e648cafa7
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sectionx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file