Sha256: adbb9693b2a5f1b870e4dbdd5720c3c27067eaaf6e747f0c5a4121e4a00d8d62

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'thor'
require 'thor/actions'

module Shinkansen

  class CLI < Thor

    # Includes
    include Thor::Actions

    desc "new [app]", "Create a new Rails 3.1 application"
    long_desc <<-D
      Shinkansen 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 "#{Shinkansen::GEM_ROOT}/templates/#{template_name}/#{template_name}.rb"

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

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

    end

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

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shinkansen-0.1 lib/shinkansen/cli.rb