Created
April 5, 2012 20:53
-
-
Save tcrayford/2314103 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# with dependency injection, and slightly different route syntax: | |
module WebCrawler | |
Routes = Raptor::App.new(self) do | |
queue = #... some sort of persistent queue initialized here | |
crawler = WebCrawler.new(queue) | |
path "to-be-crawled" do | |
create crawler, :enqueue!, :require => :logged_in | |
end | |
end | |
end | |
# Downsides: | |
# routes creation methods are going to have to is_a? check their args | |
# so people can still use the default delegate actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another plus: this gets rid of the nastiness with :to stuff described as strings.