Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
buildgem / lib / buildgem / version / major_version.rb
Size: Mime:
module Buildgem
  class MajorVersion < Version
    def new_version
      current_version.gsub(/(?:\d+\.){2}\d+"/,
                           "#{new_major_version}\"")
    end

    def new_major_version
      v = current_major_version + 1
      "#{v}.0.0"
    end

    def current_major_version
      current_version.match(/"(\d+)\./) { |m|
        m[1]
      }.to_i
    end
  end
end