tabular 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/tabular/table.rb +2 -2
- data/tabular.gemspec +2 -1
- data/test/fixtures/quoted.txt +3 -0
- data/test/table_test.rb +5 -1
- metadata +6 -2
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.6
|
data/lib/tabular/table.rb
CHANGED
|
@@ -38,9 +38,9 @@ module Tabular
|
|
|
38
38
|
when :txt
|
|
39
39
|
require "csv"
|
|
40
40
|
if RUBY_VERSION < "1.9"
|
|
41
|
-
::CSV.open(file_path, "r","\t").collect { |row| row }
|
|
41
|
+
::CSV.open(file_path, "r", "\t").collect { |row| row }
|
|
42
42
|
else
|
|
43
|
-
CSV.read(file_path)
|
|
43
|
+
CSV.read(file_path, :col_sep => "\t")
|
|
44
44
|
end
|
|
45
45
|
when :csv
|
|
46
46
|
if RUBY_VERSION < "1.9"
|
data/tabular.gemspec
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{tabular}
|
|
8
|
-
s.version = "0.0.
|
|
8
|
+
s.version = "0.0.6"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Scott Willson"]
|
|
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
|
|
|
33
33
|
"test/columns_test.rb",
|
|
34
34
|
"test/fixtures/blank.txt",
|
|
35
35
|
"test/fixtures/excel.xls",
|
|
36
|
+
"test/fixtures/quoted.txt",
|
|
36
37
|
"test/fixtures/sample.csv",
|
|
37
38
|
"test/fixtures/sample.lif",
|
|
38
39
|
"test/helper.rb",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Date Race CityState Discipline Promoter PromoterPhone PromoterEmail SponsoringTeam SanctionedBy Website FlyerApproved
|
|
2
|
+
1/1/99 Butte Hillclimb Butte
|
|
3
|
+
2/12/99 Valentine Criterium "Missoula, MT" Criterium Al Pendergrass (414) 333-1100 al@gmail.com 1200000 USA Cycling http://geocities.com/bikes 1
|
data/test/table_test.rb
CHANGED
|
@@ -3,7 +3,11 @@ require "helper"
|
|
|
3
3
|
module Tabular
|
|
4
4
|
class TableTest < Test::Unit::TestCase
|
|
5
5
|
def test_read_from_blank_txt_file
|
|
6
|
-
|
|
6
|
+
Table.read(File.expand_path(File.dirname(__FILE__) + "/fixtures/blank.txt"))
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def test_read_quoted_txt_file
|
|
10
|
+
Table.read(File.expand_path(File.dirname(__FILE__) + "/fixtures/quoted.txt"))
|
|
7
11
|
end
|
|
8
12
|
|
|
9
13
|
# "Place ","Number","Last Name","First Name","Team","Category Raced"
|
metadata
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tabular
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 19
|
|
4
5
|
prerelease: false
|
|
5
6
|
segments:
|
|
6
7
|
- 0
|
|
7
8
|
- 0
|
|
8
|
-
-
|
|
9
|
-
version: 0.0.
|
|
9
|
+
- 6
|
|
10
|
+
version: 0.0.6
|
|
10
11
|
platform: ruby
|
|
11
12
|
authors:
|
|
12
13
|
- Scott Willson
|
|
@@ -44,6 +45,7 @@ files:
|
|
|
44
45
|
- test/columns_test.rb
|
|
45
46
|
- test/fixtures/blank.txt
|
|
46
47
|
- test/fixtures/excel.xls
|
|
48
|
+
- test/fixtures/quoted.txt
|
|
47
49
|
- test/fixtures/sample.csv
|
|
48
50
|
- test/fixtures/sample.lif
|
|
49
51
|
- test/helper.rb
|
|
@@ -63,6 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
63
65
|
requirements:
|
|
64
66
|
- - ">="
|
|
65
67
|
- !ruby/object:Gem::Version
|
|
68
|
+
hash: 3
|
|
66
69
|
segments:
|
|
67
70
|
- 0
|
|
68
71
|
version: "0"
|
|
@@ -71,6 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
71
74
|
requirements:
|
|
72
75
|
- - ">="
|
|
73
76
|
- !ruby/object:Gem::Version
|
|
77
|
+
hash: 3
|
|
74
78
|
segments:
|
|
75
79
|
- 0
|
|
76
80
|
version: "0"
|