diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-20 13:23:50 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-20 13:25:14 -0700 |
commit | 25c672637206a2c48fd829c58596c788b6e31c5d (patch) | |
tree | e7083c95b2db8468867e9559daf35b55e61b0f00 | |
parent | c99ff6df0031a10d67d6185597085a6bcbeee114 (diff) | |
download | rails-25c672637206a2c48fd829c58596c788b6e31c5d.tar.gz rails-25c672637206a2c48fd829c58596c788b6e31c5d.tar.bz2 rails-25c672637206a2c48fd829c58596c788b6e31c5d.zip |
remove dead code
-rw-r--r-- | actionpack/lib/action_dispatch/journey/visitors.rb | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/actionpack/lib/action_dispatch/journey/visitors.rb b/actionpack/lib/action_dispatch/journey/visitors.rb index cc7e0b644b..b635576b6a 100644 --- a/actionpack/lib/action_dispatch/journey/visitors.rb +++ b/actionpack/lib/action_dispatch/journey/visitors.rb @@ -177,63 +177,6 @@ module ActionDispatch end end - # Used for formatting urls (url_for) - class Formatter < Visitor # :nodoc: - attr_reader :options, :consumed - - def initialize(options) - @options = options - @consumed = {} - end - - private - def escape_path(value) - Router::Utils.escape_path(value) - end - - def escape_segment(value) - Router::Utils.escape_segment(value) - end - - def visit_GROUP(node) - if consumed == options - nil - else - route = visit(node.left) - route.include?("\0") ? nil : route - end - end - - def terminal(node) - node.left - end - - def binary(node) - [visit(node.left), visit(node.right)].join - end - - def nary(node) - node.children.map { |c| visit(c) }.join - end - - def visit_STAR(node) - if value = options[node.left.to_sym] - escape_path(value) - end - end - - def visit_SYMBOL(node) - key = node.to_sym - - if value = options[key] - consumed[key] = value - key == :controller ? escape_path(value) : escape_segment(value) - else - "\0" - end - end - end - class Dot < Visitor # :nodoc: def initialize @nodes = [] |