Class: Sherpa::Git::Repo
- Inherits:
-
Object
- Object
- Sherpa::Git::Repo
- Defined in:
- lib/sherpa/git/repo.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path:) ⇒ Repo
constructor
A new instance of Repo.
- #name ⇒ Object
Constructor Details
#initialize(path:) ⇒ Repo
Returns a new instance of Repo.
6 7 8 |
# File 'lib/sherpa/git/repo.rb', line 6 def initialize(path:) @path = path end |
Class Method Details
.find ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/sherpa/git/repo.rb', line 10 def self.find stdout, stderr, status = Open3.capture3("git rev-parse --show-toplevel") if status.success? new(path: stdout.chomp) end end |
Instance Method Details
#name ⇒ Object
18 19 20 |
# File 'lib/sherpa/git/repo.rb', line 18 def name path.split("/").slice(0..-1).last end |