class Pod::TagUtil
Public Class Methods
check_branch_include_tag(tag)
click to toggle source
# File lib/cocoapods-hd/tag_util.rb, line 36 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
check_master_branch()
click to toggle source
tag 是否存在符合格式的分支
# File lib/cocoapods-hd/tag_util.rb, line 19 def self.check_master_branch branch_name = `git symbolic-ref --short -q HEAD` UI.puts("current branch: #{branch_name}") if branch_name.to_s.strip == "master" return true end false end
exist_tag(tag)
click to toggle source
tag 是否存在
# File lib/cocoapods-hd/tag_util.rb, line 7 def self.exist_tag(tag) tag_string = `git tag -l` tag_list = tag_string.to_s.split("\n") tag_list.include?(tag) end
git_delete_tag(tag)
click to toggle source
# File lib/cocoapods-hd/tag_util.rb, line 13 def self.git_delete_tag(tag) `git tag -d #{tag}` `git push origin :refs/tags/#{tag}` end
upload_origin_sources(commit_desc)
click to toggle source
上传Sources
# File lib/cocoapods-hd/tag_util.rb, line 29 def self.upload_origin_sources(commit_desc) `git status -s` `git add .` `git commit -m '#{commit_desc}'` `git push origin master` end