Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #9 from karouf/master.

Made the remaining specs pass
  • Loading branch information...
commit 28ad4d2b8d0106263331b27c4d77b0742edfe51b 2 parents 714cd8c + 5eb565a
@stouset stouset authored
Showing with 3 additions and 12 deletions.
  1. +3 −12 lib/version.rb
View
15 lib/version.rb
@@ -129,7 +129,10 @@ def bump!(component = -1, pre = false, trim = false)
# mark all but the changed bit as non-prerelease
self[0...component].each(&:unprerelease!)
+ prerelease = self.prerelease?
+
self[component] = self[component].next unless pre and component == -1 and self.prerelease?
+ self[component] = self[component].next if pre and prerelease and component == self.length - 1
self[-1] = self[-1].next(true) if pre
self
end
@@ -212,18 +215,6 @@ def components
def components=(components)
components.each_with_index {|c, i| self[i] = c }
end
-
- def version_bump(index = self.length - 1, trim = false)
- self.components.dup.delete_if { |e| e == self.components[index]}.each {|c| c.unprerelease }
- self.resize!(index + 1) if (trim or index >= self.length)
- self[index] = (self.components[index] || Component.new('0')).next
- end
-
- def prerelease_bump(index)
- if self.components[index] and self.components[index].prerelease?
- self[index] = self.components[index].next!(true)
- end
- end
end
class Version
Please sign in to comment.
Something went wrong with that request. Please try again.