lib/gator/commands/project_command.rb in gator-0.0.8.pre vs lib/gator/commands/project_command.rb in gator-0.0.9.pre

- old
+ new

@@ -12,11 +12,11 @@ def self.source_root Gator::Util.project_template_root end - desc "project install DIRECTORY TEMPLATE_NAME", "Install a project template." + desc "project install NAME TEMPLATE_NAME", "Install a project template." def install( dir, template=nil ) entries = directory_entries dir template ||= File.expand_path( File.dirname(entries.first) ).split(File::SEPARATOR).last empty_directory template_dir(template) FileUtils.cp_r entries, template_dir(template) @@ -26,13 +26,14 @@ desc "project uninstall TEMPLATE_NAME", "Uninstall a project template." def uninstall( template ) FileUtils.rm_r template_dir(template) end - desc "project new DIRECTORY TEMPLATE_NAME", "Create a new project by template." - def new( dir, template ) - directory template_dir(template), File.expand_path( dir ) + desc "project new NAME TEMPLATE_NAME", "Create a new project by template." + def new( name, template ) + @project_name = name + directory template_dir(template), File.expand_path( name ) end desc "project wipe", "Delete all project templates." def wipe template_root_entries(true).each { |e| FileUtils.rm_r e } @@ -43,9 +44,17 @@ entries = template_root_entries entries = entries.select { |e| e.include?(search) } unless search.nil? entries.each {|e| say " #{e}" } say "No templates found.", :blue if entries.empty? end + + no_tasks { + + def project_name + @project_name + end + + } private def create_empty_directory_files( dir ) Dir.glob( File.join( dir, "**", "*" ) ).each {|f| \ No newline at end of file