Path: | lib/sinatra/compat.rb |
Last Update: | Mon Mar 09 16:13:03 -0600 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.
Like Kernel#warn but outputs the location that triggered the warning.
# 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