polyrex-builder 0.1.2 → 0.2.0
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-builder.rb +13 -3
- data.tar.gz.sig +0 -0
- metadata +21 -1
- 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: 802d5cb54d1b08458b9f11a29a3c5031575ea7e5
|
4
|
+
data.tar.gz: 2bf43165b26f298693856bf10e08c0a3a2db658d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f66aa2454bbf07c5bffa75bd4810e4bde80fad5d82de99681634b6025eafde8fe0bdba9366421123cb28d8adebd8e74a074d4aff25825b429be64424f56b668c
|
7
|
+
data.tar.gz: 39c71a48bd46971fdb6701822cf0eb07a917ed0295da8499f69be1fed600fabde9dade21b9a97c80c8f7fb417114b3e42a70299e2d4eb90b57c54a33863b2b1e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/polyrex-builder.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
require 'rexle'
|
7
7
|
require 'rexle-builder'
|
8
|
+
require 'polyrex-schema'
|
8
9
|
|
9
10
|
|
10
11
|
class PolyrexBuilder
|
@@ -25,7 +26,12 @@ class PolyrexBuilder
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def to_xml()
|
28
|
-
|
29
|
+
|
30
|
+
doc = Rexle.new(@a)
|
31
|
+
schema = PolyrexSchema.new.parse(doc.root.xml).to_schema
|
32
|
+
doc.root.element('summary').add Rexle::Element.new('schema').add_text(schema)
|
33
|
+
|
34
|
+
doc.xml pretty: true
|
29
35
|
end
|
30
36
|
|
31
37
|
private
|
@@ -37,16 +43,20 @@ class PolyrexBuilder
|
|
37
43
|
raw_records = a
|
38
44
|
raw_summary = raw_records.first
|
39
45
|
|
46
|
+
h = raw_records.first
|
47
|
+
summary = h.merge({schema: "%s[%s]" % [name, h.keys.join(', ')]})
|
48
|
+
|
40
49
|
record = if raw_records[1] then
|
50
|
+
|
41
51
|
|
42
52
|
{
|
43
|
-
summary:
|
53
|
+
summary: summary,
|
44
54
|
records: raw_records[1].map{|x| pxify(x,parents.clone) }
|
45
55
|
}
|
46
56
|
|
47
57
|
else
|
48
58
|
|
49
|
-
{summary:
|
59
|
+
{summary: summary}
|
50
60
|
|
51
61
|
end
|
52
62
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyrex-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -73,6 +73,26 @@ dependencies:
|
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.3.7
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: polyrex-schema
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.4'
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 0.4.2
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - "~>"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0.4'
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.4.2
|
76
96
|
description:
|
77
97
|
email: james@jamesrobertson.eu
|
78
98
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|