Class: Deploy::StageGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/deploy/stage/stage_generator.rb

Instance Method Summary collapse

Instance Method Details

#append_stage_to_deploy_rbObject



7
8
9
10
11
# File 'lib/deploy/stage/stage_generator.rb', line 7

def append_stage_to_deploy_rb
  sentinel = /set :stages,?+\n/

  append_to_file 'config/deploy.rb', "\nset :stages, self.stages.push('#{name}') \n"
end

#create_stagefileObject



13
14
15
16
17
# File 'lib/deploy/stage/stage_generator.rb', line 13

def create_stagefile
  @app_name = Rails.application.class.to_s.split("::").first.underscore
  
  template "stage.rb.erb", "config/deploy/#{name}.rb"    
end