Skip to content

Instantly share code, notes, and snippets.

@jeremywrowe
Created October 20, 2012 20:32
Show Gist options
  • Save jeremywrowe/3924699 to your computer and use it in GitHub Desktop.
Save jeremywrowe/3924699 to your computer and use it in GitHub Desktop.
thoughts on rerouting gem
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