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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b76e2cf3418301290b726a502ffd7c015ed026a8
4
- data.tar.gz: 3a1ec50deb3bd71520810390fc83ec9c2f158c91
3
+ metadata.gz: 076919abc67a3b340d1397bfaceab31c9116db95
4
+ data.tar.gz: c20dfbd93fdd4c10d96c27fa6d654ebff72fd2bf
5
5
  SHA512:
6
- metadata.gz: e1e39b4c2a3b7b7bfd0ea80c794f98f3e9a546c2ce16000271f4b0489a1840e34b2c933eb8f7798ca6b5bad1a470e3edd54b9b16162cf6081c993442dba58a3c
7
- data.tar.gz: 1a90a16e5d01d2c49c52bbfe64e7309796b6bb00964af5d99610af38af6f241f9c93ee0a977a74f6a325f70abb557122049dd23472a6a7d2f7b1cac5b460903f
6
+ metadata.gz: a20515d76d1a4a05091bf748124e3b691e864cb580988f62c61dad7bff3b9c7d26f56fda8bead2c3753f8c689fbe54b3db102f722e87d49122621749a76b7b03
7
+ data.tar.gz: 923b57857ccd789eb69cf96816b6eb533a444104a7eceb5b94aac11c23e25f02b37d1f2ac8590aafb458cbbbcfe4f69ed94735bff526b4d6c2e90c9365bb17da
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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 = Rexle.new buffer
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
- buffer = PolyrexSchema.new(child_schema[/^[^\/]+/]).to_s
128
- record = Rexle.new buffer
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
- local_schema = "%s[%s]" % [cname, fields.join(',')]
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 = "%s[%s]" % [record, fields.join(',')]
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
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-25 00:00:00.000000000 Z
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