polyrex-createobject 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/polyrex-createobject.rb +17 -9
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 076919abc67a3b340d1397bfaceab31c9116db95
|
4
|
+
data.tar.gz: c20dfbd93fdd4c10d96c27fa6d654ebff72fd2bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a20515d76d1a4a05091bf748124e3b691e864cb580988f62c61dad7bff3b9c7d26f56fda8bead2c3753f8c689fbe54b3db102f722e87d49122621749a76b7b03
|
7
|
+
data.tar.gz: 923b57857ccd789eb69cf96816b6eb533a444104a7eceb5b94aac11c23e25f02b37d1f2ac8590aafb458cbbbcfe4f69ed94735bff526b4d6c2e90c9365bb17da
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/polyrex-createobject.rb
CHANGED
@@ -71,8 +71,10 @@ class PolyrexCreateObject
|
|
71
71
|
|
72
72
|
def create_node(parent_node, child_schema, params={}, id=nil)
|
73
73
|
|
74
|
-
buffer = PolyrexSchema.new(child_schema[/^[^\/]+/]).to_s
|
75
|
-
record =
|
74
|
+
#buffer = PolyrexSchema.new(child_schema[/^[^\/]+/]).to_s
|
75
|
+
record = PolyrexSchema.new(child_schema).to_doc
|
76
|
+
record.root.xpath('records/.').each(&:delete)
|
77
|
+
#record = Rexle.new buffer
|
76
78
|
|
77
79
|
if id then
|
78
80
|
@@id.succ!
|
@@ -108,6 +110,7 @@ class PolyrexCreateObject
|
|
108
110
|
r = []
|
109
111
|
|
110
112
|
fields = []
|
113
|
+
|
111
114
|
fields << args.shift while args.first.is_a? Symbol
|
112
115
|
|
113
116
|
class_name = cname.capitalize
|
@@ -123,9 +126,9 @@ class PolyrexCreateObject
|
|
123
126
|
|
124
127
|
define_method :create_node do |parent_node, child_schema,
|
125
128
|
params={}, id=nil|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
+
record = PolyrexSchema.new(child_schema).to_doc
|
130
|
+
record.root.xpath('records/.').each(&:delete)
|
131
|
+
|
129
132
|
if id then
|
130
133
|
@@id.succ!
|
131
134
|
else
|
@@ -153,7 +156,13 @@ class PolyrexCreateObject
|
|
153
156
|
define_method cname do |h, id=nil, &blk|
|
154
157
|
|
155
158
|
id ||= @@id
|
156
|
-
|
159
|
+
|
160
|
+
local_schema = @parent_node.parent.text('summary/schema')[/\/(.*$)/,1]
|
161
|
+
if local_schema[0] == '{' then
|
162
|
+
|
163
|
+
local_schema = "%s[%s]%s" % [cname, fields.join(','),
|
164
|
+
local_schema[/\/.*$/].to_s]
|
165
|
+
end
|
157
166
|
new_parent = create_node(@parent_node, local_schema, h, id)\
|
158
167
|
.element('records')
|
159
168
|
|
@@ -193,8 +202,7 @@ class PolyrexCreateObject
|
|
193
202
|
define_method remaining.name.downcase.to_sym do |h, id=nil, &blk|
|
194
203
|
|
195
204
|
id ||= @@id
|
196
|
-
local_schema =
|
197
|
-
|
205
|
+
local_schema = @parent_node.parent.text('summary/schema')[/\/(.*$)/,1]
|
198
206
|
new_parent = create_node(@parent_node, local_schema,
|
199
207
|
params, id).element('records')
|
200
208
|
obj = remaining.new
|
@@ -217,4 +225,4 @@ class PolyrexCreateObject
|
|
217
225
|
return klass
|
218
226
|
end
|
219
227
|
|
220
|
-
end
|
228
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyrex-createobject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
f3O5lCaUfMDZbRHRyvXjy/4PFRQKLr6ZLbpQN+dWceS6/82/5xWEL/7Bo/86R5xN
|
32
32
|
JL6pGH//inbMWQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2014-07-
|
34
|
+
date: 2014-07-26 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: polyrex-schema
|
metadata.gz.sig
CHANGED
Binary file
|