spreadsheet 0.6.5.7 → 0.6.5.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.
@@ -42,7 +42,7 @@ module Spreadsheet
42
42
 
43
43
  ##
44
44
  # The version of Spreadsheet you are using.
45
- VERSION = '0.6.5.7'
45
+ VERSION = '0.6.5.8'
46
46
 
47
47
  ##
48
48
  # Default client Encoding. Change this value if your application uses a
@@ -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]
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # suite.rb -- oddb -- 08.01.2009 -- hwyss@ywesee.com
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
@@ -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: 101
4
+ hash: 123
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
9
  - 5
10
- - 7
11
- version: 0.6.5.7
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-07-20 00:00:00 +02:00
19
+ date: 2011-08-30 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency