Class: RubyGit::Status::Report
- Inherits:
-
Object
- Object
- RubyGit::Status::Report
- Defined in:
- lib/ruby_git/status/report.rb
Overview
Represents a full git status report
Instance Attribute Summary collapse
-
#branch ⇒ RubyGit::Status::BranchInfo?
readonly
Information about the current git branch.
-
#entries ⇒ Array<RubyGit::Status::Entry>
readonly
All entries in the git status.
-
#stash ⇒ RubyGit::Status::Stash?
readonly
Information about git stash if available.
Instance Method Summary collapse
-
#fully_staged ⇒ Array<UntrackedEntry, OrdinaryEntry, RenamedEntry>
The entries that have staged changes and no unstaged changes.
-
#ignored ⇒ Array<IgnoredEntry>
The entries that are ignored.
-
#initialize(branch, stash, entries) ⇒ Report
constructor
Initialize a new status report.
-
#merge_conflict? ⇒ Boolean
Are there any unmerged entries?.
-
#staged ⇒ Array<UntrackedEntry, OrdinaryEntry, RenamedEntry>
The entries that have staged changes.
-
#unmerged ⇒ Array<UnmergedEntry>
The entries that represent merge conflicts.
-
#unstaged ⇒ Array<UntrackedEntry, OrdinaryEntry, RenamedEntry>
The entries that have unstaged changes.
-
#untracked ⇒ Array<UntrackedEntry>
The entries that are untracked.
Constructor Details
#initialize(branch, stash, entries) ⇒ Report
Initialize a new status report
58 59 60 61 62 |
# File 'lib/ruby_git/status/report.rb', line 58 def initialize(branch, stash, entries) @branch = branch @stash = stash @entries = entries end |
Instance Attribute Details
#branch ⇒ RubyGit::Status::BranchInfo? (readonly)
Information about the current git branch
19 20 21 |
# File 'lib/ruby_git/status/report.rb', line 19 def branch @branch end |
#entries ⇒ Array<RubyGit::Status::Entry> (readonly)
All entries in the git status
43 44 45 |
# File 'lib/ruby_git/status/report.rb', line 43 def entries @entries end |
#stash ⇒ RubyGit::Status::Stash? (readonly)
Information about git stash if available
31 32 33 |
# File 'lib/ruby_git/status/report.rb', line 31 def stash @stash end |
Instance Method Details
#fully_staged ⇒ Array<UntrackedEntry, OrdinaryEntry, RenamedEntry>
The entries that have staged changes and no unstaged changes
115 116 117 |
# File 'lib/ruby_git/status/report.rb', line 115 def fully_staged entries.select(&:fully_staged?) end |
#ignored ⇒ Array<IgnoredEntry>
The entries that are ignored
71 72 73 |
# File 'lib/ruby_git/status/report.rb', line 71 def ignored entries.select(&:ignored?) end |
#merge_conflict? ⇒ Boolean
Are there any unmerged entries?
138 139 140 |
# File 'lib/ruby_git/status/report.rb', line 138 def merge_conflict? unmerged.any? end |
#staged ⇒ Array<UntrackedEntry, OrdinaryEntry, RenamedEntry>
The entries that have staged changes
104 105 106 |
# File 'lib/ruby_git/status/report.rb', line 104 def staged entries.select(&:staged?) end |
#unmerged ⇒ Array<UnmergedEntry>
The entries that represent merge conflicts
127 128 129 |
# File 'lib/ruby_git/status/report.rb', line 127 def unmerged entries.select(&:unmerged?) end |
#unstaged ⇒ Array<UntrackedEntry, OrdinaryEntry, RenamedEntry>
The entries that have unstaged changes
93 94 95 |
# File 'lib/ruby_git/status/report.rb', line 93 def unstaged entries.select(&:unstaged?) end |
#untracked ⇒ Array<UntrackedEntry>
The entries that are untracked
82 83 84 |
# File 'lib/ruby_git/status/report.rb', line 82 def untracked entries.select(&:untracked?) end |