dynarex 1.2.56 → 1.2.57

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: 16bba2f2ab993f7eb53a568efb0a9f17c7a252be
4
- data.tar.gz: 4ff34ef303155d85f401c995c8a386c056ef2b24
3
+ metadata.gz: d42eb9a5d0717deaab404e5de5a46aba88618505
4
+ data.tar.gz: 43258f7e46ec208c9987ad051855b030c34846e0
5
5
  SHA512:
6
- metadata.gz: 3be10e56019dfcbc80eecf7e37d8220505027783c8f0e7c2d7acc21921adaf1d3b636039bc78765995bdb0b2e48bdc931b5990b2a0fa1d5e46684e417799da47
7
- data.tar.gz: a522619b8693cc939b00413031d440f0134b88aa2354c2941cf0da4e12da5f218d3adef9f91691f7fabdf3ce34a665aaf70aeccf19afa93940706e17e4dc285a
6
+ metadata.gz: 9c758ffd422a1b382e945b458d74785db9b1daf173eb2f75bcb02044d47dd8d9b02783ccd85cbab8e18061682383f658583daac295819c43bd55d95d2015efa7
7
+ data.tar.gz: ff5a7cfe62dd3244cd1cd91c30bae062a8e548a54b4eb4d1a61ff817ef9f1d7ec51666aaf349e33335dabdd74e5d6f64383c3d637676bd4132f94c53a797ad09
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -34,7 +34,7 @@ class Dynarex
34
34
 
35
35
  def initialize(location=nil)
36
36
  #puts Rexle.version
37
- @delimiter = ' '
37
+ @delimiter = ''
38
38
  open(location) if location
39
39
  if @order == 'descending' then
40
40
  @records = records_to_h(:descending)
@@ -50,7 +50,15 @@ class Dynarex
50
50
  end
51
51
 
52
52
  def delimiter=(separator)
53
+
53
54
  @delimiter = separator
55
+
56
+ if separator.length > 0 then
57
+ @summary[:delimiter]
58
+ else
59
+ @summary.delete :delimiter
60
+ end
61
+
54
62
  @format_mask = @format_mask.to_s.gsub(/\s/, separator)
55
63
  @summary[:format_mask] = @format_mask
56
64
  end
@@ -182,6 +190,19 @@ EOF
182
190
  self.summary[x]}.join("\n")
183
191
  end
184
192
 
193
+ if @raw_header then
194
+ declaration = @raw_header
195
+ else
196
+ smry_fields = %i(schema)
197
+ smry_fields << :delimiter if self.delimiter.length > 0
198
+ s = smry_fields.map {|x| "%s=\"%s\"" % [x, self.send(x)]}.join ' '
199
+ #declaration = "<?dynarex %s ?>" % s
200
+ declaration = %Q(<?dynarex %s format_mask="%s"?>\n) %
201
+ [s, self.format_mask.gsub('"', '\"')]
202
+ end
203
+
204
+ header = declaration + sumry
205
+
185
206
  if self.summary[:rawdoc_type] == 'rowx' then
186
207
  a = self.fields.map do |field|
187
208
  "<xsl:if test=\"%s != ''\">
@@ -195,17 +216,14 @@ EOF
195
216
  xslt = Nokogiri::XSLT(xsl_buffer)
196
217
  out = xslt.transform(Nokogiri::XML(@doc.to_s))
197
218
 
198
- if @raw_header then
199
- declaration = @raw_header
200
- else
201
- declaration = %Q(<?dynarex schema="%s"?>\n) % self.schema.gsub('"', '\"')
202
- end
203
- declaration + sumry + "\n--+\n" + out.text
219
+ header + "\n--+\n" + out.text
204
220
 
205
221
  elsif self.delimiter.length > 0 then
222
+
206
223
  tfo = TableFormatter.new border: false, nowrap: true, divider: self.delimiter
207
- tfo.source = self.to_h.map{|x| x.values}
208
- tfo.display
224
+ tfo.source = self.to_h.map{|x| x.values}
225
+ header + tfo.display
226
+
209
227
  else
210
228
 
211
229
  format_mask = self.format_mask
@@ -217,13 +235,7 @@ EOF
217
235
  xslt = Nokogiri::XSLT(xsl_buffer)
218
236
 
219
237
  out = xslt.transform(Nokogiri::XML(@doc.to_s))
220
- if @raw_header then
221
- declaration = @raw_header
222
- else
223
- declaration = %Q(<?dynarex schema="%s" format_mask="%s"?>\n) %
224
- [self.schema, self.format_mask.gsub('"', '\"')]
225
- end
226
- declaration + sumry + "\n" + out.text
238
+ header + "\n" + out.text
227
239
  end
228
240
 
229
241
  #xsl_buffer.sub!(/\[!regex_values\]/, xslt_format)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.56
4
+ version: 1.2.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file