dataisland 0.1.14 → 0.1.15
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/dataisland.rb +21 -15
- data.tar.gz.sig +0 -0
- metadata +37 -23
- 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: b79220d2f2e1ed4e7f298f08aa2a7a06a55ead82
|
4
|
+
data.tar.gz: 406f92a674143df5b2a8efc3b9c9d00b8dfefc3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fdbf4ea5bb1a5c520a7b21b3421deca002938c762faefb3899b028539e97d3f670cfb4df408697b6572f6a0bb4e07db95208f0b438df617b02650eaeeefa1e9
|
7
|
+
data.tar.gz: 09f9bfe539823e7e014652ecfb450d76fcde49977b08b3ec4783c7ab2eef1ad64de50d4affcd07488e5ec83a912ad327f39a3dcbf2e742181b29d84901d58acf
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dataisland.rb
CHANGED
@@ -16,7 +16,10 @@ class DataIsland
|
|
16
16
|
|
17
17
|
buffer, typex = RXFHelper.read(location)
|
18
18
|
@html_doc = Rexle.new(buffer.sub(/^<!DOCTYPE html>/,''))
|
19
|
-
|
19
|
+
|
20
|
+
a = @html_doc.css('//script[@class="dataisland"]')
|
21
|
+
a.map(&:delete)
|
22
|
+
|
20
23
|
@html_doc.xpath('//div[@datactl]').map(&:delete)
|
21
24
|
|
22
25
|
@html_doc.root.element('body').attributes.delete :onload
|
@@ -44,7 +47,7 @@ class DataIsland
|
|
44
47
|
@location +'/' + h[:data]
|
45
48
|
end
|
46
49
|
|
47
|
-
dynarex = Dynarex.new location2
|
50
|
+
dynarex = Dynarex.new location2
|
48
51
|
|
49
52
|
if (h[:order] and h[:order][/^desc|descending$/]) \
|
50
53
|
or dynarex.order = 'descending' then
|
@@ -54,12 +57,14 @@ class DataIsland
|
|
54
57
|
end
|
55
58
|
|
56
59
|
xpath = "//*[@datasrc='" + '#' + h[:id] + "']"
|
57
|
-
|
60
|
+
|
58
61
|
@html_doc.xpath(xpath).each do |island|
|
59
62
|
render(records, x.attributes, island.element('//*[@datafld]'));
|
60
63
|
end
|
64
|
+
|
61
65
|
x.delete unless h[:data] =~ /^\{/
|
62
66
|
end
|
67
|
+
|
63
68
|
end
|
64
69
|
|
65
70
|
private
|
@@ -68,7 +73,7 @@ class DataIsland
|
|
68
73
|
|
69
74
|
parent = element.parent
|
70
75
|
parentName = parent.name.downcase
|
71
|
-
|
76
|
+
|
72
77
|
case parentName
|
73
78
|
when 'body'
|
74
79
|
return nil
|
@@ -92,7 +97,6 @@ class DataIsland
|
|
92
97
|
rec_orig = node_to_clone(node)
|
93
98
|
|
94
99
|
if rec_orig then
|
95
|
-
|
96
100
|
|
97
101
|
if (h[:rows_per_page]) then
|
98
102
|
|
@@ -114,7 +118,7 @@ class DataIsland
|
|
114
118
|
else
|
115
119
|
recs = records
|
116
120
|
end
|
117
|
-
|
121
|
+
|
118
122
|
recs.each do |record|
|
119
123
|
|
120
124
|
rec = rec_orig.deep_clone
|
@@ -123,8 +127,9 @@ class DataIsland
|
|
123
127
|
dest_nodes = {}
|
124
128
|
|
125
129
|
a = rec.xpath('.//span[@class]|.//a[@class]')
|
130
|
+
|
126
131
|
a.each do |e|
|
127
|
-
r = e.attribute(:class)[/\{([^\}]+)\}$/,1]
|
132
|
+
r = e.attribute(:class)[0][/\{([^\}]+)\}$/,1]
|
128
133
|
add_to_destnodes(dest_nodes,r,e) if r
|
129
134
|
end
|
130
135
|
|
@@ -161,12 +166,12 @@ class DataIsland
|
|
161
166
|
|
162
167
|
classx = e2.attributes[:class]
|
163
168
|
|
164
|
-
if classx then
|
169
|
+
if classx and classx.length > 0 then
|
165
170
|
|
166
|
-
if classx[/{#{field}/] then
|
171
|
+
if classx[0][/{#{field}/] then
|
167
172
|
val = record[field]
|
168
|
-
new_class = classx.sub(/\{[^\}]+\}/,val)
|
169
|
-
e2.attributes[:class] = new_class
|
173
|
+
new_class = classx[0].sub(/\{[^\}]+\}/,val)
|
174
|
+
e2.attributes[:class] = [new_class]
|
170
175
|
elsif
|
171
176
|
e2.text = record[field]
|
172
177
|
end
|
@@ -192,11 +197,11 @@ class DataIsland
|
|
192
197
|
|
193
198
|
classx = e2.attributes[:class]
|
194
199
|
|
195
|
-
if classx and classx[/{#{field}/] then
|
200
|
+
if classx and classx[0][/{#{field}/] then
|
196
201
|
|
197
202
|
val = record[field]
|
198
|
-
new_class = classx.sub(/\{[^\}]+\}/,val)
|
199
|
-
e2.attributes[:class] = new_class
|
203
|
+
new_class = classx[0].sub(/\{[^\}]+\}/,val)
|
204
|
+
e2.attributes[:class] = [new_class]
|
200
205
|
|
201
206
|
elsif e2.attributes[:name] then
|
202
207
|
|
@@ -208,6 +213,7 @@ class DataIsland
|
|
208
213
|
elsif e2.attributes[:href] then
|
209
214
|
|
210
215
|
href = e2.attributes[:href]
|
216
|
+
|
211
217
|
val = record[field]
|
212
218
|
new_href = href.sub(/\{[^\}]+\}/,val)
|
213
219
|
e2.attributes[:href] = new_href
|
@@ -233,4 +239,4 @@ class DataIsland
|
|
233
239
|
end
|
234
240
|
end
|
235
241
|
|
236
|
-
end
|
242
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dataisland
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,55 +10,69 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDljCCAn6gAwIBAg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3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAjYjzqR2Q
|
27
|
+
Ye8tLT8e2owwEyNvCQtd/T6Cs/3HrPdUMllEepnw1T/zFYb3WzLvkejuFGfVpEAK
|
28
|
+
ad3NY0L8kHyc0U3+GtJTxiEQAWgdvw58UVS8SGbErccA5qwN9YDjWCOvigZBp3X9
|
29
|
+
VPmkPlc6HEAy1LfwdlGOTjbnh/5w6VCOrewqbBn8AZRbu3Bdm0Y2UUmnhmTKJPRZ
|
30
|
+
hHAfaOtCOVvDm1xVsvJ2SAAp/PsqRVZOTfXEZygGuIANnD3zQlBdFiJFByEbdDal
|
31
|
+
hfU2aUsh32EdO0lz//CAq6vJ6SOTB7aLPUBCTqjepgkYPqhbA4xLDdvXr4sd5ObL
|
32
|
+
ZuH02/86EylsSA==
|
31
33
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
34
|
+
date: 2014-10-26 00:00:00.000000000 Z
|
33
35
|
dependencies:
|
34
36
|
- !ruby/object:Gem::Dependency
|
35
37
|
name: dynarex
|
36
38
|
requirement: !ruby/object:Gem::Requirement
|
37
39
|
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '1.2'
|
38
43
|
- - ">="
|
39
44
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
45
|
+
version: 1.2.90
|
41
46
|
type: :runtime
|
42
47
|
prerelease: false
|
43
48
|
version_requirements: !ruby/object:Gem::Requirement
|
44
49
|
requirements:
|
50
|
+
- - "~>"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '1.2'
|
45
53
|
- - ">="
|
46
54
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
55
|
+
version: 1.2.90
|
48
56
|
- !ruby/object:Gem::Dependency
|
49
57
|
name: rxfhelper
|
50
58
|
requirement: !ruby/object:Gem::Requirement
|
51
59
|
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0.1'
|
52
63
|
- - ">="
|
53
64
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
65
|
+
version: 0.1.12
|
55
66
|
type: :runtime
|
56
67
|
prerelease: false
|
57
68
|
version_requirements: !ruby/object:Gem::Requirement
|
58
69
|
requirements:
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0.1'
|
59
73
|
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 0.1.12
|
62
76
|
description:
|
63
77
|
email: james@r0bertson.co.uk
|
64
78
|
executables: []
|
@@ -78,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
92
|
requirements:
|
79
93
|
- - ">="
|
80
94
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
95
|
+
version: 2.1.2
|
82
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
97
|
requirements:
|
84
98
|
- - ">="
|
@@ -86,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
100
|
version: '0'
|
87
101
|
requirements: []
|
88
102
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.
|
103
|
+
rubygems_version: 2.2.2
|
90
104
|
signing_key:
|
91
105
|
specification_version: 4
|
92
106
|
summary: dataisland
|
metadata.gz.sig
CHANGED
Binary file
|