polyrex 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9dba8b10237be61e5634ffd96c6c653fffe255d7
4
- data.tar.gz: ebf0e7d1ecb1953b34d3cc10dda537f1a5a87d4e
3
+ metadata.gz: fcd21788c7c14fb01dfb4283c2caf193795077c0
4
+ data.tar.gz: 47560d97b8866cba55de8bc36b88d12af5eabdb5
5
5
  SHA512:
6
- metadata.gz: aa2d5bf49b5ecb8d69a430c6f050df625beed0db6fb28a18ced8c2dc6acdcfefb749a30b871d2cb8cab53f9d7f29670c06f763220b9af76f5cccb7f428e5b576
7
- data.tar.gz: 23f071f7efa4d9a57a0dec0133ec63b32357cc50336c973d36b8736143158e9d1aae44c37f1ef5a1d36611230f6ccd4ed22f5c137029ffbd042066b9d7413205
6
+ metadata.gz: cc1bc98591ffc9db1d20f6cd5fb54622007db7ee9aad62af5a19709c375d44e3a983c9b763bd898b432978faff1c40cf057881b1a67de63329a3af51f8b58bf0
7
+ data.tar.gz: ae20f18736fbd06c28ff6d815a482cd8cbac417b62e8ac80adbf76c55804908c52bd3531bbc8c0cf1f4f5c8c8ef0a3cf08b312d32fa03cde92f5a7535056da63
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- ��onm���rj�U�N8z_V���2�t&؂Ԫ.�5i��DH�|mw@5�pc�`v-�ض���!O)������Z���|��T,�(s.V!*�@��t^D���M��2*!�39D�Q���,�!�2t?ȡ��2�U�C�s;���j��Vsg��'–狣�f�KT���?t6z��H��8�x�Q�����ܴN�q��(��ۅ�<��DW��m=<�i�5ӽ���2�-p���:X��:����xH
1
+ p 4)��l�v����KHꠓ;Ӫz�D�����ʘ�<��^
data/lib/polyrex.rb CHANGED
@@ -38,7 +38,7 @@ end
38
38
 
39
39
  class Polyrex
40
40
  attr_accessor :summary_fields, :xslt_schema, :id_counter,
41
- :schema, :type, :delimiter
41
+ :schema, :type, :delimiter, :xslt
42
42
 
43
43
  def initialize(location=nil, opt={})
44
44
 
@@ -64,6 +64,7 @@ class Polyrex
64
64
 
65
65
  @summary = RecordX.new @doc.root.xpath("summary/*")
66
66
  @summary_fields = @summary.keys
67
+
67
68
 
68
69
  end
69
70
 
@@ -121,6 +122,7 @@ class Polyrex
121
122
 
122
123
  options.merge!({pretty: pretty}) if options.empty?
123
124
  xml = @doc.to_s(options)
125
+
124
126
  buffer = block_given? ? yield(xml) : xml
125
127
  File.open(filepath,'w'){|f| f.write buffer}
126
128
  end
@@ -293,6 +295,12 @@ class Polyrex
293
295
  end
294
296
  end
295
297
 
298
+ def xslt=(value)
299
+
300
+ @summary.xslt = value
301
+
302
+ end
303
+
296
304
  def xslt_schema=(s)
297
305
  @polyrex_xslt.xslt_schema = s
298
306
  self
@@ -689,7 +697,10 @@ EOF
689
697
  end
690
698
 
691
699
 
700
+ # refreshes the XML document with any new modification from
701
+ # the summary object
692
702
  def refresh_summary()
703
+
693
704
  summary = @doc.root.element('summary')
694
705
  @summary.to_h.each do |k,v|
695
706
  e = summary.element(k.to_s)
@@ -699,6 +710,11 @@ EOF
699
710
  summary.add Rexle::Element.new(k.to_s).add_text(v)
700
711
  end
701
712
  end
713
+
714
+ if @summary.xslt then
715
+ @doc.instructions = [['xml-stylesheet',
716
+ "title='XSL_formatting' type='text/xsl' href='#{@summary.xslt}'"]]
717
+ end
702
718
  end
703
719
 
704
720
  end
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: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  xutogBWBRwktcdg7bc24/mbFcXcx5WhspVwfj6isE6q3A1nNkMtk3DHHKmUrfemr
32
32
  pWpTJQi2DFAx/g==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-10-17 00:00:00.000000000 Z
34
+ date: 2015-10-21 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: polyrex-schema
metadata.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- ���hbQ�9��̄�$����6 <��f =S��� }���F����ӷ�.���9��St�#�Pv�Mg+���W��{qWq��Zf
2
- cɳS��u6x·�{LT'l �������-Y6`�Pޛ���l~Z��ө��X�>wF��[QUC/.f
3
- ����}��TSQ��G1}�\2aru4O!�љ�艵a��
1
+ 9\w8逭w����H����ؐ�vf����hRF;܇d���o�
2
+ �RG�S ��py(onZ1T.��n"�ֻ��҄ �'2�p�nbڎ��u:�Y���&|���D�\ը���8�����eު�.� �Lc:_�<�2h���U`<��qI���Z�9G��#��j�IM6w(qb678 c���B}�<��_#᜿zSV'B��[