$NITRO_NO_ENVIRONMENT = true require 'nano/dir/self/recurse' require 'gen' require 'nitro' PROTO_DIR = File.join(Nitro::LibPath, '..', 'proto') class AppGen < Gen def setup @path = ARGV[0] || usage() @path = File.expand_path(@path) end def run if File.exists? @path STDERR.puts "ERROR: Path #{@path} already exists! Aborting!" exit 1 end FileUtils.cp_r(PROTO_DIR, @path) Dir.recurse(@path) do |f| FileUtils.rm_rf(f) if /\.svn$/ =~ f end end end $generator = AppGen.new