Skip to content

Commit

Permalink
Kernel.load $0 breaks when $0 is not the file with sinatra routes, ad…
Browse files Browse the repository at this point in the history
…d an :app_file option to define which file to reload
  • Loading branch information
cschneid committed May 18, 2008
1 parent 3588b55 commit 174d9c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/sinatra.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,8 @@ def self.default_options
:views => root + '/views',
:public => root + '/public',
:sessions => false,
:logging => true
:logging => true,
:app_file => $0
}
end

Expand Down Expand Up @@ -932,7 +933,7 @@ def reload!
@reloading = true
clearables.each(&:clear)
load_default_events!
Kernel.load $0
Kernel.load Sinatra.options.app_file
@reloading = false
Environment.setup!
end
Expand Down

0 comments on commit 174d9c8

Please sign in to comment.