spreadsheet 0.6.5.7 → 0.6.5.8
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/History.txt +8 -0
- data/lib/spreadsheet.rb +1 -1
- data/lib/spreadsheet/workbook.rb +6 -0
- data/test/suite.rb +4 -1
- data/test/workbook.rb +8 -0
- metadata +4 -4
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
=== 0.6.5.8 / 30.8.2011
|
2
|
+
|
3
|
+
* This patch is about adding a sheet_count method to workbook so that it returns
|
4
|
+
* the total no of worksheets for easy access. Please check. By
|
5
|
+
* tamizhgeek@gmail.com
|
6
|
+
|
7
|
+
* https://gist.github.com/1180625
|
8
|
+
|
1
9
|
=== 0.6.5.7 / 20.7.2011
|
2
10
|
|
3
11
|
* Fixed the bug introduced by Roel van der Hoorn and updated the test cases.
|
data/lib/spreadsheet.rb
CHANGED
data/lib/spreadsheet/workbook.rb
CHANGED
@@ -56,6 +56,12 @@ module Spreadsheet
|
|
56
56
|
add_worksheet Worksheet.new(opts)
|
57
57
|
end
|
58
58
|
##
|
59
|
+
# Returns the count of total worksheets present.
|
60
|
+
# Takes no arguments. Just returns the length of @worksheets array.
|
61
|
+
def sheet_count
|
62
|
+
@worksheets.length
|
63
|
+
end
|
64
|
+
##
|
59
65
|
# The Font at _idx_
|
60
66
|
def font idx
|
61
67
|
@fonts[idx]
|
data/test/suite.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# suite.rb --
|
2
|
+
# suite.rb -- spreadsheet -- 26.07.2011 -- zdavatz@ywesee.com
|
3
3
|
|
4
4
|
require 'find'
|
5
5
|
|
@@ -9,6 +9,9 @@ $: << here
|
|
9
9
|
|
10
10
|
Find.find(here) do |file|
|
11
11
|
if /(?<!suite)\.rb$/o.match(file)
|
12
|
+
#from Roel van der Hoorn vanderhoorn@gmail.com
|
13
|
+
#should work for Ruby 1.8 and 1.9, without Oniguruma
|
14
|
+
# if /(?:^|\/)(?!suite)[^\/]+\.rb$/o
|
12
15
|
require file
|
13
16
|
end
|
14
17
|
end
|
data/test/workbook.rb
CHANGED
@@ -17,5 +17,13 @@ module Spreadsheet
|
|
17
17
|
def test_writer__default_excel
|
18
18
|
assert_instance_of Excel::Writer::Workbook, @book.writer(@io)
|
19
19
|
end
|
20
|
+
def test_sheet_count
|
21
|
+
@worksheet1 = Excel::Worksheet.new
|
22
|
+
@book.add_worksheet @worksheet1
|
23
|
+
assert_equal 1, @book.sheet_count
|
24
|
+
@worksheet2 = Excel::Worksheet.new
|
25
|
+
@book.add_worksheet @worksheet2
|
26
|
+
assert_equal 2, @book.sheet_count
|
27
|
+
end
|
20
28
|
end
|
21
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreadsheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 123
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
9
|
- 5
|
10
|
-
-
|
11
|
-
version: 0.6.5.
|
10
|
+
- 8
|
11
|
+
version: 0.6.5.8
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Masaomi Hatakeyama, Zeno R.R. Davatz
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-08-30 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|