use starts_with? instead of start_with, fixes #253 and #251

This commit is contained in:
Mario Visic 2011-11-27 18:22:00 +11:00
parent 0e5e16c8b4
commit 7f7ed896cf
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ module Locomotive
end
def absolute_url(url)
url.starts_with('/') ? url : "/#{url}"
url.starts_with?('/') ? url : "/#{url}"
end
end

View File

@ -9,7 +9,7 @@ module Locomotive
def call(env)
path = env['PATH_INFO']
if !path.starts_with('/admin/') && (match = path.match(%r{(.+)/$}))
if !path.starts_with?('/admin/') && (match = path.match(%r{(.+)/$}))
response = Rack::Response.new
response.redirect(match[1], 301) # moved permanently
response.finish