dynarex 1.2.5 → 1.2.6

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/dynarex.rb +7 -6
  2. metadata +2 -2
@@ -18,6 +18,7 @@ class Dynarex
18
18
 
19
19
  attr_accessor :format_mask, :delimiter, :xslt_schema, :schema, :order
20
20
 
21
+ def self.gem_url() 'http://www.jamesrobertson.eu/ruby/dynarex#1.2,3' end
21
22
 
22
23
  #Create a new dynarex document from 1 of the following options:
23
24
  #* a local file path
@@ -41,7 +42,7 @@ class Dynarex
41
42
  end
42
43
 
43
44
  def delimiter=(separator)
44
- @format_mask = @format_mask.to_s.gsub(/\s{2}/, separator)
45
+ @format_mask = @format_mask.to_s.gsub(/\s/, separator)
45
46
  @summary[:format_mask] = @format_mask
46
47
  end
47
48
 
@@ -168,11 +169,12 @@ EOF
168
169
 
169
170
  def create(arg, id=nil)
170
171
 
171
- #jr190512 rebuild_doc()
172
+ #jr291012 rebuild_doc()
173
+ #jr291012 (load_records; rebuild_doc) if @dirty_flag == true
172
174
  methods = {Hash: :hash_create, String: :create_from_line}
173
175
  send (methods[arg.class.to_s.to_sym]), arg, id
174
176
 
175
- #jr190512 load_records
177
+ #jr291012load_records
176
178
  @dirty_flag = true
177
179
  self
178
180
  end
@@ -370,8 +372,7 @@ EOF
370
372
 
371
373
  fields.each do |k,v|
372
374
  element = Rexle::Element.new(k.to_s)
373
- element.root.text = v.to_s if v
374
-
375
+ element.root.text = v.to_s.gsub('<','&lt;').gsub('>','&gt;') if v
375
376
  record.add element if record
376
377
  end
377
378
 
@@ -539,7 +540,7 @@ EOF
539
540
 
540
541
  end
541
542
 
542
- format_mask = fields ? fields.map {|x| "[!%s]" % x}.join(' ') : ''
543
+ format_mask = fields ? fields.map {|x| "[!%s]" % x}.join(' ') : ''
543
544
 
544
545
  @summary = Hash[summary.zip([''] * summary.length).flatten.each_slice(2)\
545
546
  .map{|x1,x2| [x1.to_sym,x2]}]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.5
5
+ version: 1.2.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Robertson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-11-03 00:00:00 Z
13
+ date: 2012-11-15 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rexle