Created
October 20, 2012 20:32
-
-
Save jeremywrowe/3924699 to your computer and use it in GitHub Desktop.
thoughts on rerouting gem
This file contains 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
path_loader = Rerouter.setup(self) | |
path_loader.load do |loader| | |
# Updating the defaults | |
loader.match_strategy :end # only applies to strings [:fullname, :beginning, :end] | |
loader.pattern "Raout" # "" or /something/ | |
loader.extension [:rb, :route] | |
isolated_routes_path = File.join(Rails.root, 'config', 'routes') | |
# Loading something out of band | |
loader.add \ | |
:name => "FrankLloydWright", | |
:extension => :rb | |
:path => isolated_routes_path # Default | |
# Excluding items from the load process | |
loader.exclusions do |exclusion| | |
exclusion.match_strategy :end # [:fullname, :beginning, :end] | |
exclusion.add "FooBar" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment