make the reloader work on 1.8 and jRuby

This commit is contained in:
Gabriel Andretta 2011-04-15 18:08:11 -03:00
parent 2b2c0764dd
commit 22a8c8569f
3 changed files with 19 additions and 9 deletions

View File

@ -1,2 +1,8 @@
source "http://rubygems.org" unless ENV['QUICK']
gemspec
group :development, :test do
platform :ruby_18, :jruby do
gem 'json'
end
end

View File

@ -15,6 +15,8 @@ GEM
erubis (2.6.6)
abstract (>= 1.0.0)
haml (3.0.25)
json (1.5.1)
json (1.5.1-java)
rack (1.2.2)
rack-test (0.5.7)
rack (>= 1.0)
@ -37,11 +39,13 @@ GEM
tilt (1.2.2)
PLATFORMS
java
ruby
DEPENDENCIES
erubis
haml
json
rake
rspec (~> 2.3)
sinatra-contrib!

View File

@ -179,15 +179,15 @@ module Sinatra
# defined route.
def route(verb, path, options={}, &block)
source_location = block.respond_to?(:source_location) ?
block.source_location.first : caller_files.first
super.tap do |signature|
Watcher::List.for(self).watch_route Route.new(
:app => self,
:source_location => source_location,
:verb => verb,
:signature => signature
)
end
block.source_location.first : caller_files[1]
signature = super
Watcher::List.for(self).watch_route Route.new(
:app => self,
:source_location => source_location,
:verb => verb,
:signature => signature
)
signature
end
# Does everything Sinatra::Base#inline_templates= does, but it