Class: Changelogger::RepoInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/changelogger/repo_info.rb

Overview

Changelogger::RepoInfo holds metadata about the current repository.

Instance Attribute Summary collapse

Instance Attribute Details

#branchString

Returns HEAD branch or “(detached)”.

Returns:

  • (String)

    HEAD branch or “(detached)”



20
# File 'lib/changelogger/repo_info.rb', line 20

RepoInfo = Struct.new(:name, :path, :branch, :head_short, :remote, :remote_slug, :dirty, keyword_init: true)

#dirtyBoolean

Returns true if there are uncommitted changes.

Returns:

  • (Boolean)

    true if there are uncommitted changes



20
# File 'lib/changelogger/repo_info.rb', line 20

RepoInfo = Struct.new(:name, :path, :branch, :head_short, :remote, :remote_slug, :dirty, keyword_init: true)

#head_shortString

Returns abbreviated HEAD sha.

Returns:

  • (String)

    abbreviated HEAD sha



20
# File 'lib/changelogger/repo_info.rb', line 20

RepoInfo = Struct.new(:name, :path, :branch, :head_short, :remote, :remote_slug, :dirty, keyword_init: true)

#nameString

Returns repo name (directory name).

Returns:

  • (String)

    repo name (directory name)



20
# File 'lib/changelogger/repo_info.rb', line 20

RepoInfo = Struct.new(:name, :path, :branch, :head_short, :remote, :remote_slug, :dirty, keyword_init: true)

#pathString

Returns absolute repo root path.

Returns:

  • (String)

    absolute repo root path



20
# File 'lib/changelogger/repo_info.rb', line 20

RepoInfo = Struct.new(:name, :path, :branch, :head_short, :remote, :remote_slug, :dirty, keyword_init: true)

#remoteString

Returns remote.origin.url (may be empty).

Returns:

  • (String)

    remote.origin.url (may be empty)



20
# File 'lib/changelogger/repo_info.rb', line 20

RepoInfo = Struct.new(:name, :path, :branch, :head_short, :remote, :remote_slug, :dirty, keyword_init: true)

#remote_slugString?

Returns “owner/repo” for GitHub remotes, otherwise nil.

Returns:

  • (String, nil)

    “owner/repo” for GitHub remotes, otherwise nil



20
# File 'lib/changelogger/repo_info.rb', line 20

RepoInfo = Struct.new(:name, :path, :branch, :head_short, :remote, :remote_slug, :dirty, keyword_init: true)