Class: Bump::BumpInfo
- Inherits:
-
Object
- Object
- Bump::BumpInfo
- Defined in:
- lib/bump/domain/bump_info.rb
Overview
The bump information model
Instance Method Summary collapse
-
#afterVersion ⇒ String
Returns the version number after the bumping.
-
#beforeVersion ⇒ String
Returns the version number before the bumping.
-
#bump(level) ⇒ void
Performs bumping version.
-
#check ⇒ Boolean
Checks the all the version patterns are available.
-
#createUpdateRules ⇒ Array<Bump::FileUpdateRule>
Creates file update rules according to the current settings.
-
#files ⇒ Array
Returns files setting list.
-
#initialize(version, files) ⇒ BumpInfo
constructor
A new instance of BumpInfo.
-
#performUpdate ⇒ void
Performs all updates.
-
#setPreid(preid) ⇒ void
Sets the preid.
-
#updateRules ⇒ Array<Bump::FileUpdateRules>
Gets the file update rules.
-
#version ⇒ Bump::VersionNumber
Returns the version number object.
Constructor Details
#initialize(version, files) ⇒ BumpInfo
Returns a new instance of BumpInfo.
11 12 13 14 15 16 17 18 |
# File 'lib/bump/domain/bump_info.rb', line 11 def initialize version, files @version = version @files = files @before_version = @version.to_s @after_version = @version.to_s end |
Instance Method Details
#afterVersion ⇒ String
Returns the version number after the bumping.
101 102 103 |
# File 'lib/bump/domain/bump_info.rb', line 101 def afterVersion @after_version end |
#beforeVersion ⇒ String
Returns the version number before the bumping.
108 109 110 |
# File 'lib/bump/domain/bump_info.rb', line 108 def beforeVersion @before_version end |
#bump(level) ⇒ void
This method returns an undefined value.
Performs bumping version
38 39 40 41 |
# File 'lib/bump/domain/bump_info.rb', line 38 def bump level @version.bump level @after_version = @version.to_s end |
#check ⇒ Boolean
Checks the all the version patterns are available
84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/bump/domain/bump_info.rb', line 84 def check createUpdateRules.each do |rule| if not rule.patternExists return false end end return true end |
#createUpdateRules ⇒ Array<Bump::FileUpdateRule>
Creates file update rules according to the current settings.
62 63 64 65 66 |
# File 'lib/bump/domain/bump_info.rb', line 62 def createUpdateRules @files.map { |file, pattern| FileUpdateRuleFactory.create(file, pattern, @before_version, @after_version) }.flatten end |
#files ⇒ Array
Returns files setting list
30 31 32 |
# File 'lib/bump/domain/bump_info.rb', line 30 def files @files end |
#performUpdate ⇒ void
This method returns an undefined value.
Performs all updates.
71 72 73 74 75 76 77 78 79 |
# File 'lib/bump/domain/bump_info.rb', line 71 def performUpdate createUpdateRules.each do |rule| rule.perform end end |
#setPreid(preid) ⇒ void
This method returns an undefined value.
Sets the preid
46 47 48 49 |
# File 'lib/bump/domain/bump_info.rb', line 46 def setPreid preid @version.setPreid preid @after_version = @version.to_s end |
#updateRules ⇒ Array<Bump::FileUpdateRules>
Gets the file update rules
54 55 56 |
# File 'lib/bump/domain/bump_info.rb', line 54 def updateRules createUpdateRules end |
#version ⇒ Bump::VersionNumber
Returns the version number object
23 24 25 |
# File 'lib/bump/domain/bump_info.rb', line 23 def version @version end |