Sha256: aa5e6e349c891ad1e83268b982f405c5c759f9f2f2e43b1eb7f4b8a67bd7414b

Contents?: true

Size: 607 Bytes

Versions: 8

Compression:

Stored size: 607 Bytes

Contents

require 'sem_version'

module Incr
  module Service
    class Version
      def self.increment_segment(version, segment)
        incremented_version = version.clone

        case segment
        when 'major'
          incremented_version.major = version.major + 1
          incremented_version.minor = 0
          incremented_version.patch = 0
        when 'minor'
          incremented_version.minor = version.minor + 1
          incremented_version.patch = 0
        when 'patch'
          incremented_version.patch = version.patch + 1
        end

        incremented_version
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
incr-1.0.0 lib/incr/service/version.rb
incr-0.7.1 lib/incr/service/version.rb
incr-0.7.0 lib/incr/service/version.rb
incr-0.6.0 lib/incr/service/version.rb
incr-0.5.0 lib/incr/service/version.rb
incr-0.4.0 lib/incr/service/version.rb
incr-0.3.0 lib/incr/service/version.rb
incr-0.2.0 lib/incr/service/version.rb