Skip to content

Commit

Permalink
expand_path to compare the main script with the app_file
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Sep 19, 2011
1 parent 2d85b04 commit dd48e93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinatra/main.rb
Expand Up @@ -8,7 +8,7 @@ class Application < Base
# on this path by default.
set :app_file, caller_files.first || $0

set :run, Proc.new { $0 == app_file }
set :run, Proc.new { File.expand_path($0) == File.expand_path(app_file) }

if run? && ARGV.any?
require 'optparse'
Expand Down

0 comments on commit dd48e93

Please sign in to comment.