module Railsless
Partially inspired by railties-4.0.0/lib/rails/engine.rb In essence, it’s:
-
Picking a file to look for (eg. config.ru),
-
Starting at an arbitrary directory (eg. the current working directory), and then
-
Traversing back up the directory tree until it either finds a flag file, or hits the root folder.