class SimpleInfo::Tag
Constants
- TAG_NAME
Public Instance Methods
edit()
click to toggle source
# File lib/simple-info/tag.rb, line 5 def edit execute("git tag -f -a #{TAG_NAME} `git log --format=%H | tail -1`") end
pull(remote)
click to toggle source
# File lib/simple-info/tag.rb, line 15 def pull(remote) execute("git fetch #{remote} tag #{TAG_NAME}") end
push(remote)
click to toggle source
# File lib/simple-info/tag.rb, line 19 def push(remote) execute("git push --force #{remote} refs/tags/#{TAG_NAME}:refs/tags/#{TAG_NAME}") end
show()
click to toggle source
# File lib/simple-info/tag.rb, line 9 def show return '' unless info_tag_exists? execute("git cat-file tag #{TAG_NAME}").split("\n\n")[1].strip end
Private Instance Methods
execute(command)
click to toggle source
# File lib/simple-info/tag.rb, line 30 def execute(command) command.include?('-a') ? Kernel.system(command) : `#{command}` end
info_tag_exists?()
click to toggle source
# File lib/simple-info/tag.rb, line 26 def info_tag_exists? execute("git tag").include? TAG_NAME end