dynarex 1.2.69 → 1.2.70

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: 9e2ea07ef7c9fd67bf4e46e093e7a3cf92f74bea
4
- data.tar.gz: 0bb056ad0eaa4fe8ae7a338eaf721ed5b66042b3
3
+ metadata.gz: d9f360b95bf319e679a611beaf83c6a3c4a005e0
4
+ data.tar.gz: b62a391947c25a71c5407cf75dab224394658b1e
5
5
  SHA512:
6
- metadata.gz: 4899ded695527a106d10e44794a40ced3f1fd3549222116872097f1df8befe4b0406e34d94dd1dbdc8b558cb40ef743a281576ce0f837b1d5820b1dd40cae7eb
7
- data.tar.gz: 5316dcd03c943420cab2067db4d1b962d834eaf7a9e48a027e33739e64051a1253162f7214f5f58379f2f5ba39b647fd9231a339fd7dadf1a244ec8baf559064
6
+ metadata.gz: 21d419e6729c9327ab672df7ace69418710d236f05651089ef057e01712409f2d81c89f94b339e0610e8319e8d2e7ec80e62887f8a58d08c6563c1dbfb154d31
7
+ data.tar.gz: 9da3609f0ee8a90f16eab8b89541b7e014de38c33e6e806178943ea6bfbeae6239f3612864ad64d308110673285ad37b040007e78f4e5d1c871cce4d14103e4c
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/dynarex.rb CHANGED
@@ -386,7 +386,7 @@ EOF
386
386
 
387
387
  xml.send key, value.gsub('>','>')\
388
388
  .gsub('<','&lt;')\
389
- .gsub(/&\w*./) {|x| x[-1] == ';' ? x : x.sub('&','&amp;')}
389
+ .gsub(/(&\s|&[a-zA-Z\.]+;?)/) {|x| x[-1] == ';' ? x : x.sub('&','&amp;')}
390
390
 
391
391
  end
392
392
  end
@@ -409,8 +409,10 @@ EOF
409
409
  val = value.send(value.is_a?(String) ? :to_s : :to_yaml)
410
410
  xml.send(name, val.gsub('>','&gt;')\
411
411
  .gsub('<','&lt;')\
412
- .gsub(/&\w*./) {|x| x[-1] == ';' ? x : x.sub('&','&amp;')}
413
- )
412
+ .gsub(/(&\s|&[a-zA-Z\.]+;?)/) do |x|
413
+ x[-1] == ';' ? x : x.sub('&','&amp;')
414
+ end
415
+ )
414
416
  end
415
417
  end
416
418
  end
@@ -769,7 +771,7 @@ EOF
769
771
  def dynarex_new(s)
770
772
  @schema = s
771
773
  ptrn = %r((\w+)\[?([^\]]+)?\]?\/(\w+)\(([^\)]+)\))
772
-
774
+
773
775
  if s.match(ptrn) then
774
776
  @root_name, raw_summary, record_name, raw_fields = s.match(ptrn).captures
775
777
  summary, fields = [raw_summary || '',raw_fields].map {|x| x.split(/,/).map &:strip}
@@ -802,8 +804,9 @@ EOF
802
804
  end
803
805
 
804
806
  def open(s)
805
-
807
+
806
808
  if s[/</] then # xml
809
+
807
810
  buffer = s
808
811
  elsif s[/[\[\(]/] # schema
809
812
  dynarex_new(s)
@@ -815,6 +818,7 @@ EOF
815
818
  end
816
819
 
817
820
  @doc = Rexle.new(buffer) unless @doc
821
+
818
822
  @schema = @doc.root.text('summary/schema')
819
823
  @root_name = @doc.root.name
820
824
  @summary = summary_to_h
@@ -903,7 +907,8 @@ EOF
903
907
 
904
908
  if node then
905
909
  text = node.text.unescape
906
- r.merge node.name.to_sym => (text[/^--- /] ? YAML.load(text) : text)
910
+
911
+ r.merge node.name.to_sym => (text[/^--- |^\[/] ? YAML.load(text) : text)
907
912
  else
908
913
  r
909
914
  end
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.69
4
+ version: 1.2.70
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: 2013-12-11 00:00:00.000000000 Z
32
+ date: 2013-12-13 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rexle
metadata.gz.sig CHANGED
Binary file