Sha256: 0ab14759af37bc842b4b93a53e9457b6ec52d1b83d5abe3ec1afc3e455357bf9

Contents?: true

Size: 583 Bytes

Versions: 1

Compression:

Stored size: 583 Bytes

Contents

module YSI
  class Tag < Assertion
    def display_name
      "tag"
    end

    def tag
      "v#{@engine.version}"
    end

    def check
      `git tag`.each_line do |line|
        if line.chomp == tag
          `git show #{tag}`.each_line do |show_line|
            if show_line =~ /Date:\s+(.*)/
              @engine.tag_date = $1
            end
          end
          return tag
        end
      end
      return nil
    end

    def assert(dry_run: false)
      if !dry_run
        `git tag -a #{tag} -m "Version #{@engine.version}"`
      end
      tag
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yes_ship_it-0.0.1 assertions/tag.rb