polyrex-objects 0.8.2 → 0.8.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: ba02ab30e8b04e7f0020b3549a108510cfcda922
4
- data.tar.gz: d3685720b0aeafd03860d3f2055aa61c9dbd66ed
3
+ metadata.gz: b68af1bbeb21405d07f581ef6673bbfbf749424f
4
+ data.tar.gz: 7a5acc327b212f827aaebdaa0349a0f8a1dc86b9
5
5
  SHA512:
6
- metadata.gz: fffd44cbdb918767f751e0672f68fcdd4e3cbb2883b7701120c6a4d4f8aacc9123754427d70091589c4f3fad62c0ba9dcd60228895490c44fd67da355adcb3f2
7
- data.tar.gz: 41b14bec9e9043d06b70f650f598fe7dd22e89e41f8360370e12d1151cd14dc6bba8c7918f04976673c915d4031c7a73d45e6745b6d40a687d7a9c382c352394
6
+ metadata.gz: 91e961df58842c4c435e4564b82ac55be85c7b143ba7a3cb88073d90763d1b689f4db9b4a23ba9760360efcbb2feffe603cecfbbee45919e4240b8a68027d8fe
7
+ data.tar.gz: 7b87fe4e590ab7df862322467046982f9df38442c70673dbf7bb553307bf838158802ff7eadcc073fdc2bdff10560be3b3b469c0cbcb7fc98d748fbb2bb45af9
checksums.yaml.gz.sig CHANGED
Binary file
@@ -139,28 +139,20 @@ EOF
139
139
  @schema = schema
140
140
 
141
141
  if schema then
142
-
143
- #a = schema.split('/')
144
- #a.shift
145
- a = schema.scan(/\w+\[[^\]]+\]/)
142
+
146
143
  @class_names = []
147
144
 
148
- a.each do |x|
149
-
150
- r = x[/[^\{]+(?=\})/]
151
-
152
- if r then
153
- r.split(/\s*;\s*/).each do |s|
154
- name, raw_fields = s.split('[')
155
- make_class(name, raw_fields)
156
- end
157
- else
158
- name, raw_fields = x.split('[')
159
- make_class(name, raw_fields)
145
+ h = PolyrexSchema.new(schema).to_h
146
+
147
+ scan = -> (a) do
148
+ a.each do |x|
149
+ make_class(x[:name], x[:fields], x[:schema])
150
+ scan.call(x[:children]) if x[:children]
160
151
  end
161
-
162
152
  end
163
153
 
154
+ scan.call h
155
+
164
156
  if @class_names.length < 2 then
165
157
  make_def_records(@class_names.first)
166
158
  else
@@ -188,7 +180,7 @@ EOF
188
180
  end
189
181
 
190
182
  def to_a
191
- @class_names.map {|x| eval(x)}
183
+ @class_names.map {|x| eval(x.to_s)}
192
184
  end
193
185
 
194
186
  def to_h
@@ -197,10 +189,10 @@ EOF
197
189
 
198
190
  private
199
191
 
200
- def make_class(name, raw_fields)
192
+ def make_class(name, fields, schema=@schema)
193
+
194
+ if fields then
201
195
 
202
- if raw_fields then
203
- fields = raw_fields.chop.split(',').map &:strip
204
196
  @class_names << name.capitalize
205
197
 
206
198
  classx = []
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- ���c峀Q*�l�?�=WS�F�N����hͮ׻^���T1����l�}B�{3�ƃ}"՗1/gfYH�fc����%��d��GKg��ka4{fqr8��g�T�Z��!��+C1T�Ե6�s/ꌉ�Cs��2����9|��j�4qߦ����:�H�4y�m���JZr�ZG���۲������W
1
+ �@����U��}w��]��`�B4!o�%���|Nx��� �<���� \~�ih��+�pAS���SjEc��[rTv����C�FQ֟�(�6�z�7�dJmF���XP�� #�w����[����^���
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.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  C0ZUhP8IAGCVW8QD8AfZ/AgqUdh+zTRqKdhEyhXCjYyVXqNHnD02NbyGmQvgd9SD
32
32
  XfuuGzQ3E4Mh5w==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-08-03 00:00:00.000000000 Z
34
+ date: 2014-08-09 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: polyrex-createobject
metadata.gz.sig CHANGED
Binary file