simple-spreadsheet 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -0
- data/lib/simple-spreadsheet/modules/roo_module.rb +8 -0
- data/lib/simple-spreadsheet/readers/spreadsheet_reader.rb +8 -0
- data/lib/simple-spreadsheet/version.rb +1 -1
- data/simple-spreadsheet.gemspec +1 -0
- data/spec/simple-spreadsheet_csv_spec.rb +6 -0
- data/spec/simple-spreadsheet_csvt_spec.rb +6 -0
- data/spec/simple-spreadsheet_csvx_spec.rb +6 -0
- data/spec/simple-spreadsheet_ods_spec.rb +6 -0
- data/spec/simple-spreadsheet_xls_spec.rb +6 -0
- data/spec/simple-spreadsheet_xlsx_spec.rb +6 -0
- metadata +50 -14
data/Gemfile.lock
CHANGED
@@ -31,6 +31,7 @@ GEM
|
|
31
31
|
multi_json (~> 1.0)
|
32
32
|
rack (~> 1.4)
|
33
33
|
rack (1.4.1)
|
34
|
+
rake (0.9.2.2)
|
34
35
|
roo (1.10.1)
|
35
36
|
choice (>= 0.1.4)
|
36
37
|
google-spreadsheet-ruby (>= 0.1.5)
|
@@ -58,5 +59,6 @@ PLATFORMS
|
|
58
59
|
ruby
|
59
60
|
|
60
61
|
DEPENDENCIES
|
62
|
+
rake (~> 0.9.2.2)
|
61
63
|
rspec (~> 2.6.0)
|
62
64
|
simple-spreadsheet!
|
@@ -20,6 +20,14 @@ module RooModule
|
|
20
20
|
@engine.last_row
|
21
21
|
end
|
22
22
|
|
23
|
+
def first_column
|
24
|
+
@engine.first_column
|
25
|
+
end
|
26
|
+
|
27
|
+
def last_column
|
28
|
+
@engine.last_column
|
29
|
+
end
|
30
|
+
|
23
31
|
def cell(row, col, sheet=nil)
|
24
32
|
if sheet.is_a? Integer
|
25
33
|
@engine.cell(row, col, @engine.sheets[sheet - 1])
|
@@ -16,6 +16,14 @@ class SpreadsheetReader < GenericSheet
|
|
16
16
|
# return last row index
|
17
17
|
end
|
18
18
|
|
19
|
+
def first_column
|
20
|
+
# return first column index
|
21
|
+
end
|
22
|
+
|
23
|
+
def last_column
|
24
|
+
# return last column index
|
25
|
+
end
|
26
|
+
|
19
27
|
def cell(row, col, sheet=nil)
|
20
28
|
# return cell content
|
21
29
|
end
|
data/simple-spreadsheet.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
|
18
18
|
# specify any dependencies here; for example:
|
19
19
|
gem.add_development_dependency "rspec", "~> 2.6.0"
|
20
|
+
gem.add_development_dependency "rake", "~> 0.9.2.2"
|
20
21
|
gem.add_runtime_dependency "roo", "1.10.1"
|
21
22
|
gem.add_runtime_dependency "spreadsheet", "0.6.5.9"
|
22
23
|
gem.add_runtime_dependency "rubyXL", "1.2.5"
|
@@ -22,6 +22,12 @@ describe SimpleSpreadsheet do
|
|
22
22
|
it "should read integer from first sheets" do
|
23
23
|
@workbook.cell(1,2).should eq("1")
|
24
24
|
end
|
25
|
+
it "should correctly count rows" do
|
26
|
+
@workbook.last_row.should eq(1)
|
27
|
+
end
|
28
|
+
it "should correctly count column" do
|
29
|
+
@workbook.last_column.should eq(2)
|
30
|
+
end
|
25
31
|
end
|
26
32
|
|
27
33
|
end
|
@@ -22,6 +22,12 @@ describe SimpleSpreadsheet do
|
|
22
22
|
it "should read integer from first sheets" do
|
23
23
|
@workbook.cell(1,2).should eq("1")
|
24
24
|
end
|
25
|
+
it "should correctly count rows" do
|
26
|
+
@workbook.last_row.should eq(1)
|
27
|
+
end
|
28
|
+
it "should correctly count column" do
|
29
|
+
@workbook.last_column.should eq(2)
|
30
|
+
end
|
25
31
|
end
|
26
32
|
|
27
33
|
end
|
@@ -22,6 +22,12 @@ describe SimpleSpreadsheet do
|
|
22
22
|
it "should read integer from first sheets" do
|
23
23
|
@workbook.cell(1,2).should eq("1")
|
24
24
|
end
|
25
|
+
it "should correctly count rows" do
|
26
|
+
@workbook.last_row.should eq(1)
|
27
|
+
end
|
28
|
+
it "should correctly count column" do
|
29
|
+
@workbook.last_column.should eq(2)
|
30
|
+
end
|
25
31
|
end
|
26
32
|
|
27
33
|
end
|
@@ -36,6 +36,12 @@ describe SimpleSpreadsheet do
|
|
36
36
|
@workbook.selected_sheet = 2
|
37
37
|
@workbook.cell(1, 2).should eq(2)
|
38
38
|
end
|
39
|
+
it "should correctly count rows" do
|
40
|
+
@workbook.last_row.should eq(1)
|
41
|
+
end
|
42
|
+
it "should correctly count column" do
|
43
|
+
@workbook.last_column.should eq(2)
|
44
|
+
end
|
39
45
|
end
|
40
46
|
|
41
47
|
end
|
@@ -36,6 +36,12 @@ describe SimpleSpreadsheet do
|
|
36
36
|
@workbook.selected_sheet = 2
|
37
37
|
@workbook.cell(1, 2).should eq(2)
|
38
38
|
end
|
39
|
+
it "should correctly count rows" do
|
40
|
+
@workbook.last_row.should eq(1)
|
41
|
+
end
|
42
|
+
it "should correctly count column" do
|
43
|
+
@workbook.last_column.should eq(2)
|
44
|
+
end
|
39
45
|
end
|
40
46
|
|
41
47
|
end
|
@@ -36,6 +36,12 @@ describe SimpleSpreadsheet do
|
|
36
36
|
@workbook.selected_sheet = 2
|
37
37
|
@workbook.cell(1, 2).should eq(2)
|
38
38
|
end
|
39
|
+
it "should correctly count rows" do
|
40
|
+
@workbook.last_row.should eq(1)
|
41
|
+
end
|
42
|
+
it "should correctly count column" do
|
43
|
+
@workbook.last_column.should eq(2)
|
44
|
+
end
|
39
45
|
end
|
40
46
|
|
41
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-spreadsheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,40 +21,76 @@ dependencies:
|
|
21
21
|
version: 2.6.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.6.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.9.2.2
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.9.2.2
|
25
46
|
- !ruby/object:Gem::Dependency
|
26
47
|
name: roo
|
27
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
28
49
|
none: false
|
29
50
|
requirements:
|
30
|
-
- - =
|
51
|
+
- - '='
|
31
52
|
- !ruby/object:Gem::Version
|
32
53
|
version: 1.10.1
|
33
54
|
type: :runtime
|
34
55
|
prerelease: false
|
35
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.10.1
|
36
62
|
- !ruby/object:Gem::Dependency
|
37
63
|
name: spreadsheet
|
38
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
39
65
|
none: false
|
40
66
|
requirements:
|
41
|
-
- - =
|
67
|
+
- - '='
|
42
68
|
- !ruby/object:Gem::Version
|
43
69
|
version: 0.6.5.9
|
44
70
|
type: :runtime
|
45
71
|
prerelease: false
|
46
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.6.5.9
|
47
78
|
- !ruby/object:Gem::Dependency
|
48
79
|
name: rubyXL
|
49
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
50
81
|
none: false
|
51
82
|
requirements:
|
52
|
-
- - =
|
83
|
+
- - '='
|
53
84
|
- !ruby/object:Gem::Version
|
54
85
|
version: 1.2.5
|
55
86
|
type: :runtime
|
56
87
|
prerelease: false
|
57
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - '='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.2.5
|
58
94
|
description: ! 'Simple spreadsheet reader for common formats: Excel (.xls, .xlsx),
|
59
95
|
Open-office (.ods) and some CSV (standard, excel, tab separated). Future versions:
|
60
96
|
writing and more formats.'
|
@@ -135,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
171
|
version: '0'
|
136
172
|
requirements: []
|
137
173
|
rubyforge_project:
|
138
|
-
rubygems_version: 1.8.
|
174
|
+
rubygems_version: 1.8.24
|
139
175
|
signing_key:
|
140
176
|
specification_version: 3
|
141
177
|
summary: Read and write most common spreadsheet format
|