Permalink
Browse files

rename methodoverride setting to method_override

for consistancy with others settings which are all snake case
  • Loading branch information...
1 parent 0cf1dad commit 293fbc7cb02660666166f27910c75f859a20e929 @sr sr committed Dec 13, 2009
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/sinatra/base.rb
View
@@ -908,7 +908,7 @@ def new(*args, &bk)
builder = Rack::Builder.new
builder.use Rack::Session::Cookie if sessions? && !test?
builder.use Rack::CommonLogger if logging?
- builder.use Rack::MethodOverride if methodoverride?
+ builder.use Rack::MethodOverride if method_override?
builder.use ShowExceptions if show_exceptions?
@middleware.each { |c,a,b| builder.use(c, *a, &b) }
@@ -1002,7 +1002,7 @@ def caller_locations
set :show_exceptions, false
set :sessions, false
set :logging, false
- set :methodoverride, false
+ set :method_override, false
set :static, false
set :environment, (ENV['RACK_ENV'] || :development).to_sym
@@ -1017,6 +1017,11 @@ def caller_locations
set :public, Proc.new { root && File.join(root, 'public') }
set :lock, false
+ class << self
+ alias_method :methodoverride?, :method_override?
+ alias_method :methodoverride=, :method_override=
+ end
+
# static files route
get(/.*[^\/]$/) do
pass unless options.static? && options.public?
@@ -1075,7 +1080,7 @@ class Application < Base
set :dump_errors, true
set :sessions, false
set :logging, Proc.new { ! test? }
- set :methodoverride, true
+ set :method_override, true
set :static, true
set :run, Proc.new { ! test? }

0 comments on commit 293fbc7

Please sign in to comment.