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

prevent ArgumentError: wrong number of arguments (0 for 1) in Roo::Base#... #100

Merged
merged 1 commit into from
Jan 25, 2014

Conversation

rafaltrojanowski
Copy link
Contributor

...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:infind'
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

…se#find by row number if header_line is not nil
Empact added a commit that referenced this pull request Jan 25, 2014
prevent ArgumentError: wrong number of arguments (0 for 1) in Roo::Base#...
@Empact Empact merged commit 0db7af2 into roo-rb:master Jan 25, 2014
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.

2 participants