Permalink
Browse files

run Sinatra apps directly (i.e., without rackup file)

  • Loading branch information...
rtomayko committed Feb 21, 2009
1 parent 6385c6f commit bcf9154254a672c06af06a8fda04cb976787d694
Showing with 20 additions and 5 deletions.
  1. +14 −4 README
  2. +6 −1 lib/shotgun.rb
View
18 README
@@ -26,11 +26,21 @@ Using Thin and starting on port 6000 instead of 9393 (default):
shotgun --server=thin --port=6000 config.ru
+Running Sinatra apps:
+
+ shotgun hello.rb
+
See 'shotgun --help' for more advanced usage.
-More
-----
+Links
+-----
+
+Shotgun: http://github.com/rtomayko/shotgun
+Rack: http://rack.rubyforge.org/
+Sinatra: http://www.sinatrarb.com/
+
+The reloading system in Ian Bicking's webware framework served as inspiration
+for the approach taken in Shotgun. Ian lays down the pros and cons of this
+approach in the following article:
-http://github.com/rtomayko/shotgun
-http://rack.rubyforge.org/
http://ianbicking.org/docs/Webware_reload.html
View
@@ -64,7 +64,12 @@ def inner_app
eval "Rack::Builder.new {( #{config}\n )}.to_app", nil, rackup_file
else
require rackup_file
- Object.const_get(File.basename(rackup_file, '.rb').capitalize)
+ if defined? Sinatra::Application
+ Sinatra::Application.set :reload, false
+ Sinatra::Application
+ else
+ Object.const_get(File.basename(rackup_file, '.rb').capitalize)
+ end
end
end

0 comments on commit bcf9154

Please sign in to comment.