1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

:nodoc: Journey because is not part of the public API [ci skip]

This commit is contained in:
Francesco Rodriguez 2012-12-19 19:24:25 -05:00
parent a1cffa6d58
commit a36ae63d07
20 changed files with 75 additions and 78 deletions

View file

@ -1,4 +1,4 @@
module Rack
module Rack # :nodoc:
Mount = ActionDispatch::Journey::Router
Mount::RouteSet = ActionDispatch::Journey::Router
Mount::RegexpWithNamedGroups = ActionDispatch::Journey::Path::Pattern

View file

@ -1,9 +1,8 @@
module ActionDispatch
module Journey
###
# The Formatter class is used for formatting URLs. For example, parameters
# passed to +url_for+ in rails will eventually call Formatter#generate
class Formatter
# The Formatter class is used for formatting URLs. For example, parameters
# passed to +url_for+ in rails will eventually call Formatter#generate.
class Formatter # :nodoc:
attr_reader :routes
def initialize routes
@ -101,7 +100,7 @@ module ActionDispatch
routes
end
# returns an array populated with missing keys if any are present
# Returns an array populated with missing keys if any are present.
def missing_keys route, parts
missing_keys = []
tests = route.path.requirements
@ -123,7 +122,7 @@ module ActionDispatch
}.flatten(1)
end
# returns boolean, true if no missing keys are present
# Returns +true+ if no missing keys are present, otherwise +false+.
def verify_required_parts! route, parts
missing_keys(route, parts).empty?
end

View file

@ -1,10 +1,10 @@
require 'action_dispatch/journey/gtg/transition_table'
module ActionDispatch
module Journey
module GTG
class Builder
DUMMY = Nodes::Dummy.new # :nodoc:
module Journey # :nodoc:
module GTG # :nodoc:
class Builder # :nodoc:
DUMMY = Nodes::Dummy.new
attr_reader :root, :ast, :endpoints

View file

@ -1,9 +1,9 @@
require 'strscan'
module ActionDispatch
module Journey
module GTG
class MatchData
module Journey # :nodoc:
module GTG # :nodoc:
class MatchData # :nodoc:
attr_reader :memos
def initialize memos
@ -11,7 +11,7 @@ module ActionDispatch
end
end
class Simulator
class Simulator # :nodoc:
attr_reader :tt
def initialize transition_table

View file

@ -1,9 +1,9 @@
require 'action_dispatch/journey/nfa/dot'
module ActionDispatch
module Journey
module GTG
class TransitionTable
module Journey # :nodoc:
module GTG # :nodoc:
class TransitionTable # :nodoc:
include Journey::NFA::Dot
attr_reader :memos

View file

@ -2,9 +2,9 @@ require 'action_dispatch/journey/nfa/transition_table'
require 'action_dispatch/journey/gtg/transition_table'
module ActionDispatch
module Journey
module NFA
class Visitor < Visitors::Visitor
module Journey # :nodoc:
module NFA # :nodoc:
class Visitor < Visitors::Visitor # :nodoc:
def initialize tt
@tt = tt
@i = -1
@ -60,7 +60,7 @@ module ActionDispatch
end
end
class Builder
class Builder # :nodoc:
def initialize ast
@ast = ast
end

View file

@ -1,9 +1,9 @@
# encoding: utf-8
module ActionDispatch
module Journey
module NFA
module Dot
module Journey # :nodoc:
module NFA # :nodoc:
module Dot # :nodoc:
def to_dot
edges = transitions.map { |from, sym, to|
" #{from} -> #{to} [label=\"#{sym || 'ε'}\"];"

View file

@ -1,9 +1,9 @@
require 'strscan'
module ActionDispatch
module Journey
module NFA
class MatchData
module Journey # :nodoc:
module NFA # :nodoc:
class MatchData # :nodoc:
attr_reader :memos
def initialize memos
@ -11,7 +11,7 @@ module ActionDispatch
end
end
class Simulator
class Simulator # :nodoc:
attr_reader :tt
def initialize transition_table

View file

@ -1,9 +1,9 @@
require 'action_dispatch/journey/nfa/dot'
module ActionDispatch
module Journey
module NFA
class TransitionTable
module Journey # :nodoc:
module NFA # :nodoc:
class TransitionTable # :nodoc:
include Journey::NFA::Dot
attr_accessor :accepting

View file

@ -1,8 +1,8 @@
require 'action_dispatch/journey/visitors'
module ActionDispatch
module Journey
module Nodes
module Journey # :nodoc:
module Nodes # :nodoc:
class Node # :nodoc:
include Enumerable
@ -41,16 +41,16 @@ module ActionDispatch
def literal?; false; end
end
class Terminal < Node
class Terminal < Node # :nodoc:
alias :symbol :left
end
class Literal < Terminal
class Literal < Terminal # :nodoc:
def literal?; true; end
def type; :LITERAL; end
end
class Dummy < Literal
class Dummy < Literal # :nodoc:
def initialize x = Object.new
super
end
@ -66,7 +66,7 @@ module ActionDispatch
eoruby
end
class Symbol < Terminal
class Symbol < Terminal # :nodoc:
attr_accessor :regexp
alias :symbol :regexp
@ -83,19 +83,19 @@ module ActionDispatch
def symbol?; true; end
end
class Unary < Node
class Unary < Node # :nodoc:
def children; [left] end
end
class Group < Unary
class Group < Unary # :nodoc:
def type; :GROUP; end
end
class Star < Unary
class Star < Unary # :nodoc:
def type; :STAR; end
end
class Binary < Node
class Binary < Node # :nodoc:
attr_accessor :right
def initialize left, right
@ -106,11 +106,11 @@ module ActionDispatch
def children; [left, right] end
end
class Cat < Binary
class Cat < Binary # :nodoc:
def type; :CAT; end
end
class Or < Node
class Or < Node # :nodoc:
attr_reader :children
def initialize children

View file

@ -9,8 +9,8 @@ require 'racc/parser.rb'
require 'action_dispatch/journey/parser_extras'
module ActionDispatch
module Journey
class Parser < Racc::Parser
module Journey # :nodoc:
class Parser < Racc::Parser # :nodoc:
##### State transition tables begin ###
racc_action_table = [

View file

@ -2,8 +2,8 @@ require 'action_dispatch/journey/scanner'
require 'action_dispatch/journey/nodes/node'
module ActionDispatch
module Journey
class Parser < Racc::Parser
module Journey # :nodoc:
class Parser < Racc::Parser # :nodoc:
include Journey::Nodes
def initialize

View file

@ -1,7 +1,7 @@
module ActionDispatch
module Journey
module Path
class Pattern
module Journey # :nodoc:
module Path # :nodoc:
class Pattern # :nodoc:
attr_reader :spec, :requirements, :anchored
def initialize strexp
@ -133,7 +133,7 @@ module ActionDispatch
end
end
class MatchData
class MatchData # :nodoc:
attr_reader :names
def initialize names, offsets, match

View file

@ -1,6 +1,6 @@
module ActionDispatch
module Journey
class Route
module Journey # :nodoc:
class Route # :nodoc:
attr_reader :app, :path, :verb, :defaults, :ip, :name
attr_reader :constraints

View file

@ -12,11 +12,12 @@ require 'action_dispatch/journey/route'
require 'action_dispatch/journey/path/pattern'
module ActionDispatch
module Journey
class Router
class RoutingError < ::StandardError
module Journey # :nodoc:
class Router # :nodoc:
class RoutingError < ::StandardError # :nodoc:
end
# :nodoc:
VERSION = '2.0.0'
class NullReq # :nodoc:

View file

@ -1,7 +1,7 @@
module ActionDispatch
module Journey
class Router
class Strexp
module Journey # :nodoc:
class Router # :nodoc:
class Strexp # :nodoc:
class << self
alias :compile :new
end

View file

@ -1,9 +1,9 @@
require 'uri'
module ActionDispatch
module Journey
class Router
class Utils
module Journey # :nodoc:
class Router # :nodoc:
class Utils # :nodoc:
# Normalizes URI path.
#
# Strips off trailing slash and ensures there is a leading slash.
@ -22,7 +22,7 @@ module ActionDispatch
# URI path and fragment escaping
# http://tools.ietf.org/html/rfc3986
module UriEscape
module UriEscape # :nodoc:
# Symbol captures can generate multiple path segments, so include /.
reserved_segment = '/'
reserved_fragment = '/?'

View file

@ -1,9 +1,8 @@
module ActionDispatch
module Journey
###
# The Routing table. Contains all routes for a system. Routes can be
# added to the table by calling Routes#add_route
class Routes
module Journey # :nodoc:
# The Routing table. Contains all routes for a system. Routes can be
# added to the table by calling Routes#add_route.
class Routes # :nodoc:
include Enumerable
attr_reader :routes, :named_routes

View file

@ -1,8 +1,8 @@
require 'strscan'
module ActionDispatch
module Journey
class Scanner
module Journey # :nodoc:
class Scanner # :nodoc:
def initialize
@ss = nil
end

View file

@ -1,7 +1,7 @@
# encoding: utf-8
module ActionDispatch
module Journey
module Visitors
module Journey # :nodoc:
module Visitors # :nodoc:
class Visitor # :nodoc:
DISPATCH_CACHE = Hash.new { |h,k|
h[k] = "visit_#{k}"
@ -39,7 +39,6 @@ module ActionDispatch
end
end
##
# Loop through the requirements AST
class Each < Visitor # :nodoc:
attr_reader :block
@ -54,7 +53,7 @@ module ActionDispatch
end
end
class String < Visitor
class String < Visitor # :nodoc:
private
def binary node
@ -74,9 +73,8 @@ module ActionDispatch
end
end
###
# Used for formatting urls (url_for)
class Formatter < Visitor
class Formatter < Visitor # :nodoc:
attr_reader :options, :consumed
def initialize options
@ -118,7 +116,7 @@ module ActionDispatch
end
end
class Dot < Visitor
class Dot < Visitor # :nodoc:
def initialize
@nodes = []
@edges = []