Sha256: a83ff48753cb3edfe90e968b5c8634733a4c13073bac37d45c94c5c5eeb558b7

Contents?: true

Size: 730 Bytes

Versions: 9

Compression:

Stored size: 730 Bytes

Contents

# -*- encoding : utf-8 -*-

module Cardio
  module Version
    class << self
      CARD_MINOR = { 0 => 90, 1 => 1000 }.freeze # can remove and hardcode after 1.0

      def release
        @version ||= File.read(File.expand_path("../../VERSION", __dir__)).strip
      end

      def card_release
        @card_release ||= [1, minor, point, pre].compact.map(&:to_s).join "."
      end

      private

      def bits
        release.split(".").map do |bit|
          bit.match?(/^\d/) ? bit.to_i : bit
        end
      end

      def major
        bits[0]
      end

      def minor
        CARD_MINOR[major] + bits[1]
      end

      def point
        bits[2]
      end

      def pre
        bits[3]
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
card-1.108.1 lib/cardio/version.rb
card-1.108.0 lib/cardio/version.rb
card-1.107.0 lib/cardio/version.rb
card-1.106.0 lib/cardio/version.rb
card-1.105.6 lib/cardio/version.rb
card-1.105.5 lib/cardio/version.rb
card-1.105.4 lib/cardio/version.rb
card-1.105.3 lib/cardio/version.rb
card-1.105.2.pre1 lib/cardio/version.rb