Class: AutoTagger::CapistranoHelper
- Inherits:
-
Object
- Object
- AutoTagger::CapistranoHelper
- Defined in:
- lib/auto_tagger/capistrano_helper.rb
Instance Method Summary collapse
- #auto_tagger ⇒ Object
- #auto_tagger_options ⇒ Object
-
#initialize(variables) ⇒ CapistranoHelper
constructor
A new instance of CapistranoHelper.
- #ref ⇒ Object
- #stages ⇒ Object
Constructor Details
#initialize(variables) ⇒ CapistranoHelper
Returns a new instance of CapistranoHelper.
7 8 9 |
# File 'lib/auto_tagger/capistrano_helper.rb', line 7 def initialize(variables) @variables = variables end |
Instance Method Details
#auto_tagger ⇒ Object
11 12 13 |
# File 'lib/auto_tagger/capistrano_helper.rb', line 11 def auto_tagger @auto_tagger ||= AutoTagger::Base.new() end |
#auto_tagger_options ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/auto_tagger/capistrano_helper.rb', line 29 def = {} [:stage] = variables[:auto_tagger_stage] || variables[:stage] [:stages] = stages if variables[:working_directory] AutoTagger::Deprecator.warn(":working_directory is deprecated. Please use :auto_tagger_working_directory.") [:path] = variables[:working_directory] else [:path] = variables[:auto_tagger_working_directory] end if ! variables[:auto_tagger_dry_run].nil? [:dry_run] = variables[:auto_tagger_dry_run] else [:dry_run] = variables[:dry_run] end [ :date_separator, :push_refs, :fetch_refs, :remote, :ref_path, :offline, :verbose, :refs_to_keep, :executable, :opts_file ].each do |key| [key] = variables[:"auto_tagger_#{key}"] end end |
#ref ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/auto_tagger/capistrano_helper.rb', line 15 def ref if variables.has_key?(:head) variables[:branch] elsif variables.has_key?(:tag) variables[:tag] elsif variables.has_key?(:ref) variables[:ref] elsif auto_tagger.last_ref_from_previous_stage auto_tagger.last_ref_from_previous_stage.sha else variables[:branch] end end |
#stages ⇒ Object
57 58 59 60 61 62 63 64 65 |
# File 'lib/auto_tagger/capistrano_helper.rb', line 57 def stages if variables[:autotagger_stages] AutoTagger::Deprecator.warn(":autotagger_stages is deprecated. Please use :auto_tagger_stages.") stages = variables[:autotagger_stages] else stages = variables[:auto_tagger_stages] || variables[:stages] || [] end stages.map { |stage| stage.to_s } end |