lib/rulebow/runner.rb
# Locate project root. This method ascends up the file system starting
# as the current working directory looking for a `Rulebook` file.
# When found, the directory in which it is found is returned as the root.
Locate project root. This method ascends up the file system starting
as the current working directory looking for a `Rulebook` file.
When found, the directory in which it is found is returned as the root.
Locate project root . This method ascends up the file system starting as the current working directory looking for a ` Rulebook ` file . When found the directory in which it is found is returned as the root .
def locate_root
      d = Dir.pwd
      while d != home && d != '/'
        f = Dir.glob(File.join(d, RULEBOOK_GLOB)).first
        if f
          @root = d
          break
        end
        d = File.dirname(d)
      end
      raise(RootError, "cannot locate project root") unless @root
      @root
    end
def locate_root d = Dir . pwd while d != home && d != '/' f = Dir . glob ( File . join ( d , RULEBOOK_GLOB ) ) . first if f @root = d break end d = File . dirname ( d ) end raise ( RootError , "cannot locate project root" ) unless @root @root end
Locate project root.
Locate project root .