dataisland 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dataisland.rb +7 -6
- metadata +2 -2
data/lib/dataisland.rb
CHANGED
@@ -18,8 +18,10 @@ class DataIsland
|
|
18
18
|
buffer, typex = RXFHelper.read(location)
|
19
19
|
@html_doc = Rexle.new(buffer)
|
20
20
|
|
21
|
+
#exit
|
21
22
|
@html_doc.xpath('//script').map(&:delete)
|
22
23
|
@html_doc.xpath('//div[@datactl]').map(&:delete)
|
24
|
+
|
23
25
|
@html_doc.root.element('body').attributes.delete :onload
|
24
26
|
|
25
27
|
h = @html_doc.element('//object').attributes
|
@@ -51,7 +53,9 @@ class DataIsland
|
|
51
53
|
dynarex.flat_records.reverse : dynarex.flat_records
|
52
54
|
|
53
55
|
xpath = "//*[@datasrc='" + '#' + h[:id] + "']"
|
56
|
+
|
54
57
|
@html_doc.xpath(xpath).each do |island|
|
58
|
+
|
55
59
|
render(records, x.attributes, island.element('//*[@datafld]'));
|
56
60
|
end
|
57
61
|
end
|
@@ -110,13 +114,11 @@ class DataIsland
|
|
110
114
|
recs.each do |record|
|
111
115
|
|
112
116
|
rec = rec_orig.deep_clone
|
113
|
-
|
114
|
-
|
117
|
+
a = rec.xpath('.//span[@class]|.//a[@class]')
|
118
|
+
a.each do |e|
|
115
119
|
r = e.attribute(:class)[/\{([^\}]+)\}$/,1]
|
116
120
|
dest_nodes[r.to_sym] = e if r
|
117
121
|
end
|
118
|
-
puts '!bank: ' + rec.xpath('.//a[@class]').inspect
|
119
|
-
|
120
122
|
|
121
123
|
rec.xpath('.//*[@datafld]').each do |e|
|
122
124
|
dest_nodes[e.attribute(:datafld).downcase.to_sym] = e
|
@@ -169,5 +171,4 @@ class DataIsland
|
|
169
171
|
end
|
170
172
|
end
|
171
173
|
|
172
|
-
end
|
173
|
-
|
174
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dataisland
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Robertson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-06
|
13
|
+
date: 2012-08-06 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: dynarex
|