prevent ArgumentError: wrong number of arguments (0 for 1) in Roo::Base#... #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
...find by row number if header_line is not nil.
Roo::Base#find not works with row number as argument if header_line is set.
I think this need to be fixed because header line is not nil as default:
https://github.com/Empact/roo/blob/master/lib/roo/base.rb#L61
Output from console:
'1.9.2-p320 :010 > excel = Roo::Excel.new("/Users/file.xls")
1.9.2-p320 :017 > excel.header_line
=> 1
1.9.2-p320 :018 > excel.find(1)
ArgumentError: wrong number of arguments (0 for 1)
from /Users/funkydrummer/.rvm/gems/ruby-1.9.2-p320/gems/roo-1.13.2/lib/roo/base.rb:263:in
row' from /Users/funkydrummer/.rvm/gems/ruby-1.9.2-p320/gems/roo-1.13.2/lib/roo/base.rb:229:in
find'from (irb):18
from /Users/funkydrummer/.rvm/rubies/ruby-1.9.2-p320/bin/irb:16:in `
This pull request fix this issue.
So, now:
excel.header_line = 5
excel.row(1) - return first row
excel.find(1) - return fifth row of spreadsheet