remote_table 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/remote_table/format/delimited.rb +2 -0
- data/lib/remote_table/version.rb +1 -1
- data/test/test_remote_table.rb +6 -0
- metadata +6 -6
data/.gitignore
CHANGED
@@ -51,6 +51,8 @@ class RemoteTable
|
|
51
51
|
fastercsv_options = { :skip_blanks => !t.properties.keep_blank_rows }
|
52
52
|
if t.properties.headers == false
|
53
53
|
fastercsv_options.merge!(:headers => nil)
|
54
|
+
elsif t.properties.headers.is_a?(::Array)
|
55
|
+
fastercsv_options.merge!(:headers => t.properties.headers)
|
54
56
|
else
|
55
57
|
fastercsv_options.merge!(:headers => :first_row)
|
56
58
|
end
|
data/lib/remote_table/version.rb
CHANGED
data/test/test_remote_table.rb
CHANGED
@@ -16,6 +16,12 @@ class TestRemoteTable < Test::Unit::TestCase
|
|
16
16
|
assert_equal 'Seamus Abshere', t[0]['name']
|
17
17
|
end
|
18
18
|
|
19
|
+
should "open a csv with custom headers" do
|
20
|
+
t = RemoteTable.new 'http://spreadsheets.google.com/pub?key=tObVAGyqOkCBtGid0tJUZrw', :headers => %w{ col1 col2 col3 }
|
21
|
+
assert_equal 'name', t[0]['col2']
|
22
|
+
assert_equal 'Seamus Abshere', t[1]['col2']
|
23
|
+
end
|
24
|
+
|
19
25
|
should "return an ordered hash" do
|
20
26
|
t = RemoteTable.new 'http://spreadsheets.google.com/pub?key=tObVAGyqOkCBtGid0tJUZrw'
|
21
27
|
assert_equal ::ActiveSupport::OrderedHash, t[0].class
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 17
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 1
|
10
|
+
version: 1.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Seamus Abshere
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-03-11 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -313,7 +313,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
313
313
|
requirements: []
|
314
314
|
|
315
315
|
rubyforge_project: remotetable
|
316
|
-
rubygems_version: 1.
|
316
|
+
rubygems_version: 1.6.2
|
317
317
|
signing_key:
|
318
318
|
specification_version: 3
|
319
319
|
summary: Open local or remote XLSX, XLS, ODS, CSV and fixed-width files.
|