dataisland 0.1.19 → 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.tar.gz.sig +0 -0
- data/lib/dataisland.rb +13 -13
- metadata +28 -27
- 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: 8cb6873fb1aa6ac412b49b4e7db0b9266c86b673
|
4
|
+
data.tar.gz: 6b1045516fd0854c50ed20ab52afd0860b23729b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc5dc60e0268e5615ced4de382226385a94e5fc161112c4359e6191825c2570ed85eea7bb5cb91cec52c0f52745a6097c9327d434c4c63324ff0a07c300bf3fe
|
7
|
+
data.tar.gz: 7f25b799f7eb6cca93357f841c2c9610e881bf010e3ed9159897048e173cf87e89392cb9063685b835f7a74b2bc6280e4f57d926a43e2dbcf8033b7b39648509
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dataisland.rb
CHANGED
@@ -14,11 +14,9 @@ class DataIsland
|
|
14
14
|
#
|
15
15
|
def initialize(location, opts={})
|
16
16
|
|
17
|
-
puts 'location : ' + location.inspect
|
18
17
|
buffer, typex = RXFHelper.read(location)
|
19
|
-
puts 'buffer : ' + buffer.inspect
|
20
18
|
@html_doc = Rexle.new(buffer.sub(/^<!DOCTYPE html>/,''))
|
21
|
-
|
19
|
+
|
22
20
|
a = @html_doc.css('//script[@class="dataisland"]')
|
23
21
|
a.map(&:delete)
|
24
22
|
|
@@ -85,12 +83,13 @@ class DataIsland
|
|
85
83
|
end
|
86
84
|
|
87
85
|
def add_to_destnodes(dn, raw_key, node)
|
86
|
+
|
88
87
|
key = raw_key.to_sym
|
89
88
|
dn.has_key?(key) ? dn[key] << node : dn[key] = [node]
|
90
89
|
end
|
91
90
|
|
92
91
|
def render(flat_records, h, node)
|
93
|
-
|
92
|
+
|
94
93
|
sort_by = h[:sort_by]
|
95
94
|
range = h[:range]
|
96
95
|
|
@@ -118,42 +117,43 @@ class DataIsland
|
|
118
117
|
else
|
119
118
|
recs = records
|
120
119
|
end
|
121
|
-
|
122
|
-
recs.each do |record|
|
123
120
|
|
121
|
+
recs.each do |record|
|
122
|
+
|
124
123
|
rec = rec_orig.deep_clone
|
125
124
|
|
126
125
|
# get a reference to each element containing the datafld attribute
|
127
126
|
dest_nodes = {}
|
128
|
-
|
129
|
-
a = rec.xpath('
|
127
|
+
|
128
|
+
a = rec.xpath('*//span[@class]|*//a[@class]')
|
130
129
|
|
131
130
|
a.each do |e|
|
131
|
+
|
132
132
|
r = e.attribute(:class)[0][/\{([^\}]+)\}$/,1]
|
133
133
|
add_to_destnodes(dest_nodes,r,e) if r
|
134
134
|
end
|
135
135
|
|
136
|
-
rec.xpath('
|
136
|
+
rec.xpath('*//*[@datafld]').each do |e|
|
137
137
|
add_to_destnodes(dest_nodes,e.attribute(:datafld).downcase,e)
|
138
138
|
end
|
139
139
|
|
140
|
-
rec.xpath('
|
140
|
+
rec.xpath('*//a[@name]').each do |e|
|
141
141
|
r = e.attribute(:name)[/\{([^\}]+)\}/,1]
|
142
142
|
add_to_destnodes(dest_nodes,r,e) if r
|
143
143
|
end
|
144
144
|
|
145
|
-
rec.xpath('
|
145
|
+
rec.xpath('*//a[@href]').each do |e|
|
146
146
|
r = e.attribute(:href)[/\{([^\}]+)\}/,1]
|
147
147
|
add_to_destnodes(dest_nodes,r,e) if r
|
148
148
|
end
|
149
149
|
|
150
|
-
rec.xpath('
|
150
|
+
rec.xpath('*//object[@data]').each do |e|
|
151
151
|
|
152
152
|
r = e.attribute(:data)[/\{([^\}]+)\}$/,1]
|
153
153
|
add_to_destnodes(dest_nodes,r,e) if r
|
154
154
|
end
|
155
155
|
|
156
|
-
rec.xpath('
|
156
|
+
rec.xpath('*//button[@onclick]').each do |e|
|
157
157
|
|
158
158
|
r = e.attribute(:onclick)[/\{([^\}]+)\}$/,1]
|
159
159
|
add_to_destnodes(dest_nodes,r,e) if r
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
|
14
14
|
YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
|
15
|
-
|
15
|
+
8ixkARkWAmV1MB4XDTE2MDMxMDE5NDYzOVoXDTE3MDMxMDE5NDYzOVowSDESMBAG
|
16
16
|
A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
|
17
17
|
EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
ggEBAOYX6DpWPQ5D1S5iF3bu6qbu8tfObd3Fe3dBxCJglXygpE8/wdgz7aM2Fawj
|
19
|
+
pLV8FKHgjwVLAumZR/Lw/eni3cHLhVyIHhnYu7Oaz7FtGAJP/2RDCn+mAPskfJwn
|
20
|
+
O+Vf30XNAm19aEmHed0D6vI6ge7Fjx5YW453iQirU4FPj9pw3Z5WKerJY9VZRXXJ
|
21
|
+
zdchLluiVGiqJ8d+uTdcrVJ+IKZZQjlzYx5SIZbJMCx8qvoV/stxACT0qaHz25Dz
|
22
|
+
phL0WjFranO+3R0rs4r4h0hzvq+be3A5qbigFtmbk0qTTfkhDu68Yz0I4ZBz4NSj
|
23
|
+
8Pkf+fsij8xygJ5Kecb0QjrzXCUCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
|
24
|
+
DwQEAwIEsDAdBgNVHQ4EFgQU9iWqsWYfoeixaTCvXJ4RF9nrT/wwJgYDVR0RBB8w
|
25
25
|
HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAvMHKUG9t
|
27
|
+
2JamMsXhZm14jO4sIlIxTg8VVp54YIrzSANM530JgwtO8pztlse5GOPlaiRs6bhQ
|
28
|
+
AOiUvqUIZ+UidE5xMHOjqQ4YBV9MH5JdY01poVQDiDeHmDVx0XBtsQIMneBTjLrq
|
29
|
+
sQfIK0puYR1H2JaltcWNoVyrXQY9yHd3EXvi2WM0ZZpq7Z3K7dH5YtfJ4tAdCav5
|
30
|
+
56wcUkHpJEdgQ7exC+ce5W0M2orGsUFwr1lhqhrxvQMSTuMUIoDYNkv5rm/gNBFz
|
31
|
+
9UloixH4rfNIsd1g2GzPEw5FnOVwVsLIlE7wyP83FSycZn2mYxfC0h4OIL3U63Kx
|
32
|
+
qUdX+Usr8XrPAw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex
|
@@ -39,40 +39,40 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '1.
|
42
|
+
version: '1.7'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
45
|
+
version: 1.7.0
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '1.
|
52
|
+
version: '1.7'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.
|
55
|
+
version: 1.7.0
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rxfhelper
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '0.
|
62
|
+
version: '0.2'
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.
|
65
|
+
version: 0.2.3
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
70
|
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: '0.
|
72
|
+
version: '0.2'
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.2.3
|
76
76
|
description:
|
77
77
|
email: james@r0bertson.co.uk
|
78
78
|
executables: []
|
@@ -100,8 +100,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.4.
|
103
|
+
rubygems_version: 2.4.8
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
|
-
summary:
|
106
|
+
summary: Transforms an HTML page containing XML data islands (a Microsoft Internet
|
107
|
+
Explorer 5.0 like feature) to HTML.
|
107
108
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|