lib/bones/main.rb in bones-1.2.0 vs lib/bones/main.rb in bones-1.2.1

- old
+ new

@@ -1,6 +1,6 @@ -# $Id: main.rb 433 2008-01-01 04:32:48Z tim_pease $ +# $Id: main.rb 448 2008-01-02 16:40:37Z tim_pease $ require 'fileutils' require 'optparse' require 'erb' @@ -59,11 +59,11 @@ exit end # parse the command line arguments opts.parse! args - self.name = args.join('_') + self.name = args.empty? ? nil : args.join('_') if name.nil? puts opts ::Kernel.abort end @@ -140,11 +140,11 @@ # # If the project skeleton is already frozen, only the tasks from the Mr # Bones skeleton will be copied to the user's data directory. # def freeze - bones_data_dir = File.join(::Bones::PATH, 'data') + self.data = File.join(::Bones::PATH, 'data') data_dir = File.join(mrbones_dir, 'data') archive_dir = File.join(mrbones_dir, 'archive') tasks_only = false if test(?d, data_dir) @@ -158,10 +158,10 @@ end files_to_copy.each do |file| next if tasks_only && !(%r/^tasks\// =~ file) - src = File.join(bones_data_dir, file) + src = File.join(data, file) dst = File.join(data_dir, file) STDOUT.puts "freezing #{dst}" if verbose FileUtils.mkdir_p(File.dirname(dst)) FileUtils.cp(src, dst)