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

slurp! mechanism #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

jayjlawrence
Copy link

You might find my slurp! method handy - see README.md for example of how it will automatically slurp a spreadsheet by using the sheet names to find the model class. If it can't find it then it will warn and move on to the next.

I added a couple of options that should be non-invasive to import! ... :delete and :sheet. You may want to have import! look for a sheet name based on the model class or table name ... or just leave with selecting the first sheet of the workbook.

Thanks!

@AnneTheAgile
Copy link

1.At yesterday's OpenRuby talk,
http://www.meetup.com/Ruby-Wednesdays-Open-Coding-at-Constant-Contact/events/151501942/
2.Trace said he was thrilled with the pull request to add more functionality, ie slurp, but he hadn't merged it because there were no associated tests for the new code. In other words, there is no new block in the spec,
https://github.com/tracedwax/importeroo/blob/master/spec/importeroo/importer_spec.rb
3.I'm going to see if I can add a test. Perhaps part of it needs a new fixture, if the existing excel file doesn't have multiple sheets.

@jayjlawrence
Copy link
Author

Great to see the feature is appreciated!

@AnneTheAgile
Copy link

DOC: Previously, only the first worksheet in the spreadsheet would be input. Now with Slurp, each worksheet is output as a class object.

AnneTheAgile pushed a commit to AnneTheAgile/importeroo that referenced this pull request Dec 30, 2013
…both that Sheet2 and the old bicycles sheet renamed as Sheet1. -Issue tracedwax#1
@AnneTheAgile
Copy link

1.Oh, gosh! I forgot github would auto-link! This commit is not ready for viewing!
2.See DOC for Roo, which is used and handles multiple worksheets;
http://rubydoc.info/gems/roo/1.13.2/frames

@AnneTheAgile
Copy link

@jayjlawrence , I got doing other things, but it seems I probably should put this on a VM since there are so many dependencies. Can you quickly tell me what you mean when you say classes are created for each tab? I'm not finding the code clear. Where does the class that is generated output? How do you use it? Is that code pushed up here in this commit or am I missing something? Thank you!

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