Class Sinatra::Default
In: lib/sinatra/base.rb
lib/sinatra/compat.rb
Parent: Base

Deprecated as base class for non-top-level apps. Subclass Sinatra::Base instead and set options as needed.

Methods

Public Class methods

Deprecated. Use: configure

[Source]

     # File lib/sinatra/compat.rb, line 168
168:       def configures(*args, &block)
169:         sinatra_warn "The 'configures' method is deprecated; use 'configure' instead."
170:         configure(*args, &block)
171:       end

Deprecated. Use: set

[Source]

     # File lib/sinatra/compat.rb, line 174
174:       def default_options
175:         sinatra_warn "Sinatra::Application.default_options is deprecated; use 'set' instead."
176:         fake = lambda { |options| set(options) }
177:         def fake.merge!(options) ; call(options) ; end
178:         fake
179:       end

Deprecated. Use: options.environment

[Source]

     # File lib/sinatra/compat.rb, line 199
199:       def env
200:         sinatra_warn "The :env option is deprecated; use :environment instead."
201:         environment
202:       end

Deprecated. Use: set :environment, ENV

[Source]

     # File lib/sinatra/compat.rb, line 193
193:       def env=(value)
194:         sinatra_warn "The :env option is deprecated; use :environment instead."
195:         set :environment, value
196:       end

[Source]

      # File lib/sinatra/base.rb, line 1095
1095:     def self.inherited(subclass)
1096:       sinatra_warn 'Sinatra::Default is deprecated; ' \
1097:                    'subclass Sinatra::Base instead'
1098:       super
1099:     end

Deprecated. Options are stored directly on the class object.

[Source]

     # File lib/sinatra/compat.rb, line 162
162:       def options
163:         sinatra_warn "The 'options' class method is deprecated; use 'self' instead."
164:         Options.new(self)
165:       end

Deprecated. Use: set

[Source]

     # File lib/sinatra/compat.rb, line 182
182:       def  set_optionset_option(*args, &block)
183:         sinatra_warn "The 'set_option' method is deprecated; use 'set' instead."
184:         set(*args, &block)
185:       end

[Source]

     # File lib/sinatra/compat.rb, line 187
187:       def set_options(*args, &block)
188:         sinatra_warn "The 'set_options' method is deprecated; use 'set' instead."
189:         set(*args, &block)
190:       end

Public Instance methods

Deprecated. Use: etag

[Source]

    # File lib/sinatra/compat.rb, line 94
94:     def entity_tag(*args, &block)
95:       sinatra_warn "The 'entity_tag' method is deprecated; use 'etag' instead."
96:       etag(*args, &block)
97:     end

Deprecated. Use: response[‘Header-Name’]

[Source]

    # File lib/sinatra/compat.rb, line 82
82:     def header(header=nil)
83:       sinatra_warn "The 'header' method is deprecated; use 'headers' instead."
84:       headers(header)
85:     end

The :views_directory, :options, :haml, and :sass options are deprecated.

[Source]

     # File lib/sinatra/compat.rb, line 111
111:     def render(engine, template, options={}, locals={}, &bk)
112:       if options.key?(:views_directory)
113:         sinatra_warn "The :views_directory option is deprecated; use :views instead."
114:         options[:views] = options.delete(:views_directory)
115:       end
116:       [:options, engine.to_sym].each do |key|
117:         if options.key?(key)
118:           sinatra_warn "Passing :#{key} => {} to #{engine} is deprecated; " +
119:                        "merge options directly into hash instead."
120:           options.merge! options.delete(key)
121:         end
122:       end
123:       super(engine, template, options, locals, &bk)
124:     end

Deprecated. Use the attachment helper and return the data as a String or Array.

[Source]

     # File lib/sinatra/compat.rb, line 101
101:     def send_data(data, options={})
102:       sinatra_warn "The 'send_data' method is deprecated. use attachment, status, content_type, etc. helpers instead."
103: 
104:       status       options[:status]   if options[:status]
105:       attachment   options[:filename] if options[:disposition] == 'attachment'
106:       content_type options[:type]     if options[:type]
107:       halt data
108:     end

Deprecated. Use: halt

[Source]

    # File lib/sinatra/compat.rb, line 88
88:     def stop(*args, &block)
89:       sinatra_warn "The 'stop' method is deprecated; use 'halt' instead."
90:       halt(*args, &block)
91:     end

[Validate]