Class: StiDeploy::Version::VersionBumper
- Inherits:
-
Object
- Object
- StiDeploy::Version::VersionBumper
- Defined in:
- lib/sti_deploy/version/version_bumper.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
-
.from_deploy_type(deploy_type, version) ⇒ Object
We use eval here because the only possible strings that will be evaluated live in a hardcoded hash inside StiDeploy::DeployType.
Instance Method Summary collapse
- #bump ⇒ Object
-
#initialize(version) ⇒ VersionBumper
constructor
rubocop:enable Security/Eval.
Constructor Details
#initialize(version) ⇒ VersionBumper
rubocop:enable Security/Eval
17 18 19 |
# File 'lib/sti_deploy/version/version_bumper.rb', line 17 def initialize(version) @version = version end |
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/sti_deploy/version/version_bumper.rb', line 4 def version @version end |
Class Method Details
.from_deploy_type(deploy_type, version) ⇒ Object
We use eval here because the only possible strings that will be evaluated live in a hardcoded hash inside StiDeploy::DeployType.
rubocop:disable Security/Eval
10 11 12 13 14 |
# File 'lib/sti_deploy/version/version_bumper.rb', line 10 def self.from_deploy_type(deploy_type, version) class_name = deploy_type.to_s.split('_').map(&:capitalize).join klass = eval("StiDeploy::Version::#{class_name}") klass.new(version) end |
Instance Method Details
#bump ⇒ Object
21 |
# File 'lib/sti_deploy/version/version_bumper.rb', line 21 def bump; end |