Using a more accurate root directory
Dir.pwd will not provide a valid directory name when the app is started from any other directory. This prevents monitoring apps (like god) from starting an application without extra configuration.
This commit is contained in:
parent
d7032a0c91
commit
5b3440e251
|
@ -828,13 +828,14 @@ module Sinatra
|
|||
attr_writer :options
|
||||
|
||||
def self.default_options
|
||||
root = File.expand_path(File.dirname($0))
|
||||
@@default_options ||= {
|
||||
:run => true,
|
||||
:port => 4567,
|
||||
:env => :development,
|
||||
:root => Dir.pwd,
|
||||
:views => Dir.pwd + '/views',
|
||||
:public => Dir.pwd + '/public',
|
||||
:root => root,
|
||||
:views => root + '/views',
|
||||
:public => root + '/public',
|
||||
:sessions => false,
|
||||
:logging => true,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue