Class: Sturdy::Repo
- Inherits:
-
Object
- Object
- Sturdy::Repo
- Defined in:
- lib/sturdy/repo.rb
Instance Method Summary collapse
-
#initialize(repo_path) ⇒ Repo
constructor
Initialize a new Sturdy for a git repository.
Constructor Details
#initialize(repo_path) ⇒ Repo
Initialize a new Sturdy for a git repository
7 8 9 10 11 12 13 14 15 |
# File 'lib/sturdy/repo.rb', line 7 def initialize(repo_path) @repo_path = repo_path begin @repo = Rugged::Repository.new @repo_path rescue Rugged::RepositoryError raise Sturdy::RepositoryError.new @repo_path end raise Sturdy::EmptyRepositoryError.new @repo_path if @repo.empty? end |