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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b94b3e5d49b0b1a01c60c327d3cd2b900c37b65
4
- data.tar.gz: b41dc0b85bd5e5ec6dfb1ce53f37d673a25031fd
3
+ metadata.gz: 8cb6873fb1aa6ac412b49b4e7db0b9266c86b673
4
+ data.tar.gz: 6b1045516fd0854c50ed20ab52afd0860b23729b
5
5
  SHA512:
6
- metadata.gz: 9faadb32ba5493e588a7a2f48258fa13dae2f78d6ab5dc2d9bd67f1d62e79294bf291a482185e2f1db5dc2399d1807116c7c481f15f18a31fd96acc7e20ae448
7
- data.tar.gz: 3af3421f9862dc278a4c7fb914e6bd0f0a484924799edf245cd43a1a711899901403708d6e7ac184c4807bb9456995997f36011629b0605942f013215a6cafb8
6
+ metadata.gz: bc5dc60e0268e5615ced4de382226385a94e5fc161112c4359e6191825c2570ed85eea7bb5cb91cec52c0f52745a6097c9327d434c4c63324ff0a07c300bf3fe
7
+ data.tar.gz: 7f25b799f7eb6cca93357f841c2c9610e881bf010e3ed9159897048e173cf87e89392cb9063685b835f7a74b2bc6280e4f57d926a43e2dbcf8033b7b39648509
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
- puts 'after rexle'
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('.//span[@class]|.//a[@class]')
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('.//*[@datafld]').each do |e|
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('.//a[@name]').each do |e|
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('.//a[@href]').each do |e|
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('.//object[@data]').each do |e|
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('.//button[@onclick]').each do |e|
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.1.19
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
- 8ixkARkWAmV1MB4XDTE0MTAyNjIwMDMzOVoXDTE1MTAyNjIwMDMzOVowSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE2MDMxMDE5NDYzOVoXDTE3MDMxMDE5NDYzOVowSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBAJT26Q1PFWuDE73UB4kWtSywhVX64gAlKkyueC9TPh3vfZLrLsZOH6NQ9IGb
19
- bAyhZf5ssEipXjdb5zpW1hLA2+EXnP7+e2EnnR3nqnSua7EL5SQ2i5Hn1rjelQ4J
20
- ZGf5bP7gKXiHPctKdUJNpt9hU3SbGfmacn5gLhmSEKl/hxhc5WaL09/i3bCFG0eB
21
- K+6QBwjDLita3C+6PPxZmvE0g4IjrVqkIk3V14NTmrX8DEhFQMxI8O1vBAYgk9I0
22
- PlfhMZnM0tCpN0ik61K2vEyBuL2EBTpVlRkPGL01D42CwwNc430y689Vzs14Sa4U
23
- 7jASGyLD4ah+BG4FTrSTCv7qj8ECAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
- DwQEAwIEsDAdBgNVHQ4EFgQUdl92Ym4BQXiYru+4ezYtdNP4isEwJgYDVR0RBB8w
18
+ ggEBAO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XhZm14jO4sIlIxTg8VVp54YIrzSANM530JgwtO8pztlse5GOPlaiRs6bhQ
28
+ AOiUvqUIZ+UidE5xMHOjqQ4YBV9MH5JdY01poVQDiDeHmDVx0XBtsQIMneBTjLrq
29
+ sQfIK0puYR1H2JaltcWNoVyrXQY9yHd3EXvi2WM0ZZpq7Z3K7dH5YtfJ4tAdCav5
30
+ 56wcUkHpJEdgQ7exC+ce5W0M2orGsUFwr1lhqhrxvQMSTuMUIoDYNkv5rm/gNBFz
31
+ 9UloixH4rfNIsd1g2GzPEw5FnOVwVsLIlE7wyP83FSycZn2mYxfC0h4OIL3U63Kx
32
+ qUdX+Usr8XrPAw==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-04-27 00:00:00.000000000 Z
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.2'
42
+ version: '1.7'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 1.2.90
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.2'
52
+ version: '1.7'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 1.2.90
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.1'
62
+ version: '0.2'
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 0.1.12
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.1'
72
+ version: '0.2'
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.12
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.6
103
+ rubygems_version: 2.4.8
104
104
  signing_key:
105
105
  specification_version: 4
106
- summary: dataisland
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