Class: Gitlab::Git::Changes
- Inherits:
-
Object
- Object
- Gitlab::Git::Changes
- Includes:
- Enumerable
- Defined in:
- lib/gitlab/git/changes.rb
Instance Attribute Summary collapse
-
#repository_data ⇒ Object
readonly
Returns the value of attribute repository_data.
Instance Method Summary collapse
- #add_branch_change(change) ⇒ Object
- #add_tag_change(change) ⇒ Object
- #branch_changes ⇒ Object
- #each ⇒ Object
- #includes_branches? ⇒ Boolean
- #includes_tags? ⇒ Boolean
-
#initialize ⇒ Changes
constructor
A new instance of Changes.
- #refs ⇒ Object
- #tag_changes ⇒ Object
Constructor Details
#initialize ⇒ Changes
Returns a new instance of Changes.
10 11 12 13 14 15 16 |
# File 'lib/gitlab/git/changes.rb', line 10 def initialize @refs = Set.new @items = [] @branches_index = [] @tags_index = [] @repository_data = [] end |
Instance Attribute Details
#repository_data ⇒ Object (readonly)
Returns the value of attribute repository_data.
8 9 10 |
# File 'lib/gitlab/git/changes.rb', line 8 def repository_data @repository_data end |
Instance Method Details
#add_branch_change(change) ⇒ Object
26 27 28 29 |
# File 'lib/gitlab/git/changes.rb', line 26 def add_branch_change(change) @branches_index << add_change(change) self end |
#add_tag_change(change) ⇒ Object
31 32 33 34 |
# File 'lib/gitlab/git/changes.rb', line 31 def add_tag_change(change) @tags_index << add_change(change) self end |
#branch_changes ⇒ Object
46 47 48 |
# File 'lib/gitlab/git/changes.rb', line 46 def branch_changes items.values_at(*branches_index) end |
#each ⇒ Object
36 37 38 39 40 |
# File 'lib/gitlab/git/changes.rb', line 36 def each items.each do |item| yield item end end |
#includes_branches? ⇒ Boolean
18 19 20 |
# File 'lib/gitlab/git/changes.rb', line 18 def includes_branches? branches_index.any? end |
#includes_tags? ⇒ Boolean
22 23 24 |
# File 'lib/gitlab/git/changes.rb', line 22 def .any? end |
#refs ⇒ Object
42 43 44 |
# File 'lib/gitlab/git/changes.rb', line 42 def refs @refs.to_a end |
#tag_changes ⇒ Object
50 51 52 |
# File 'lib/gitlab/git/changes.rb', line 50 def tag_changes items.values_at(*) end |