Skip to content

Commit

Permalink
rename methodoverride setting to method_override
Browse files Browse the repository at this point in the history
for consistancy with others settings which are all snake case
  • Loading branch information
sr committed Feb 22, 2010
1 parent 0cf1dad commit 293fbc7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down Expand Up @@ -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

Expand All @@ -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?
Expand Down Expand Up @@ -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? }

Expand Down

0 comments on commit 293fbc7

Please sign in to comment.