Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional formula cell types: Date, TrueClass, FalseClass #366

Closed
wants to merge 2 commits into from
Closed

Add additional formula cell types: Date, TrueClass, FalseClass #366

wants to merge 2 commits into from

Conversation

cybercode
Copy link

Title is self expanatory. to_csv fails due to missing formula result types:

  • Date
  • TrueClass
  • FalseClass

@coveralls
Copy link

coveralls commented Dec 30, 2016

Coverage Status

Coverage remained the same at 93.813% when pulling 1d3065e on cybercode:add-formula-types into 8824f8a on roo-rb:master.

@stevendaniels
Copy link
Contributor

It looks like a good change. Could you add some tests that demonstrate the bad behavior?

@cybercode
Copy link
Author

Added test, but it seems there was a major refactor on master two hours after i generated this pull request and alll the csv code has been moved out of base.rb! It's a one line change, I can't really spend hours on keeping up...

@stevendaniels
Copy link
Contributor

@cybercode: Thanks for the update. Apologies for the conflicts caused. I added your changes to #367 and will merge them in soon.

@cybercode
Copy link
Author

thanks. BTW, forgot to include this patch, which makes it much easier to track down the bad cells:

diff --git a/lib/roo/formatters/csv.rb b/lib/roo/formatters/csv.rb
index 3181f09..c062bf0 100644
--- a/lib/roo/formatters/csv.rb
+++ b/lib/roo/formatters/csv.rb
@@ -67,7 +67,7 @@ module Roo
           when Date, DateTime, TrueClass, FalseClass
             onecell.to_s
           else
-            fail "unhandled onecell-class #{onecell.class}"
+            fail "unhandled onecell-class #{onecell.class} (#{sheet}!#{row}:#{col})"
           end
         when :date, :datetime
           onecell.to_s

Should probably add it on line 79 as well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants