-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug where Formatted cells were lost.
This fixes the issue reported by Corey Martella in http://rubyforge.org/forum/message.php?msg_id=63651 as well as other issues engendered by the decision to always shorten Rows to the last non-nil value.
- Loading branch information
1 parent
31053b2
commit 52755ad
Showing
11 changed files
with
145 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Array | ||
def rcompact | ||
dup.rcompact! | ||
end | ||
def rcompact! | ||
while !empty? && last.nil? | ||
pop | ||
end | ||
self | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env ruby | ||
# TestRow -- Spreadsheet -- 08.01.2009 -- hwyss@ywesee.com | ||
|
||
$: << File.expand_path('../../lib', File.dirname(__FILE__)) | ||
|
||
require 'test/unit' | ||
require 'spreadsheet' | ||
|
||
module Spreadsheet | ||
class TestRow < Test::Unit::TestCase | ||
def setup | ||
@workbook = Excel::Workbook.new | ||
@worksheet = Excel::Worksheet.new | ||
@workbook.add_worksheet @worksheet | ||
end | ||
def test_formatted | ||
row = Row.new @worksheet, 0, [nil, 1] | ||
assert_equal 2, row.formatted.size | ||
row.set_format 3, Format.new | ||
assert_equal 4, row.formatted.size | ||
end | ||
def test_concat | ||
row = Row.new @worksheet, 0, [nil, 1, nil] | ||
assert_equal [nil, 1, nil], row | ||
row.concat [2, nil] | ||
assert_equal [nil, 1, nil, 2, nil], row | ||
row.concat [3] | ||
assert_equal [nil, 1, nil, 2, nil, 3], row | ||
row.concat [nil, 4] | ||
assert_equal [nil, 1, nil, 2, nil, 3, nil, 4], row | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
# suite.rb -- oddb -- 08.01.2009 -- hwyss@ywesee.com | ||
|
||
require 'find' | ||
|
||
here = File.dirname(__FILE__) | ||
|
||
$: << here | ||
|
||
Find.find(here) do |file| | ||
if /(?<!suite)\.rb$/o.match(file) | ||
require file | ||
end | ||
end |
Oops, something went wrong.