Class: Juli::Util::Repo
- Inherits:
-
Object
- Object
- Juli::Util::Repo
- Defined in:
- lib/juli/util.rb
Overview
find juli-repository root from the specified path.
Instance Attribute Summary collapse
-
#juli_repo ⇒ Object
readonly
Returns the value of attribute juli_repo.
Instance Method Summary collapse
-
#initialize(path = '.') ⇒ Repo
constructor
A new instance of Repo.
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_repo ⇒ Object (readonly)
Returns the value of attribute juli_repo.
105 106 107 |
# File 'lib/juli/util.rb', line 105 def juli_repo @juli_repo end |