remote_table 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,7 @@ require 'posix/spawn'
6
6
  class RemoteTable
7
7
  class Executor
8
8
  include ::Singleton
9
+ # we should really be piping things i think
9
10
  def bang(path, cmd)
10
11
  srand # in case this was forked by resque
11
12
  tmp_path = "#{path}.bang.#{rand}"
@@ -33,7 +33,7 @@ class RemoteTable
33
33
  def unescaped_html_without_soft_hyphens
34
34
  str = ::CGI.unescapeHTML utf8(::IO.read(t.local_file.path))
35
35
  # get rid of MS Office baddies
36
- str.gsub! /­/, ''
36
+ str.gsub! '­', ''
37
37
  str
38
38
  end
39
39
  end
@@ -5,7 +5,9 @@ class RemoteTable
5
5
  module Textual
6
6
  USELESS_CHARACTERS = [
7
7
  '\xef\xbb\xbf', # UTF-8 byte order mark
8
- '\xc2\xad' # soft hyphen, often inserted by MS Office (html: ­)
8
+ '\xc2\xad', # soft hyphen, often inserted by MS Office (html: ­)
9
+ '\xad',
10
+ # '\xa0'
9
11
  ]
10
12
  def remove_useless_characters!
11
13
  ::RemoteTable.executor.bang t.local_file.path, "perl -pe 's/#{USELESS_CHARACTERS.join '//g; s/'}//g'"
@@ -1,3 +1,3 @@
1
1
  class RemoteTable
2
- VERSION = "1.1.8"
2
+ VERSION = "1.1.9"
3
3
  end
@@ -61,8 +61,8 @@ class TestRemoteTable < Test::Unit::TestCase
61
61
  end
62
62
 
63
63
  # fixes ArgumentError: invalid byte sequence in UTF-8
64
- should %{safely read non-utf8 html} do
65
- t = RemoteTable.new :url => "http://www.faa.gov/air_traffic/publications/atpubs/CNT/5-2-B.htm", :encoding => 'windows-1252', :row_xpath => '//table/tr[2]/td/table/tr', :column_xpath => 'td'
66
- assert_equal 'AGUSTA', t.rows[0]['Manufacturer']
64
+ should %{safely strip soft hyphens and read non-utf8 html} do
65
+ t = RemoteTable.new :url => "http://www.faa.gov/air_traffic/publications/atpubs/CNT/5-2-A.htm", :encoding => 'windows-1252', :row_xpath => '//table/tr[2]/td/table/tr', :column_xpath => 'td'
66
+ assert t.rows.detect { |row| row['Model'] == 'A300B4600' }
67
67
  end
68
68
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_table
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 1
4
5
  prerelease:
5
- version: 1.1.8
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 9
10
+ version: 1.1.9
6
11
  platform: ruby
7
12
  authors:
8
13
  - Seamus Abshere
@@ -11,8 +16,7 @@ autorequire:
11
16
  bindir: bin
12
17
  cert_chain: []
13
18
 
14
- date: 2011-04-22 00:00:00 -05:00
15
- default_executable:
19
+ date: 2011-04-22 00:00:00 Z
16
20
  dependencies:
17
21
  - !ruby/object:Gem::Dependency
18
22
  name: activesupport
@@ -22,6 +26,11 @@ dependencies:
22
26
  requirements:
23
27
  - - ">="
24
28
  - !ruby/object:Gem::Version
29
+ hash: 11
30
+ segments:
31
+ - 2
32
+ - 3
33
+ - 4
25
34
  version: 2.3.4
26
35
  type: :runtime
27
36
  version_requirements: *id001
@@ -33,6 +42,10 @@ dependencies:
33
42
  requirements:
34
43
  - - ~>
35
44
  - !ruby/object:Gem::Version
45
+ hash: 29
46
+ segments:
47
+ - 1
48
+ - 9
36
49
  version: "1.9"
37
50
  type: :runtime
38
51
  version_requirements: *id002
@@ -44,6 +57,11 @@ dependencies:
44
57
  requirements:
45
58
  - - ">="
46
59
  - !ruby/object:Gem::Version
60
+ hash: 411
61
+ segments:
62
+ - 0
63
+ - 99
64
+ - 4
47
65
  version: 0.99.4
48
66
  type: :runtime
49
67
  version_requirements: *id003
@@ -55,6 +73,9 @@ dependencies:
55
73
  requirements:
56
74
  - - ">="
57
75
  - !ruby/object:Gem::Version
76
+ hash: 3
77
+ segments:
78
+ - 0
58
79
  version: "0"
59
80
  type: :runtime
60
81
  version_requirements: *id004
@@ -66,6 +87,9 @@ dependencies:
66
87
  requirements:
67
88
  - - ">="
68
89
  - !ruby/object:Gem::Version
90
+ hash: 3
91
+ segments:
92
+ - 0
69
93
  version: "0"
70
94
  type: :runtime
71
95
  version_requirements: *id005
@@ -77,6 +101,9 @@ dependencies:
77
101
  requirements:
78
102
  - - ">="
79
103
  - !ruby/object:Gem::Version
104
+ hash: 3
105
+ segments:
106
+ - 0
80
107
  version: "0"
81
108
  type: :runtime
82
109
  version_requirements: *id006
@@ -88,6 +115,11 @@ dependencies:
88
115
  requirements:
89
116
  - - ">="
90
117
  - !ruby/object:Gem::Version
118
+ hash: 5
119
+ segments:
120
+ - 1
121
+ - 4
122
+ - 1
91
123
  version: 1.4.1
92
124
  type: :runtime
93
125
  version_requirements: *id007
@@ -99,6 +131,9 @@ dependencies:
99
131
  requirements:
100
132
  - - ">="
101
133
  - !ruby/object:Gem::Version
134
+ hash: 3
135
+ segments:
136
+ - 0
102
137
  version: "0"
103
138
  type: :runtime
104
139
  version_requirements: *id008
@@ -110,6 +145,9 @@ dependencies:
110
145
  requirements:
111
146
  - - ">="
112
147
  - !ruby/object:Gem::Version
148
+ hash: 3
149
+ segments:
150
+ - 0
113
151
  version: "0"
114
152
  type: :runtime
115
153
  version_requirements: *id009
@@ -121,6 +159,11 @@ dependencies:
121
159
  requirements:
122
160
  - - ">="
123
161
  - !ruby/object:Gem::Version
162
+ hash: 23
163
+ segments:
164
+ - 0
165
+ - 0
166
+ - 4
124
167
  version: 0.0.4
125
168
  type: :runtime
126
169
  version_requirements: *id010
@@ -132,6 +175,9 @@ dependencies:
132
175
  requirements:
133
176
  - - ">="
134
177
  - !ruby/object:Gem::Version
178
+ hash: 3
179
+ segments:
180
+ - 0
135
181
  version: "0"
136
182
  type: :runtime
137
183
  version_requirements: *id011
@@ -143,53 +189,86 @@ dependencies:
143
189
  requirements:
144
190
  - - ">="
145
191
  - !ruby/object:Gem::Version
192
+ hash: 3
193
+ segments:
194
+ - 0
146
195
  version: "0"
147
196
  type: :runtime
148
197
  version_requirements: *id012
149
198
  - !ruby/object:Gem::Dependency
150
- name: errata
199
+ name: fastercsv
151
200
  prerelease: false
152
201
  requirement: &id013 !ruby/object:Gem::Requirement
153
202
  none: false
154
203
  requirements:
155
204
  - - ">="
156
205
  - !ruby/object:Gem::Version
157
- version: 0.2.0
158
- type: :development
206
+ hash: 3
207
+ segments:
208
+ - 1
209
+ - 5
210
+ - 0
211
+ version: 1.5.0
212
+ type: :runtime
159
213
  version_requirements: *id013
160
214
  - !ruby/object:Gem::Dependency
161
- name: test-unit
215
+ name: errata
162
216
  prerelease: false
163
217
  requirement: &id014 !ruby/object:Gem::Requirement
164
218
  none: false
165
219
  requirements:
166
220
  - - ">="
167
221
  - !ruby/object:Gem::Version
168
- version: "0"
222
+ hash: 23
223
+ segments:
224
+ - 0
225
+ - 2
226
+ - 0
227
+ version: 0.2.0
169
228
  type: :development
170
229
  version_requirements: *id014
171
230
  - !ruby/object:Gem::Dependency
172
- name: shoulda
231
+ name: test-unit
173
232
  prerelease: false
174
233
  requirement: &id015 !ruby/object:Gem::Requirement
175
234
  none: false
176
235
  requirements:
177
236
  - - ">="
178
237
  - !ruby/object:Gem::Version
238
+ hash: 3
239
+ segments:
240
+ - 0
179
241
  version: "0"
180
242
  type: :development
181
243
  version_requirements: *id015
182
244
  - !ruby/object:Gem::Dependency
183
- name: ruby-debug19
245
+ name: shoulda
184
246
  prerelease: false
185
247
  requirement: &id016 !ruby/object:Gem::Requirement
186
248
  none: false
187
249
  requirements:
188
250
  - - ">="
189
251
  - !ruby/object:Gem::Version
252
+ hash: 3
253
+ segments:
254
+ - 0
190
255
  version: "0"
191
256
  type: :development
192
257
  version_requirements: *id016
258
+ - !ruby/object:Gem::Dependency
259
+ name: ruby-debug
260
+ prerelease: false
261
+ requirement: &id017 !ruby/object:Gem::Requirement
262
+ none: false
263
+ requirements:
264
+ - - ">="
265
+ - !ruby/object:Gem::Version
266
+ hash: 3
267
+ segments:
268
+ - 0
269
+ version: "0"
270
+ type: :development
271
+ version_requirements: *id017
193
272
  description: Gives you a standard way to parse various formats and treat them as an array of hashes.
194
273
  email:
195
274
  - seamus@abshere.net
@@ -229,7 +308,6 @@ files:
229
308
  - test/test_old_syntax.rb
230
309
  - test/test_old_transform.rb
231
310
  - test/test_remote_table.rb
232
- has_rdoc: true
233
311
  homepage: https://github.com/seamusabshere/remote_table
234
312
  licenses: []
235
313
 
@@ -243,17 +321,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
243
321
  requirements:
244
322
  - - ">="
245
323
  - !ruby/object:Gem::Version
324
+ hash: 3
325
+ segments:
326
+ - 0
246
327
  version: "0"
247
328
  required_rubygems_version: !ruby/object:Gem::Requirement
248
329
  none: false
249
330
  requirements:
250
331
  - - ">="
251
332
  - !ruby/object:Gem::Version
333
+ hash: 3
334
+ segments:
335
+ - 0
252
336
  version: "0"
253
337
  requirements: []
254
338
 
255
339
  rubyforge_project: remotetable
256
- rubygems_version: 1.6.2
340
+ rubygems_version: 1.7.2
257
341
  signing_key:
258
342
  specification_version: 3
259
343
  summary: Open local or remote XLSX, XLS, ODS, CSV and fixed-width files.