Method: Hanami.app_path
- Defined in:
- lib/hanami.rb
.app_path(dir = Dir.pwd) ⇒ Pathname?
Finds and returns the absolute path for the Hanami app file (config/app.rb).
Searches within the given directory, then searches upwards through parent directories until the app file can be found.
144 145 146 147 148 149 150 151 152 153 |
# File 'lib/hanami.rb', line 144 def self.app_path(dir = Dir.pwd) dir = Pathname(dir). path = dir.join(APP_PATH) if path.file? path elsif !dir.root? app_path(dir.parent) end end |