def generate_app
      copy_templates
      app = File.read File.expand_path("../templates/app.erb", __FILE__)
      erb = ERB.new app, 0, '-'

      File.open "#{@destination}/#{@app_name}.rb", "w" do |f|
        f.write erb.result(binding)
      end

      route = File.read File.expand_path("../templates/app/routes/home.erb", __FILE__)
      erb = ERB.new route, 0, '-'

      File.open "#{@destination}/app/routes/home.rb", "w" do |f|
        f.write erb.result(binding)
      end

      FileUtils.rm "#{@destination}/app/routes/home.erb"
    end
def generate_app
      copy_templates
      app = File.read File.expand_path("../templates/app.erb", __FILE__)
      erb = ERB.new app, 0, '-'

      File.open "#{@destination}/#{@app_name}.rb", "w" do |f|
        f.write erb.result(binding)
      end

      route = File.read File.expand_path("../templates/app/routes/home.erb", __FILE__)
      erb = ERB.new route, 0, '-'

      File.open "#{@destination}/app/routes/home.rb", "w" do |f|
        f.write erb.result(binding)
      end

      FileUtils.rm "#{@destination}/app/routes/home.erb"
    end
https://github.com/sinatra/sinatra-book/blob/master/book/Organizing_your_application.markdown