Class: Instapusher2::TagTheRelease
- Inherits:
-
Object
- Object
- Instapusher2::TagTheRelease
- Defined in:
- lib/instapusher2/tag_the_release.rb
Instance Attribute Summary collapse
-
#branch_name ⇒ Object
readonly
Returns the value of attribute branch_name.
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
Instance Method Summary collapse
-
#initialize(branch_name, debug) ⇒ TagTheRelease
constructor
A new instance of TagTheRelease.
- #tagit ⇒ Object
Constructor Details
#initialize(branch_name, debug) ⇒ TagTheRelease
Returns a new instance of TagTheRelease.
6 7 8 9 |
# File 'lib/instapusher2/tag_the_release.rb', line 6 def initialize branch_name, debug @branch_name = branch_name @debug = debug end |
Instance Attribute Details
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
4 5 6 |
# File 'lib/instapusher2/tag_the_release.rb', line 4 def branch_name @branch_name end |
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
4 5 6 |
# File 'lib/instapusher2/tag_the_release.rb', line 4 def debug @debug end |
Instance Method Details
#tagit ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/instapusher2/tag_the_release.rb', line 11 def tagit version_number = Time.current.to_s.parameterize tag_name = "#{branch_name}-#{version_number}" cmd = "git tag -a -m \"Version #{tag_name}\" #{tag_name}" puts cmd if debug system cmd cmd = "git push --tags" puts cmd if debug system cmd end |