Sha256: 8379e41fe445aee71275b07894e4da9401a2a923f0bc5ccede34b271a0d7fa15

Contents?: true

Size: 528 Bytes

Versions: 3

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true

require 'git'
require_relative '../data/version'

module GFSM
  module Tools
    class CurrentVersionLoader
      def self.load_current_version(repo, initial_version)
        last_tag_name = GFSM::Tools::GitUtilities.extract_last_tag_name(repo)

        return GFSM::Data::Version.new(initial_version) unless last_tag_name

        if last_tag_name.downcase.start_with?("v") 
          last_tag_name.slice!(0)
        end

        GFSM::Data::Version.new(last_tag_name)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gfsm-0.8.0 lib/tools/current_version_loader.rb
gfsm-0.7.0 lib/tools/current_version_loader.rb
gfsm-0.6.0 lib/tools/current_version_loader.rb