<NME> rango
<BEF> #!/usr/bin/env ruby
# encoding: utf-8

if RUBY_VERSION < "1.9.1"
  abort "Rango requires at least Ruby 1.9.1. If you run JRuby, please ensure you used the --1.9 switch for JRuby command, for example jruby --1.9 -S rango create project blog"
end

base   = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
$: << "#{rango_root}/lib"

def create(stubs_dirs, type, name)
  dir = stubs_dirs.find { |dir| File.directory?("#{dir}/#{type}") }
  %x(cp -R "#{dir}/#{type}" #{name})
  puts "#{type.capitalize} #{name} have been created (used stub from #{dir})."
end
  require "simple-templater"
rescue LoadError
  abort "You have to install simple-templater first!"
end

require "rango"

# === Helpers === #
# TODO: Generators.each { |generator| puts generator.help }
def usage
<<-HELP
=== Usage ===
rango create project mycoolproject    Generate new site
HELP
end

begin
  create(stubs_dirs, "project", ARGV[1])
when "startapp"
  create(stubs_dirs, "app", ARGV[1])
when "-i"
  require "rango"
else
    abort "Generator #{generator_name} doesn't exist. Available generators are: #{templater.generators.map { |set| set.name }.inspect}"
  else
    begin
      generator_set.run(ARGV)
    rescue SimpleTemplater::TargetAlreadyExist => exception
      abort exception.message
    rescue Interrupt
      exit
    rescue Exception => exception
      abort "Exception #{exception.inspect} occured during running generator #{generator_set.inspect}\n#{exception.backtrace.join("\n")}"
    end
  end
end

<MSG> Added possibility to generate flat application

<DFF> @@ -9,7 +9,8 @@ String.send(:include, Term::ANSIColor)
 $: << "#{rango_root}/lib"
 
 def create(stubs_dirs, type, name)
-  dir = stubs_dirs.find { |dir| File.directory?("#{dir}/#{type}") }
+  dir = stubs_dirs.find { |dir| File.exist?("#{dir}/#{type}") }
+  puts %(cp -R "#{dir}/#{type}" #{name})
   %x(cp -R "#{dir}/#{type}" #{name})
   puts "#{type.capitalize} #{name} have been created (used stub from #{dir})."
 end
@@ -33,6 +34,8 @@ when "startproject"
   create(stubs_dirs, "project", ARGV[1])
 when "startapp"
   create(stubs_dirs, "app", ARGV[1])
+when "startflat"
+  create(stubs_dirs, "flat.rb", "#{ARGV[1]}.rb")
 when "-i"
   require "rango"
 else

Added possibility to generate flat application