lib/sinatra/export.rb
# A convenience method to keep this logic together
# and reusable
# @param [String,Regexp] path
# @return [TrueClass] Whether the path is a straightforward path (i.e. usable) or it's a regex or path with named captures / wildcards (i.e. unusable).
A convenience method to keep this logic together
and reusable
A convenience method to keep this logic together and reusable
def route_path_usable? path
          res = path.respond_to?( :~ )  ||  
                path =~ /(?:\:\w+)|\*/  ||  
                path =~ /[\%\\]/        ||  
                path[0..-2].include?("?") 
          !res
        end
def route_path_usable? path res = path . respond_to? ( :~ ) || path =~ / (?: \: \w +)| \* / || path =~ / [ \% \\ ] / || path [ 0 .. - 2 ] . include? ( "?" ) ! res end
A convenience method to keep this logic together
and reusable
A convenience method to keep this logic together and reusable
# skip regex # keys and splats # special chars # an ending ? is acceptable, it'll be chomped
Whether the path is a straightforward path  or it's a regex or path with named captures / wildcards .
Whether the path is a straightforward path or it ' s a regex or path with named captures / wildcards .
TrueClass
path
None