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



29
30
31
# File 'lib/ruby_git/repository.rb', line 29

def initialize(repository_path)
  @path = File.realpath(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