On Jun 7, 1:40 pm, "J. D." <rails-mailing-l...@andreas-s.net> wrote:
> Maurício Linhares wrote:
> > This custom file should be called scraper.rb and should be placed at
> > the /lib folder of your application. In a rake task you don't really
> > access or call controllers, you just run the task, which is telling
> > the scrapper to load the data and then save it to the DB.
>
> So, just to make sure I understand correctly..
>
> The scraper.rb file would go in the lib folder and my scraper.rake file
> would go in the lib\tasks folder?  The rake file - would I have to
> include anything to call that .rb file?  I'm sorry if I am
> misunderstanding this portion of the mechanics.
>
>
Because your task depends on :environment Rails is loaded, in
particular its dependency management is loaded so it will find your
Scraper class as long as it's in scraper.rb somewhere on its search
path. Don't take my word for it though, try it!

Fred

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to