compat.rb

Path: lib/sinatra/compat.rb
Last Update: Wed Mar 04 06:22:20 -0700 2009

Sinatra 0.3.x compatibility module.

The following code makes Sinatra 0.9.x compatible with Sinatra 0.3.x to ease the transition to the final 1.0 release. Everything defined in this file will be removed for the 1.0 release.

Required files

ostruct   sinatra/base   sinatra/main   swiftcore/swiftiplied_mongrel   swiftcore/evented_mongrel   rack/file  

Methods

Public Instance methods

Like Kernel#warn but outputs the location that triggered the warning.

[Source]

    # File lib/sinatra/compat.rb, line 12
12: def sinatra_warn(*message)
13:   line = caller.
14:     detect { |line| line !~ /(?:lib\/sinatra\/|__DELEGATE__)/ }.
15:     sub(/:in .*/, '')
16:   warn "#{line}: warning: #{message.join(' ')}"
17: end

[Validate]