Class: DeploymentGenerator

Inherits:
Rails::Generator::NamedBase
  • Object
show all
Defined in:
lib/switchtower/generators/rails/deployment/deployment_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runtime_args, runtime_options = {}) ⇒ DeploymentGenerator

Returns a new instance of DeploymentGenerator.



4
5
6
7
# File 'lib/switchtower/generators/rails/deployment/deployment_generator.rb', line 4

def initialize(runtime_args, runtime_options = {})
  super
  @recipe_file = @args.shift || "deploy"
end

Instance Attribute Details

#recipe_fileObject (readonly)

Returns the value of attribute recipe_file.



2
3
4
# File 'lib/switchtower/generators/rails/deployment/deployment_generator.rb', line 2

def recipe_file
  @recipe_file
end

Instance Method Details

#manifestObject



9
10
11
12
13
14
15
16
# File 'lib/switchtower/generators/rails/deployment/deployment_generator.rb', line 9

def manifest
  record do |m|
    m.directory "config"
    m.template "deploy.rb", File.join("config", "#{recipe_file}.rb")
    m.directory "lib/tasks"
    m.template "switchtower.rake", File.join("lib", "tasks", "switchtower.rake")
  end
end