Sha256: c4a3ecfe562ac9589b6bf56782aeec9cbda617cd87740da759750df461101af1

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require 'thor'
require 'thor/actions'

module Gypsum

  class CLI < Thor

    # Includes
    include Thor::Actions

    desc "new [app]", "Create a new Rails 3.1 application"
    long_desc <<-D
      Gypsum will ask you a few questions to determine what features you
      would like to generate. Based on your answers it will setup a new Rails 3 application.
    D
    def new( project , template_name = "default" )

      # Require the template runner
      require "#{Gypsum::GEM_ROOT}/templates/#{template_name}/#{template_name}.rb"

      # Invoke the template runner
      invoke "gypsum:templates:#{template_name}:on_invocation"

      # Execute the template
      exec(<<-COMMAND)
        rails new #{project} \
          --template=#{Gypsum::GEM_ROOT}/templates/#{template_name}/bootstrap.rb \
          --skip-test-unit \
          --skip-prototype
      COMMAND

    end

    desc "version", "Prints Gypsum's version information"
    def version
      say "Gypsum version #{Gypsum::VERSION}"
    end
    map %w(-v --version) => :version

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gypsum-0.9.1 lib/gypsum/cli.rb
gypsum-0.9.0 lib/gypsum/cli.rb
gypsum-0.8.0 lib/gypsum/cli.rb