class Gitlab::Dangerfiles::Changes
Public Instance Methods
Return an Gitlab::Dangerfiles::Changes
object with only the changes for the added files.
@return [Gitlab::Dangerfiles::Changes]
# File lib/gitlab/dangerfiles/changes.rb, line 20 def added select_by_change_type(:added) end
@param category [Symbol] a category of change.
@return [Gitlab::Dangerfiles::Changes] changes for the given category
.
# File lib/gitlab/dangerfiles/changes.rb, line 54 def by_category(category) Changes.new(select { |change| change.category == category }) end
@return [Array<Symbol>] an array of the unique categories of changes.
# File lib/gitlab/dangerfiles/changes.rb, line 59 def categories map(&:category).uniq end
@return [Gitlab::Dangerfiles::Changes] the changes for the deleted files.
# File lib/gitlab/dangerfiles/changes.rb, line 30 def deleted select_by_change_type(:deleted) end
@return [Array<String>] an array of the changed files.
# File lib/gitlab/dangerfiles/changes.rb, line 64 def files map(&:file) end
@param category [Symbol] A category of change.
@return [Boolean] whether there are any change for the given category
.
# File lib/gitlab/dangerfiles/changes.rb, line 47 def has_category?(category) any? { |change| change.category == category } end
@return [Gitlab::Dangerfiles::Changes] the changes for the modified files.
# File lib/gitlab/dangerfiles/changes.rb, line 25 def modified select_by_change_type(:modified) end
@return [Gitlab::Dangerfiles::Changes] the changes for the renamed files (after the rename).
# File lib/gitlab/dangerfiles/changes.rb, line 40 def renamed_after select_by_change_type(:renamed_after) end
@return [Gitlab::Dangerfiles::Changes] the changes for the renamed files (before the rename).
# File lib/gitlab/dangerfiles/changes.rb, line 35 def renamed_before select_by_change_type(:renamed_before) end
Private Instance Methods
# File lib/gitlab/dangerfiles/changes.rb, line 70 def select_by_change_type(change_type) Changes.new(select { |change| change.change_type == change_type }) end