Class: YJCocoa::GitTag
- Defined in:
- lib/yjcocoa/git/git_tag.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Command
Instance Attribute Summary collapse
-
#addTag ⇒ Object
property.
-
#deleteTags ⇒ Object
Returns the value of attribute deleteTags.
Class Method Summary collapse
Instance Method Summary collapse
- #gitTagAdd ⇒ Object
- #gitTagDelete ⇒ Object
-
#initialize(argv) ⇒ GitTag
constructor
初始化.
- #run ⇒ Object
-
#validate! ⇒ Object
businrss.
Methods inherited from Git
Methods inherited from Command
Constructor Details
#initialize(argv) ⇒ GitTag
初始化
37 38 39 40 41 42 |
# File 'lib/yjcocoa/git/git_tag.rb', line 37 def initialize(argv) super self.addTag = argv.option('add') self.deleteTags = argv.option('delete') self.deleteTags = self.deleteTags.split(",").reject {|i| i.empty? } if self.deleteTags end |
Instance Attribute Details
#addTag ⇒ Object
property
33 34 35 |
# File 'lib/yjcocoa/git/git_tag.rb', line 33 def addTag @addTag end |
#deleteTags ⇒ Object
Returns the value of attribute deleteTags.
34 35 36 |
# File 'lib/yjcocoa/git/git_tag.rb', line 34 def deleteTags @deleteTags end |
Class Method Details
Instance Method Details
#gitTagAdd ⇒ Object
61 62 63 64 |
# File 'lib/yjcocoa/git/git_tag.rb', line 61 def gitTagAdd puts "YJCocoa git add tag #{self.addTag}".green system("git push origin #{self.addTag}") if system("git tag #{self.addTag}") end |
#gitTagDelete ⇒ Object
66 67 68 69 70 71 |
# File 'lib/yjcocoa/git/git_tag.rb', line 66 def gitTagDelete puts "YJCocoa git delete tags #{self.deleteTags}".green self.deleteTags.each { |tag| system("git push origin :refs/tags/#{tag}") if system("git tag -d #{tag}") } end |
#run ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/yjcocoa/git/git_tag.rb', line 53 def run if self.deleteTags && !self.deleteTags.empty? self.gitTagDelete puts end self.gitTagAdd if self.addTag end |