From 6c74338faf8021e2c949d203d10be24e1a5b9ea1 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Wed, 23 Mar 2011 21:36:15 +0100 Subject: [PATCH] deprecate Sinatra::Base#options --- lib/sinatra/base.rb | 7 ++++--- test/templates_test.rb | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index 98ce525b..e29a7cc6 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -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 diff --git a/test/templates_test.rb b/test/templates_test.rb index d5eb0d66..8a64312d 100644 --- a/test/templates_test.rb +++ b/test/templates_test.rb @@ -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