Skip to content

Commit

Permalink
use $0 for inline templates if caller_files is empty
Browse files Browse the repository at this point in the history
That way sinatra will at least run if you use a file name matching
CALLERS_TO_IGNORE as the main app_file.
  • Loading branch information
rkh authored and rtomayko committed Apr 2, 2010
1 parent 0f82c74 commit 794437e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ def layout(name=:layout, &block)
# Load embeded templates from the file; uses the caller's __FILE__
# when no file is specified.
def inline_templates=(file=nil)
file = (file.nil? || file == true) ? caller_files.first : file
file = (file.nil? || file == true) ? (caller_files.first || File.expand_path($0)) : file

begin
app, data =
Expand Down

0 comments on commit 794437e

Please sign in to comment.