1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

deprecate Sinatra::Base#options

This commit is contained in:
Konstantin Haase 2011-03-23 21:36:15 +01:00
parent 728a66f793
commit 6c74338faf
2 changed files with 5 additions and 4 deletions

View file

@ -643,9 +643,10 @@ module Sinatra
self.class.settings
end
alias_method :options, :settings
class << self
alias_method :options, :settings
def options
warn "Sinatra::Base#options is deprecated and will be removed, " \
"use #settings insetad.\n\tfrom #{caller.first}"
settings
end
# Exit the current block, halts any further processing

View file

@ -144,7 +144,7 @@ class TemplatesTest < Test::Unit::TestCase
end
it 'loads templates from specified views directory' do
render_app { render :test, :hello, :views => options.views + '/foo' }
render_app { render :test, :hello, :views => settings.views + '/foo' }
assert_equal "from another views directory\n", body
end