Module: Avm::Launcher::Git::Base::ClassMethods
- Included in:
- Avm::Launcher::Git::Base
- Defined in:
- lib/avm/launcher/git/base/class_methods.rb
Instance Method Summary collapse
- #by_root(search_base_path) ⇒ Avm::Launcher::Git::Base
-
#find_root(search_base_path) ⇒ Pathname
Searches the root path for the Git repository which includes
search_base_path
.
Instance Method Details
#by_root(search_base_path) ⇒ Avm::Launcher::Git::Base
9 10 11 |
# File 'lib/avm/launcher/git/base/class_methods.rb', line 9 def by_root(search_base_path) new(find_root(search_base_path).to_path) end |
#find_root(search_base_path) ⇒ Pathname
Searches the root path for the Git repository which includes search_base_path
.
15 16 17 18 19 20 21 22 23 |
# File 'lib/avm/launcher/git/base/class_methods.rb', line 15 def find_root(search_base_path) path = search_base_path.to_pathname. loop do return path if path.join('.git').exist? raise "\".git\" not found for \"#{search_base_path}\"" if path.parent.root? path = path.parent end end |