polyrex-objects 0.9.5 → 0.9.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/polyrex-objects.rb +16 -6
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +1 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0dc097939d63929e89cd861d6b36ddb83fbcc0cb
|
|
4
|
+
data.tar.gz: 8260ffb731a9132ff5994ab3b326085983ea9204
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8ba77914c031cf604a846ae0828dcefe7d8a686cb50ad30b8b2f389033288e6df7305644ada2ece06a14382e4c8bb6ebf6be0d9688f92fa3fcc22546449e7df
|
|
7
|
+
data.tar.gz: f0281a320ebc45351bcb2693a1948627389ee03e6230113e2a7eb1ece6eaa662c39929a735ba420b460a94cbeba469e1ebeb48b36f556dd42aff77c1734d76e7
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/polyrex-objects.rb
CHANGED
|
@@ -14,10 +14,13 @@ class PolyrexObjects
|
|
|
14
14
|
|
|
15
15
|
attr_reader :node, :id
|
|
16
16
|
|
|
17
|
-
def initialize(node, id: '0')
|
|
17
|
+
def initialize(node, id: '0', objects: nil)
|
|
18
|
+
|
|
18
19
|
@@id = id
|
|
19
20
|
@node = node
|
|
20
21
|
@fields =[]
|
|
22
|
+
@objects = objects
|
|
23
|
+
|
|
21
24
|
end
|
|
22
25
|
|
|
23
26
|
def add(pxobj)
|
|
@@ -75,6 +78,14 @@ class PolyrexObjects
|
|
|
75
78
|
self.records[n]
|
|
76
79
|
end
|
|
77
80
|
|
|
81
|
+
def parent()
|
|
82
|
+
|
|
83
|
+
parent_node = self.node.parent.parent
|
|
84
|
+
@objects[parent_node.name]\
|
|
85
|
+
.new(parent_node, id: parent_node.attributes[:id], objects: @objects)
|
|
86
|
+
|
|
87
|
+
end
|
|
88
|
+
|
|
78
89
|
def to_doc()
|
|
79
90
|
Rexle.new @node.to_a
|
|
80
91
|
end
|
|
@@ -120,8 +131,7 @@ xsl_buffer =<<EOF
|
|
|
120
131
|
</xsl:stylesheet>
|
|
121
132
|
EOF
|
|
122
133
|
|
|
123
|
-
|
|
124
|
-
File.write '/home/james/test.xml', root.xml
|
|
134
|
+
|
|
125
135
|
begin
|
|
126
136
|
rexslt = Rexslt.new(xsl_buffer, root.xml)
|
|
127
137
|
buffer = rexslt.to_s
|
|
@@ -256,10 +266,10 @@ EOF
|
|
|
256
266
|
|
|
257
267
|
classx = []
|
|
258
268
|
classx << "class #{name.capitalize} < PolyrexObject"
|
|
259
|
-
classx << "def initialize(node=nil, id: '0')"
|
|
269
|
+
classx << "def initialize(node=nil, id: '0', objects: nil)"
|
|
260
270
|
classx << " @id = id"
|
|
261
271
|
classx << " node ||= Rexle.new('<#{name}><summary/><records/></#{name}>').root"
|
|
262
|
-
classx << " super(node, id: id)"
|
|
272
|
+
classx << " super(node, id: id, objects: objects)"
|
|
263
273
|
|
|
264
274
|
classx << " a = node.xpath('summary/*',&:name)"
|
|
265
275
|
classx << " yaml_fields = a - (#{fields} + %w(format_mask))"
|
|
@@ -340,4 +350,4 @@ EOF
|
|
|
340
350
|
|
|
341
351
|
|
|
342
352
|
|
|
343
|
-
end
|
|
353
|
+
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
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.
|
|
4
|
+
version: 0.9.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
oXSdIUkeIE8xMnBo9hsYRTxYptr4zHbWPTQqtm/3qYXr4Fcsmov4E7uE/IPqzajB
|
|
32
32
|
s9lI00OyqNZ3ww==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2016-11-
|
|
34
|
+
date: 2016-11-25 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: polyrex-createobject
|
metadata.gz.sig
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
$����G'鋽� ������hT�9Z��r�H�˼�78
|
|
1
|
+
+�v���{.I�f8���k����Me��NN�kM_feH���ᣴ�ፃVRN�P��{���c*�s�It�X���u��/�d$�G�}����K�{u��R#?�:���2H�5�S�*y($����'ӕ*m�?Б\���님�. ��"XX��]Z[�꘧�=��J�
|