polyrex-objects 0.9.2 → 0.9.3

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: bcd50574bb0730c96d0ed38ddabfdf12ff67d4b2
4
- data.tar.gz: 5e465000020840500c449601b1fee3ae3c3155a2
3
+ metadata.gz: c49e029cceac6f6735ce1d5e685645dcf5396a22
4
+ data.tar.gz: 2a6020d4a3e4658b73335adae162e1d9fba136bc
5
5
  SHA512:
6
- metadata.gz: c8988c70db4eb0288f6fce410c1f89acfbe76e99a6831f9e66d5cf78973535a44b6433387483d08c88d2c5fbe98f42703d5aeea90c698ab2f3dd7d895b3556b1
7
- data.tar.gz: ea42e1f93972fae14493367ef4f1b2fe1c0e3c0367123023c49928567fdedec185534a226106150d4d50ab96da4531d35546b628a9cdfae709009425ab95bc0c
6
+ metadata.gz: ca039cfdb068e34282f9131686dbfc6ba9d59446dee1807e38865baff356221fd8d0556a7282502d97ac86c3b810ef491db2abc298ef19933db218abdcfca2ee
7
+ data.tar.gz: 0ee1a45b0d3de1dacef8038d8427242bd8d418c1d391d4ce46dc899f6562c4cb86b2f355705c70234f75e7d8197e73485fcf930dad682f480c606ad6d40906e0
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -89,9 +89,10 @@ class PolyrexObjects
89
89
  .sub('[','(').sub(']',')')
90
90
  e.text = "%s/%s" % [e.text, child_schema]
91
91
  summary.delete('format_mask')
92
- summary.element('recordx_type').text = 'dynarex'
92
+ summary.delete('recordx_type')
93
93
 
94
94
  summary.add root.element('records/*/summary/format_mask').clone
95
+
95
96
  root.xpath('records/*/summary/format_mask').each(&:delete)
96
97
 
97
98
  xsl_buffer =<<EOF
@@ -118,10 +119,19 @@ xsl_buffer =<<EOF
118
119
  </xsl:template>
119
120
  </xsl:stylesheet>
120
121
  EOF
121
- #jr130316 xslt = Nokogiri::XSLT(xsl_buffer)
122
- #jr130316 buffer = xslt.transform(Nokogiri::XML(root.xml)).to_s
123
- buffer = Rexslt.new(xsl_buffer, root.xml).to_s
124
- Dynarex.new buffer
122
+
123
+ File.write '/home/james/test.xsl', xsl_buffer
124
+ File.write '/home/james/test.xml', root.xml
125
+ begin
126
+ rexslt = Rexslt.new(xsl_buffer, root.xml)
127
+ buffer = rexslt.to_s
128
+ rescue
129
+ puts ($!).inspect
130
+ exit
131
+ end
132
+
133
+ r = Dynarex.new buffer
134
+ r
125
135
 
126
136
  end
127
137
 
@@ -131,6 +141,10 @@ EOF
131
141
  r.merge(field.capitalize => self.method(field).call)
132
142
  end
133
143
  end
144
+
145
+ def to_s()
146
+ build(self.records).join("\n")
147
+ end
134
148
 
135
149
  def to_xml(options={})
136
150
  @node.xml(options)
@@ -143,6 +157,25 @@ EOF
143
157
  def xpath(s)
144
158
  @node.xpath(s)
145
159
  end
160
+
161
+ private
162
+
163
+ def build(records, indent=0)
164
+
165
+ records.map do |item|
166
+
167
+ summary = item.element 'summary'
168
+ format_mask = summary.text('format_mask').to_s
169
+ line = format_mask.gsub(/\[![^\]]+\]/){|x| summary.text(x[2..-2]).to_s}
170
+
171
+ records = item.element('records').elements.to_a
172
+
173
+ if records.length > 0 then
174
+ line = line + "\n" + build(records, indent + 1).join("\n")
175
+ end
176
+ (' ' * indent) + line
177
+ end
178
+ end
146
179
  end
147
180
 
148
181
  def initialize(schema, node=nil, id: '0')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex-objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -12,26 +12,26 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
14
  YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmV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TQqtm/3qYXr4Fcsmov4E7uE/IPqzajB
32
+ s9lI00OyqNZ3ww==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-03-13 00:00:00.000000000 Z
34
+ date: 2016-09-19 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: polyrex-createobject
@@ -39,20 +39,20 @@ dependencies:
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.5'
42
+ version: '0.6'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.5.2
45
+ version: 0.6.0
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: '0.5'
52
+ version: '0.6'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.5.2
55
+ version: 0.6.0
56
56
  description:
57
57
  email: james@r0bertson.co.uk
58
58
  executables: []
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.4.8
83
+ rubygems_version: 2.5.1
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: Polyrex-objects automically builds objects from a Polyrex schema
metadata.gz.sig CHANGED
Binary file