Class: Sturdy::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/sturdy/repo.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo_path) ⇒ Repo

Initialize a new Sturdy for a git repository

Parameters:

  • repo_path (String)

    Path of 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