Class: RubyGit::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_git/repository.rb

Overview

The repository is the database of all the objects, refs, and other data that make up the history of a project.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository_path) ⇒ Repository

Create a new Repository object with the given repository path

Examples:

RubyGit::Repository.new('/path/to/repository') #=> #<RubyGit::Repository ...>

Parameters:

  • repository_path (String)

    the path to the repository

    The purpose of this flag is to allow tests to not have to mock the normalization of the path. This allows testing that the right git command is contructed based on the options passed any particular method.

Raises:



35
36
37
# File 'lib/ruby_git/repository.rb', line 35

def initialize(repository_path)
  @path = normalize_path(repository_path)
end

Instance Attribute Details

#pathString (readonly)

The absolute path to the repository

Examples:

repository = RubyGit::Repository.new('.git')
repository.path = '/absolute/path/.git'

Returns:

  • (String)


20
21
22
# File 'lib/ruby_git/repository.rb', line 20

def path
  @path
end