Class: Gemspec::VersionDiff

Inherits:
Object
  • Object
show all
Defined in:
lib/gemspec/bump.rb

Constant Summary collapse

IllegalFormat =
Class.new(ArgumentError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ VersionDiff

Returns a new instance of VersionDiff.

Raises:



44
45
46
47
# File 'lib/gemspec/bump.rb', line 44

def initialize(string)
  @data = string.split('.')
  raise IllegalFormat, string unless @data.all? {|item| item =~ /^(\+|\-)?\d*$/ }
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



42
43
44
# File 'lib/gemspec/bump.rb', line 42

def data
  @data
end