lib/sinatra/route_parser.rb in sinatra-named-routes-subdomains-0.1.1 vs lib/sinatra/route_parser.rb in sinatra-named-routes-subdomains-0.1.2
- old
+ new
@@ -28,10 +28,12 @@
when :dot
@trailing_dot = item[:optional]
path << '.'
when :plus
path << '+'
+ when :dash
+ path << '-'
when :splat
if params.is_a? Hash
raise ArgumentError, 'No parameters passed.' if params[:splat].empty?
path << params[:splat].shift
else
@@ -120,9 +122,19 @@
def parse_plus
if @input.scan(/\+/)
{
:token => :plus
+ }
+ else
+ nil
+ end
+ end
+
+ def parse_dash
+ if @input.scan(/\-/)
+ {
+ :token => :dash
}
else
nil
end
end
\ No newline at end of file