polyrex 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. data/lib/polyrex.rb +6 -10
  2. metadata +1 -1
data/lib/polyrex.rb CHANGED
@@ -21,11 +21,8 @@ class Polyrex
21
21
  field_names = root_format_mask.to_s.scan(/\[!(\w+)\]/).flatten.map(&:to_sym)
22
22
  @root_name = @recordx.shift
23
23
 
24
- build_tree(a, new_a, 0, history)
25
- out = scan_link(new_a)
26
-
27
24
  summary = field_names.map {|x| "<%s/>" % x}.join
28
- @doc = Document.new("<%s><summary>%s</summary></%s>" % [root_name, summary, root_name])
25
+ @doc = Document.new("<%s><summary>%s</summary></%s>" % [@root_name, summary, @root_name])
29
26
 
30
27
  #----
31
28
 
@@ -124,15 +121,9 @@ end
124
121
  history = []
125
122
  history << new_a
126
123
 
127
- root_format_mask = @format_masks.shift
128
- field_names = root_format_mask.to_s.scan(/\[!(\w+)\]/).flatten.map(&:to_sym)
129
- root_name = @recordx.shift
130
-
131
124
  build_tree(a, new_a, 0, history)
132
125
  out = scan_link(new_a)
133
126
 
134
- summary = field_names.map {|x| "<%s/>" % x}.join
135
- @doc = Document.new("<%s><summary>%s</summary></%s>" % [root_name, summary, root_name])
136
127
  records = Document.new("<records>%s</records>" % out)
137
128
  @doc.root.add records
138
129
  end
@@ -178,10 +169,15 @@ end
178
169
  tag_name = @recordx[i].to_s
179
170
 
180
171
  line= x[0].reverse.map(&:strip).join
172
+
173
+ puts 'format_masks ' + @format_masks.inspect
181
174
  @field_names = @format_masks[i].to_s.scan(/\[!(\w+)\]/).flatten.map(&:to_sym)
175
+ puts 'field_names : ' + @field_names.inspect
182
176
 
183
177
  t = @format_masks[i].to_s.gsub(/\[!(\w+)\]/, '(.*)').sub(/\[/,'\[').sub(/\]/,'\]')
178
+ puts 'line : ' + line.inspect
184
179
  field_values = line.match(/#{t}/).captures
180
+ puts 'field_values : ' + field_values.inspect
185
181
 
186
182
  fields = @field_names.zip(field_values).map{|name, value| "<%s>%s</%s>" % [name,value,name]}.join
187
183
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors: []
7
7