Class: GFSM::Data::ChangeType
- Inherits:
-
Object
- Object
- GFSM::Data::ChangeType
- Defined in:
- lib/data/change_type.rb
Instance Attribute Summary collapse
-
#bump_type ⇒ Object
readonly
Returns the value of attribute bump_type.
-
#commits ⇒ Object
readonly
Returns the value of attribute commits.
-
#ignore_on_changelog ⇒ Object
readonly
Returns the value of attribute ignore_on_changelog.
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
- #bump_major? ⇒ Boolean
- #bump_minor? ⇒ Boolean
- #bump_patch? ⇒ Boolean
- #ignore_on_changelog? ⇒ Boolean
-
#initialize(matcher, title, bump_type, priority, ignore_on_changelog) ⇒ ChangeType
constructor
A new instance of ChangeType.
- #to_changelog_entry ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(matcher, title, bump_type, priority, ignore_on_changelog) ⇒ ChangeType
Returns a new instance of ChangeType.
8 9 10 11 12 13 14 15 |
# File 'lib/data/change_type.rb', line 8 def initialize(matcher, title, bump_type, priority, ignore_on_changelog) @matcher = matcher @title = title @bump_type = bump_type @priority = priority @ignore_on_changelog = ignore_on_changelog @commits = [] end |
Instance Attribute Details
#bump_type ⇒ Object (readonly)
Returns the value of attribute bump_type.
6 7 8 |
# File 'lib/data/change_type.rb', line 6 def bump_type @bump_type end |
#commits ⇒ Object (readonly)
Returns the value of attribute commits.
6 7 8 |
# File 'lib/data/change_type.rb', line 6 def commits @commits end |
#ignore_on_changelog ⇒ Object (readonly)
Returns the value of attribute ignore_on_changelog.
6 7 8 |
# File 'lib/data/change_type.rb', line 6 def ignore_on_changelog @ignore_on_changelog end |
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
6 7 8 |
# File 'lib/data/change_type.rb', line 6 def matcher @matcher end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
6 7 8 |
# File 'lib/data/change_type.rb', line 6 def priority @priority end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/data/change_type.rb', line 6 def title @title end |
Class Method Details
.find_highest_bump(change_types) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/data/change_type.rb', line 41 def self.find_highest_bump(change_types) highest_bump = :patch change_types.each do |change_type| if change_type.bump_major? highest_bump = :major # Early exit, it can't go higher than this! break elsif change_type.bump_minor? highest_bump = :minor end end highest_bump end |
Instance Method Details
#bump_major? ⇒ Boolean
17 18 19 |
# File 'lib/data/change_type.rb', line 17 def bump_major? @bump_type == :major end |
#bump_minor? ⇒ Boolean
21 22 23 |
# File 'lib/data/change_type.rb', line 21 def bump_minor? @bump_type == :minor end |
#bump_patch? ⇒ Boolean
25 26 27 |
# File 'lib/data/change_type.rb', line 25 def bump_patch? @bump_type == :patch end |
#ignore_on_changelog? ⇒ Boolean
29 30 31 |
# File 'lib/data/change_type.rb', line 29 def ignore_on_changelog? @ignore_on_changelog end |
#to_changelog_entry ⇒ Object
37 38 39 |
# File 'lib/data/change_type.rb', line 37 def to_changelog_entry "### #{@title}" end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/data/change_type.rb', line 33 def to_s @title end |