pxrowx 0.1.1 → 0.2.0

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: 4d4ce737cf7f36962db5d906effaf1a1da84051d
4
- data.tar.gz: 2d0284b750bb1dd1f322c80e9c7477c428353c2a
3
+ metadata.gz: 4239ee29c445f6f987078194977e1e11d49554dc
4
+ data.tar.gz: 61b95f650aa24878024cbf882055d9d851406b64
5
5
  SHA512:
6
- metadata.gz: 9f88830bce734b9851a3900c3b0d40cfae209287e510c1679135adb2d31ace498ce82dc6597b48b8572743f4ac4a98ce968f282b2081ab6647cddce98e41e4f7
7
- data.tar.gz: 0e4b3deed5053b68d5fd7db934e0e9a6fd2f5a6c8c71099a4918855c594373fe43015f2cdea145d36fa35bf79e63c6b0fec0240cd8c3148d02759d21ab608211
6
+ metadata.gz: db34db8278ceca3f2e3269ab3323ba061fd013c1048feb4c8e0982a4b0512970a54a9ed4f1703395e114cb0de86ab189ff00b4dd9226d981a4e2eef16e5e066f
7
+ data.tar.gz: 11c537f9565c75068f6afccbae77d5a798742500b853bca76445322dadb5f0a67253e4e0855188337b8afb3344c35bea2d0ad0cd24cff6fae32bc23291cb8607
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/pxrowx.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  # file: pxrowx.rb
4
4
 
5
5
  require 'line-tree'
6
+ require 'rexle-builder'
6
7
 
7
8
 
8
9
  class PxRowX
@@ -29,6 +30,17 @@ class PxRowX
29
30
  rows = make_rows r
30
31
 
31
32
  ['items', {}, nil].reverse.each {|x| rows.unshift x}
33
+
34
+ h = {
35
+ title: '',
36
+ recordx_type: 'polyrex',
37
+ schema: "items[title]/item[#{labels.join(', ')}]"
38
+ }
39
+
40
+ summary = RexleBuilder.new(h).to_a
41
+ summary[0] = 'summary'
42
+ rows.insert 3, summary
43
+
32
44
  @doc = Rexle.new(rows)
33
45
 
34
46
  end
@@ -71,8 +83,8 @@ class PxRowX
71
83
 
72
84
  def make_rows(a)
73
85
 
74
- a.inject([]) do |r, x|
75
-
86
+ a.inject([]) do |r, x|
87
+
76
88
  if x.is_a? String then
77
89
 
78
90
  r = ['item',{},nil, ['summary',{}, nil ]] if r.empty?
@@ -81,15 +93,13 @@ class PxRowX
81
93
 
82
94
  elsif x.is_a? Array
83
95
 
84
- if x.length > 1 then
85
- r << make_rows(x)
86
- else
87
- r << ['records', {}, nil, make_rows(x.first)]
88
- end
96
+ raw_rows = x.length > 1 ? x : x.first
97
+ r << ['records', {}, nil, make_rows(raw_rows)]
89
98
 
90
99
  end
91
100
 
92
101
  r
93
102
  end
94
103
  end
95
- end
104
+ end
105
+
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pxrowx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  pkBwAqlR25JVgr8VTfX/ib2qW3boooPPz10VstLGg/f0QvT7Krw4FUMi5GlKkXD/
32
32
  BdQSzvwx2Iy5kw==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-11-21 00:00:00.000000000 Z
34
+ date: 2016-12-03 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: line-tree
@@ -53,6 +53,26 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 0.5.6
56
+ - !ruby/object:Gem::Dependency
57
+ name: rexle-builder
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.3'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 0.3.0
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '0.3'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.0
56
76
  description:
57
77
  email: james@r0bertson.co.uk
58
78
  executables: []
metadata.gz.sig CHANGED
Binary file