Class: YJCocoa::GitTagAdd
- Defined in:
- lib/yjcocoa/git/git_tag_add.rb
Overview
Usage
Constant Summary
Constants inherited from Command
Instance Attribute Summary
Attributes inherited from GitTag
Instance Method Summary collapse
Methods inherited from GitTag
#gitTagAdd, #gitTagDelete, #initialize, options, #validate!
Methods inherited from Git
Methods inherited from Command
Constructor Details
This class inherits a constructor from YJCocoa::GitTag
Instance Method Details
#current_branch ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/yjcocoa/git/git_tag_add.rb', line 37 def current_branch list = (`git branch`).split("\n") for item in list if item =~ /\* / return item.gsub(/\* /, "") end end end |
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/yjcocoa/git/git_tag_add.rb', line 22 def run if File.exist?(".git") current_branch = self.current_branch tag = File.basename(Dir.pwd) tag << "-#{current_branch}" unless current_branch == "master" tag << "-#{Time.now.strftime('%Y%m%d%H%M')}" puts "YJCocoa build tag #{tag}".green system("yjcocoa git tag --add=#{tag}") else Dir.chdir("..") { self.run } end end |