lib/cuba.rb in cuba-3.1.0 vs lib/cuba.rb in cuba-3.1.1
- old
+ new
@@ -145,11 +145,11 @@
# on get do
# res.write "GET"
# end
#
# on get, "signup" do
- # res.write "Signup
+ # res.write "Signup"
# end
#
# on "user/:id" do |uid|
# res.write "User: #{uid}"
# end
@@ -195,10 +195,10 @@
env["SCRIPT_NAME"], env["PATH_INFO"] = script, path
end
private :try
def consume(pattern)
- matchdata = env["PATH_INFO"].match(/\A\/(#{pattern})((?:\/|\z))/)
+ matchdata = env["PATH_INFO"].match(/\A\/(#{pattern})(\/|\z)/)
return false unless matchdata
path, *vars = matchdata.captures