Class: Emeril::GitTagger
- Inherits:
-
Object
- Object
- Emeril::GitTagger
- Includes:
- Logging
- Defined in:
- lib/emeril/git_tagger.rb
Overview
Applies a version tag on a git repository and pushes it to the origin remote.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ GitTagger
constructor
Creates a new instance.
-
#run ⇒ Object
Applies a version tag on a git repository and pushes it to the origin remote.
Constructor Details
#initialize(options = {}) ⇒ GitTagger
Creates a new instance.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/emeril/git_tagger.rb', line 35 def initialize( = {}) @logger = [:logger] @source_path = .fetch(:source_path, Dir.pwd) @tag_prefix = case [:tag_prefix] when nil then DEFAULT_TAG_PREFIX when false "" else [:tag_prefix] end @version = .fetch(:version) do raise ArgumentError, ":version must be set" end end |
Instance Method Details
#run ⇒ Object
Applies a version tag on a git repository and pushes it to the origin remote.
54 55 56 57 |
# File 'lib/emeril/git_tagger.rb', line 54 def run guard_clean tag_version { git_push } unless already_tagged? end |