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
Public instance methods
sinatra_warn
(*message)
Like Kernel#warn but outputs the location that triggered the warning.
[show 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