Class: Gem::Release::Version::Number
- Inherits:
-
Struct
- Object
- Struct
- Gem::Release::Version::Number
- Defined in:
- lib/gem/release/version/number.rb
Constant Summary collapse
- NUMBER =
/^(\d+)\.?(\d+)?\.?(\d+)?(\-|\.)?(\w+)?\.?(\d+)?$/
- PRE_RELEASE =
/^(\d+)\.(\d+)\.(\d+)\.?(.*)(\d+)$/
- STAGES =
%i(alpha beta pre rc)
Instance Attribute Summary collapse
-
#number ⇒ Object
Returns the value of attribute number.
-
#target ⇒ Object
writeonly
Sets the attribute target.
Instance Method Summary collapse
Instance Attribute Details
#number ⇒ Object
Returns the value of attribute number
4 5 6 |
# File 'lib/gem/release/version/number.rb', line 4 def number @number end |
#target=(value) ⇒ Object
Sets the attribute target
4 5 6 |
# File 'lib/gem/release/version/number.rb', line 4 def target=(value) @target = value end |
Instance Method Details
#bump ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/gem/release/version/number.rb', line 10 def bump return target if specific? validate_stage parts = [[major, minor, patch].compact.join('.')] parts << [stage, num].join('.') if stage parts.join(stage_delim) end |
#pre? ⇒ Boolean
18 19 20 |
# File 'lib/gem/release/version/number.rb', line 18 def pre? !!parts[4] end |