lib/solve/version.rb in solve-0.4.1 vs lib/solve/version.rb in solve-0.4.2
- old
+ new
@@ -10,15 +10,15 @@
# @return [Array]
def split(version_string)
case version_string.to_s
when /^(\d+)\.(\d+)\.(\d+)(-([0-9a-z\-\.]+))?(\+([0-9a-z\-\.]+))?$/i
[ $1.to_i, $2.to_i, $3.to_i, $5, $7 ]
- when /^(\d+)\.(\d+)\.(\d+)$/
+ when /^(\d+)\.(\d+)\.(\d+)?$/
[ $1.to_i, $2.to_i, $3.to_i ]
- when /^(\d+)\.(\d+)$/
- [ $1.to_i, $2.to_i, nil ]
+ when /^(\d+)\.(\d+)?$/
+ [ $1.to_i, $2.to_i, 0 ]
when /^(\d+)$/
- [ $1.to_i, nil, nil ]
+ [ $1.to_i, 0, 0 ]
else
raise Errors::InvalidVersionFormat.new(version_string)
end
end
end