Class: Juli::Util::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/juli/util.rb

Overview

find juli-repository root from the specified path.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = '.') ⇒ Repo

Returns a new instance of Repo.



107
108
109
110
111
112
113
114
115
116
# File 'lib/juli/util.rb', line 107

def initialize(path = '.')
  Pathname.new(path).realpath.ascend do |p|
    p_str = File.join(p, Juli::REPO)
    if File.directory?(p_str)
      @juli_repo = p
      return
    end
  end
  raise "cannot find juli repository root."
end

Instance Attribute Details

#juli_repoObject (readonly)

Returns the value of attribute juli_repo.



105
106
107
# File 'lib/juli/util.rb', line 105

def juli_repo
  @juli_repo
end