Class: RepoTender::SCM::Status
- Inherits:
-
Data
- Object
- Data
- RepoTender::SCM::Status
- Defined in:
- lib/repo_tender/scm/status.rb
Overview
Value object produced by parsing ‘git status –porcelain=v2 –branch –untracked-files=normal`. v2 is mandatory (per AGENTS.md gotcha) so submodule state and rename detection are stable.
A working tree is “clean” iff the only porcelain-v2 lines are the ‘# branch.*` header lines. Any `1`/`2`/`u`/`?`/`!` line is dirty.
Instance Attribute Summary collapse
-
#ahead ⇒ Object
readonly
Returns the value of attribute ahead.
-
#behind ⇒ Object
readonly
Returns the value of attribute behind.
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#clean ⇒ Object
readonly
Returns the value of attribute clean.
-
#detached ⇒ Object
readonly
Returns the value of attribute detached.
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#unborn ⇒ Object
readonly
Returns the value of attribute unborn.
-
#upstream ⇒ Object
readonly
Returns the value of attribute upstream.
Instance Method Summary collapse
- #clean? ⇒ Boolean
- #detached? ⇒ Boolean
-
#initialize(clean:, branch: nil, upstream: nil, ahead: 0, behind: 0, detached: false, entries: [], unborn: false) ⇒ Status
constructor
A new instance of Status.
- #unborn? ⇒ Boolean
Constructor Details
#initialize(clean:, branch: nil, upstream: nil, ahead: 0, behind: 0, detached: false, entries: [], unborn: false) ⇒ Status
Returns a new instance of Status.
13 14 15 |
# File 'lib/repo_tender/scm/status.rb', line 13 def initialize(clean:, branch: nil, upstream: nil, ahead: 0, behind: 0, detached: false, entries: [], unborn: false) super end |
Instance Attribute Details
#ahead ⇒ Object (readonly)
Returns the value of attribute ahead
12 13 14 |
# File 'lib/repo_tender/scm/status.rb', line 12 def ahead @ahead end |
#behind ⇒ Object (readonly)
Returns the value of attribute behind
12 13 14 |
# File 'lib/repo_tender/scm/status.rb', line 12 def behind @behind end |
#branch ⇒ Object (readonly)
Returns the value of attribute branch
12 13 14 |
# File 'lib/repo_tender/scm/status.rb', line 12 def branch @branch end |
#clean ⇒ Object (readonly)
Returns the value of attribute clean
12 13 14 |
# File 'lib/repo_tender/scm/status.rb', line 12 def clean @clean end |
#detached ⇒ Object (readonly)
Returns the value of attribute detached
12 13 14 |
# File 'lib/repo_tender/scm/status.rb', line 12 def detached @detached end |
#entries ⇒ Object (readonly)
Returns the value of attribute entries
12 13 14 |
# File 'lib/repo_tender/scm/status.rb', line 12 def entries @entries end |
#unborn ⇒ Object (readonly)
Returns the value of attribute unborn
12 13 14 |
# File 'lib/repo_tender/scm/status.rb', line 12 def unborn @unborn end |
#upstream ⇒ Object (readonly)
Returns the value of attribute upstream
12 13 14 |
# File 'lib/repo_tender/scm/status.rb', line 12 def upstream @upstream end |
Instance Method Details
#clean? ⇒ Boolean
17 |
# File 'lib/repo_tender/scm/status.rb', line 17 def clean? = clean |
#detached? ⇒ Boolean
19 |
# File 'lib/repo_tender/scm/status.rb', line 19 def detached? = detached |
#unborn? ⇒ Boolean
21 |
# File 'lib/repo_tender/scm/status.rb', line 21 def unborn? = unborn |