Permalink
Browse files

Merge pull request #8565 from frodsan/wed_code_journey

nodoc Journey and remove unneeded Ruby <1.9 validation
  • Loading branch information...
2 parents f0129da + a36ae63 commit dd4822ce163f273407eb3493e08c8543e479bf71 @carlosantoniodasilva carlosantoniodasilva committed Dec 20, 2012
View
2 actionpack/lib/action_dispatch/journey/backwards.rb
@@ -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
11 actionpack/lib/action_dispatch/journey/formatter.rb
@@ -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 @@ def non_recursive cache, options
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 @@ def possibles cache, options, depth = 0
}.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
8 actionpack/lib/action_dispatch/journey/gtg/builder.rb
@@ -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
8 actionpack/lib/action_dispatch/journey/gtg/simulator.rb
@@ -1,17 +1,17 @@
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
@memos = memos
end
end
- class Simulator
+ class Simulator # :nodoc:
attr_reader :tt
def initialize transition_table
View
6 actionpack/lib/action_dispatch/journey/gtg/transition_table.rb
@@ -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
8 actionpack/lib/action_dispatch/journey/nfa/builder.rb
@@ -2,9 +2,9 @@
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 @@ def terminal node
end
end
- class Builder
+ class Builder # :nodoc:
def initialize ast
@ast = ast
end
View
6 actionpack/lib/action_dispatch/journey/nfa/dot.rb
@@ -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
8 actionpack/lib/action_dispatch/journey/nfa/simulator.rb
@@ -1,17 +1,17 @@
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
@memos = memos
end
end
- class Simulator
+ class Simulator # :nodoc:
attr_reader :tt
def initialize transition_table
View
6 actionpack/lib/action_dispatch/journey/nfa/transition_table.rb
@@ -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
24 actionpack/lib/action_dispatch/journey/nodes/node.rb
@@ -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 @@ def symbol?; false; end
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 @@ def type; :#{t.upcase}; end
eoruby
end
- class Symbol < Terminal
+ class Symbol < Terminal # :nodoc:
attr_accessor :regexp
alias :symbol :regexp
@@ -83,19 +83,19 @@ def default_regexp?
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 @@ def initialize left, right
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
4 actionpack/lib/action_dispatch/journey/parser.rb
@@ -9,8 +9,8 @@
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
4 actionpack/lib/action_dispatch/journey/parser_extras.rb
@@ -2,8 +2,8 @@
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
8 actionpack/lib/action_dispatch/journey/path/pattern.rb
@@ -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 @@ def accept node
end
end
- class MatchData
+ class MatchData # :nodoc:
attr_reader :names
def initialize names, offsets, match
View
4 actionpack/lib/action_dispatch/journey/route.rb
@@ -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
7 actionpack/lib/action_dispatch/journey/router.rb
@@ -12,11 +12,12 @@
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
6 actionpack/lib/action_dispatch/journey/router/strexp.rb
@@ -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
17 actionpack/lib/action_dispatch/journey/router/utils.rb
@@ -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 @@ def self.normalize_path(path)
# 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 = '/?'
@@ -31,13 +31,8 @@ module UriEscape
safe_pchar = "#{URI::REGEXP::PATTERN::UNRESERVED}#{reserved_pchar}"
safe_segment = "#{safe_pchar}#{reserved_segment}"
safe_fragment = "#{safe_pchar}#{reserved_fragment}"
- if RUBY_VERSION >= '1.9'
- UNSAFE_SEGMENT = Regexp.new("[^#{safe_segment}]", false).freeze
- UNSAFE_FRAGMENT = Regexp.new("[^#{safe_fragment}]", false).freeze
- else
- UNSAFE_SEGMENT = Regexp.new("[^#{safe_segment}]", false, 'N').freeze
- UNSAFE_FRAGMENT = Regexp.new("[^#{safe_fragment}]", false, 'N').freeze
- end
+ UNSAFE_SEGMENT = Regexp.new("[^#{safe_segment}]", false).freeze
+ UNSAFE_FRAGMENT = Regexp.new("[^#{safe_fragment}]", false).freeze
end
Parser = URI.const_defined?(:Parser) ? URI::Parser.new : URI
View
9 actionpack/lib/action_dispatch/journey/routes.rb
@@ -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
4 actionpack/lib/action_dispatch/journey/scanner.rb
@@ -1,8 +1,8 @@
require 'strscan'
module ActionDispatch
- module Journey
- class Scanner
+ module Journey # :nodoc:
+ class Scanner # :nodoc:
def initialize
@ss = nil
end
View
12 actionpack/lib/action_dispatch/journey/visitors.rb
@@ -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 @@ def terminal node; end
end
end
- ##
# Loop through the requirements AST
class Each < Visitor # :nodoc:
attr_reader :block
@@ -54,7 +53,7 @@ def visit node
end
end
- class String < Visitor
+ class String < Visitor # :nodoc:
private
def binary node
@@ -74,9 +73,8 @@ def visit_GROUP node
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 @@ def visit_SYMBOL node
end
end
- class Dot < Visitor
+ class Dot < Visitor # :nodoc:
def initialize
@nodes = []
@edges = []

0 comments on commit dd4822c

Please sign in to comment.