dynarex 1.2.77 → 1.2.78

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: a0fa2bf729702e0577aa9477cc97d9d4063fac0c
4
- data.tar.gz: e69185901f33825a52a89beebec881cedf682cfd
3
+ metadata.gz: 27b5308dc3d2dda89ebd2ea5a05a5d76a2f558f0
4
+ data.tar.gz: 9b9022fddb5d3b5fea15272804f636b86dfcfab8
5
5
  SHA512:
6
- metadata.gz: 90d0fdf881687702da73548fa44db1e887f4c806c1dcd66e9656f2fe9ab50de50a63e7f170498601b1cbf205af086a57839b8ff96e6a6204db07fe0709166ed4
7
- data.tar.gz: 360b6348028f51a584c06e72b07fb695a6e6e30cde68125f3260174abe2b908b1fe67ffd11ef9f630f534e055794fd696e1f44d2b625a997def74db77fb865b0
6
+ metadata.gz: d4c160e217984299eb5d5167cd9359daf8d5b4ab429013d81fed3ed6c6530b66d181e28af525cc8a6636feb78963cc122b8cd2d02e3d0daed4438da098be5d5f
7
+ data.tar.gz: c23164e20bb9c4d79faf04fcb05d74e38a05fbe5b681108664d68b79cab6f809c263e74102c714688958b97d4d1b760342ab3adaea84c31e91fd452edbe8b2bd
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -35,7 +35,7 @@ class Dynarex
35
35
  def initialize(location=nil)
36
36
  #puts Rexle.version
37
37
  @delimiter = ''
38
- open(location) if location
38
+ openx(location) if location
39
39
  if @order == 'descending' then
40
40
  @records = records_to_h(:descending)
41
41
  rebuild_doc
@@ -68,7 +68,7 @@ class Dynarex
68
68
  h = {xml: o[:xml], schema: @schema, foreign_schema: o[:schema]}
69
69
  buffer = DynarexImport.new(h).to_xml
70
70
 
71
- open(buffer)
71
+ openx(buffer)
72
72
  self
73
73
  end
74
74
 
@@ -103,7 +103,7 @@ class Dynarex
103
103
  end
104
104
 
105
105
  def schema=(s)
106
- open s
106
+ openx s
107
107
  end
108
108
 
109
109
  def type=(v)
@@ -203,7 +203,7 @@ EOF
203
203
  s = smry_fields.map {|x| "%s=\"%s\"" % \
204
204
  [x, self.send(x).gsub('"', '\"') ]}.join ' '
205
205
  #declaration = "<?dynarex %s ?>" % s
206
- declaration = %Q(<?dynarex %s ?>\n) % s
206
+ declaration = %Q(<?dynarex %s?>\n) % s
207
207
  end
208
208
 
209
209
  header = declaration + sumry
@@ -756,7 +756,13 @@ EOF
756
756
 
757
757
  a = lines.map.with_index do |x,i|
758
758
  created = Time.now.to_s
759
- h = Hash[@fields.zip(x.map{|t| t.to_s[/^---/] ? YAML.load(t) : t})]
759
+ h = Hash[
760
+ @fields.zip(
761
+ x.map do |t|
762
+ t.to_s[/^---/] ? YAML.load(t) : unescape(t)
763
+ end
764
+ )
765
+ ]
760
766
  h[@fields.last] = checked[i].to_s if @type == 'checklist'
761
767
  [h[@default_key], {id: '', created: created, last_modified: '', body: h}]
762
768
  end
@@ -790,6 +796,10 @@ EOF
790
796
  self
791
797
  end
792
798
 
799
+ def unescape(s)
800
+ s.gsub('&lt;', '<').gsub('&gt;','>')
801
+ end
802
+
793
803
  def dynarex_new(s)
794
804
  @schema = s
795
805
  ptrn = %r((\w+)\[?([^\]]+)?\]?\/(\w+)\(([^\)]+)\))
@@ -825,7 +835,7 @@ EOF
825
835
  create_find @fields
826
836
  end
827
837
 
828
- def open(s)
838
+ def openx(s)
829
839
 
830
840
  if s[/</] then # xml
831
841
 
@@ -926,7 +936,7 @@ EOF
926
936
  body = @fields.inject({}) do |r,field|
927
937
 
928
938
  node = row.element field.to_s
929
-
939
+
930
940
  if node then
931
941
  text = node.text.unescape
932
942
 
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.77
4
+ version: 1.2.78
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  kUea9jZD+xTq1Js9t2BHCz3Ev/sgS7CaijrbQetbNwzasFGHRd30xBEwd4zANQOp
30
30
  i0OBH0e4iIMkv+Q+PYlNRnlpQogsAdTs
31
31
  -----END CERTIFICATE-----
32
- date: 2014-01-05 00:00:00.000000000 Z
32
+ date: 2014-01-12 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rexle
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  requirements: []
214
214
  rubyforge_project:
215
- rubygems_version: 2.2.0.rc.1
215
+ rubygems_version: 2.1.11
216
216
  signing_key:
217
217
  specification_version: 4
218
218
  summary: The Dynarex gem can create, read, update or delete rows of Dynarex flavoured
metadata.gz.sig CHANGED
Binary file