Have been enjoying using this gem in my own projects - nice work!
One thing I've found to be limiting is the inability to treat Worksheet#each as you would Enumerable#each. For example you are unable to use worksheet.each(1).with_index.
This PR adds in that functionality by returning an enumerable object when no block is provided immediately to each.
For example you can now do:
worksheet.each(1).with_index do |row, index|
It also respects the previous syntax and still allows:
worksheet.each(1) do |row|
I've written specs for both cases.
This is my first open source contribution so let me know if anything needs to be changed!
Hey team,
Have been enjoying using this gem in my own projects - nice work!
One thing I've found to be limiting is the inability to treat
Worksheet#each
as you wouldEnumerable#each
. For example you are unable to useworksheet.each(1).with_index
.This PR adds in that functionality by returning an enumerable object when no block is provided immediately to
each
.For example you can now do:
worksheet.each(1).with_index do |row, index|
It also respects the previous syntax and still allows:
worksheet.each(1) do |row|
I've written specs for both cases.
This is my first open source contribution so let me know if anything needs to be changed!