class DeploymentGenerator < Rails::Generator::NamedBase
  attr_reader :recipe_file

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

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

  protected

    # Override with your own usage banner.
    def banner
      "Usage: #{$0} deployment ApplicationName [recipe-name]\n" +
      "  (recipe-name defaults to \"deploy\")"
    end
end

class DeploymentGenerator < Rails::Generator::NamedBase
  attr_reader :recipe_file

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

  def manifest
    record do |m|
      m.directory "script"
      m.file "switchtower", File.join("script", "switchtower")
      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

  protected

    # Override with your own usage banner.
    def banner
      "Usage: #{$0} deployment ApplicationName [recipe-name]\n" +
      "  (recipe-name defaults to \"deploy\")"
    end
end

Fix switchtower deployment generator to use lib/tasks instead of config/tasks
Fix switchtower deployment generator to use lib/tasks instead of config/tasks


git-svn-id: 1de83279c7ce3921210267b158a3abf93ac92a20@2207 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
