Module: RailsAiBridge::Registry::GitRunner

Included in:
DefaultGitRunner
Defined in:
lib/rails_ai_bridge/registry/skill_source_resolver.rb

Overview

Interface for git operations, allowing test injection.

Implementations should provide methods to clone and pull git repositories.

See Also:

Instance Method Summary collapse

Instance Method Details

#checkout_ref(_path, _ref) ⇒ void

This method returns an undefined value.

Checks out a specific git ref inside a local repository directory.

Parameters:

  • _path (String)

    path to the local repository

  • _ref (String)

    branch, tag, or commit SHA to check out

Raises:

  • (StandardError)

    if git checkout fails



40
41
42
# File 'lib/rails_ai_bridge/registry/skill_source_resolver.rb', line 40

def checkout_ref(_path, _ref)
  raise NotImplementedError
end

#clone_repo(_url, _dest) ⇒ void

This method returns an undefined value.

Clones a remote repository to a local directory path.

Parameters:

  • _url (String)

    git repository URL

  • _dest (String)

    destination directory path

Raises:

  • (StandardError)

    if git clone fails



21
22
23
# File 'lib/rails_ai_bridge/registry/skill_source_resolver.rb', line 21

def clone_repo(_url, _dest)
  raise NotImplementedError
end

#current_commit(_path) ⇒ String

Returns the current HEAD commit SHA for the repository at _path.

Parameters:

  • _path (String)

    path to the local repository

Returns:

  • (String)

    40-character hex commit SHA

Raises:

  • (StandardError)

    if the commit cannot be determined



49
50
51
# File 'lib/rails_ai_bridge/registry/skill_source_resolver.rb', line 49

def current_commit(_path)
  raise NotImplementedError
end

#pull_repo(_path) ⇒ void

This method returns an undefined value.

Pulls latest changes inside a local repository directory.

Parameters:

  • _path (String)

    path to the local repository

Raises:

  • (StandardError)

    if git pull fails



30
31
32
# File 'lib/rails_ai_bridge/registry/skill_source_resolver.rb', line 30

def pull_repo(_path)
  raise NotImplementedError
end