Module: MultiGit::Backend

Included in:
GitBackend, JGitBackend, RuggedBackend
Defined in:
lib/multi_git/backend.rb

Overview

Backend is an abstract base class for all other Backends.

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Tests whether this backend is available.

Returns:

  • (Boolean)


54
55
56
57
# File 'lib/multi_git/backend.rb', line 54

def available?
  check!
  @failed.nil?
end

#load!Object

This method is abstract.

This method implements loading the backend files.

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/multi_git/backend.rb', line 37

def load!
  raise NotImplementedError, "Please implement #load! for #{self}"
end

#open(directory, options = {}) ⇒ Repository

Opens a git repository.

Parameters:

  • directory (String)
  • options (Hash) (defaults to: {})

Options Hash (options):

  • :init (Boolean)

    if true the repository is automatically created (defaults to: false)

  • :bare (Boolean)

    if true the repository is expected to be bare

Returns:



48
49
50
51
# File 'lib/multi_git/backend.rb', line 48

def open(directory, options = {})
  load!
  open(directory, options)
end