def self.create(opts)
display = lambda {|message| puts message if ! opts[:verbosity] || (opts[:verbosity] && opts[:verbosity] <= Logger::INFO) }
path = opts.delete(:create) \
or raise ArgumentError.new(":create option not specified")
interpreter = AutomateIt.new(opts)
interpreter.instance_eval do
template_manager.default_check = :exists
mkdir_p(path) do |created|
display.call PNOTE+"%s AutomateIt project at: %s" %
[created ? "Creating" : "Updating", path]
render(:text => WELCOME_CONTENT, :to => "README_AutomateIt.txt")
render(:text => RAKEFILE_CONTENT, :to => "Rakefile")
mkdir("config")
render(:text => TAGS_CONTENT, :to => "config/tags.yml")
render(:text => FIELDS_CONTENT, :to => "config/fields.yml")
render(:text => ENV_CONTENT, :to => "config/automateit_env.rb")
mkdir("dist")
render(:text => DIST_README_CONTENT, :to => "dist/README_AutomateIt_dist.txt")
mkdir("lib")
render(:text => BASE_README_CONTENT, :to => "lib/README_AutomateIt_lib.txt")
mkdir("recipes")
render(:text => RECIPE_README_CONTENT, :to => "recipes/README_AutomateIt_recipes.txt")
render(:text => RECIPE_HELLO_CONTENT, :to => "recipes/hello.rb")
end
if log.info? and not opts[:quiet]
puts '-----------------------------------------------------------------------'
puts WELCOME_MESSAGE
puts '-----------------------------------------------------------------------'
end
end
end