Class: DeploymentGenerator
- Inherits:
-
Rails::Generator::NamedBase
- Object
- Rails::Generator::NamedBase
- DeploymentGenerator
- Defined in:
- lib/switchtower/generators/rails/deployment/deployment_generator.rb
Instance Attribute Summary collapse
-
#recipe_file ⇒ Object
readonly
Returns the value of attribute recipe_file.
Instance Method Summary collapse
-
#initialize(runtime_args, runtime_options = {}) ⇒ DeploymentGenerator
constructor
A new instance of DeploymentGenerator.
- #manifest ⇒ Object
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, = {}) super @recipe_file = @args.shift || "deploy" end |
Instance Attribute Details
#recipe_file ⇒ Object (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
#manifest ⇒ Object
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 |