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 CHANGED
@@ -4,3 +4,4 @@ coverage
4
4
  rdoc
5
5
  pkg
6
6
  Gemfile.lock
7
+ *.gem
@@ -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
@@ -1,3 +1,3 @@
1
1
  class RemoteTable
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -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: 19
5
- prerelease: false
4
+ hash: 17
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
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-01-26 00:00:00 -06:00
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.3.7
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.