Sha256: 40ccdde9c76ae9c47b5e9a8d35891ae4ca40db409114e803da0cab731c4c5484

Contents?: true

Size: 997 Bytes

Versions: 2

Compression:

Stored size: 997 Bytes

Contents

require 'cocoapods'

module Pod
  class TagUtil
    # attr_accessor :test
    # def initialize(test)
    #   @test = test
    # end

    # tag 是否存在
    def self.exist_tag(tag)
      tag_string = `git tag -l`
      tag_list = tag_string.to_s.split("\n")
      tag_list.include?(tag)
    end

    def self.git_delete_tag(tag)
      `git tag -d #{tag}`
      `git push origin :refs/tags/#{tag}`
    end

    # tag 是否存在符合格式的分支
    def self.exist_branch
      branch_name = `git symbolic-ref --short -q HEAD`
      UI.puts("current branch: #{branch_name}")
      if branch_name =~ /release_[0-9].[0-9].[0-9]/ || branch_name.to_s.strip == "master"
        return true
      end
      false
    end

    def self.check_branch_include_tag(tag)
      branch_name = `git symbolic-ref --short -q HEAD`
      if branch_name.to_s.strip == "master"
        return true
      end
      if branch_name.include?(tag.to_s)
        return true
      end
      false
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cocoapods-hd-0.0.4 lib/cocoapods-hd/tag_util.rb
cocoapods-hd-0.0.3 lib/cocoapods-hd/tag_util.rb