Sha256: af256e8ac6a256fa779b9bd392abb76221c2a377be19bd0520d0d26c15a65aa2

Contents?: true

Size: 968 Bytes

Versions: 1

Compression:

Stored size: 968 Bytes

Contents

#!/usr/bin/env ruby

$:.push File.expand_path("../../lib", __FILE__)

require 'fileutils'
require 'optparse'
require 'methadone'
require 'methadone/cli'
require 'braces'

include FileUtils
include Methadone::Main
include Methadone::CLI
include Braces

main do |name|
  check_and_prepare_basedir!(name,options[:force])

  app_name          = File.basename(name)
  app_name          = app_name.downcase
  app_name_constant = app_name.capitalize

  chdir File.dirname(name)

  debug "Creating project for sinatra app #{app_name}"

  mkdir_p app_name

  chdir app_name

  template_dirs_in(:full).each  { |dir| mkdir_p dir }

  ["config.ru", "Gemfile", "Rakefile", "spec/spec_helper.rb"].each do |file|
    copy_file file, :binding => binding
  end

  copy_file "lib/application.rb", :as => "#{app_name}.rb", :binding => binding
end

description "Braces help you quickly bootstrap a sinatra application."

on("--force","Overwrite files if they exist")

arg :app_name 

go!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
braces-0.0.1 bin/braces