Class: Prologue::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/prologue/cli.rb

Instance Method Summary collapse

Instance Method Details

#new(project, template_name = "default") ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/prologue/cli.rb', line 17

def new( project , template_name = "default" )

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

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

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

end

#versionObject



36
37
38
# File 'lib/prologue/cli.rb', line 36

def version
  say "Prologue version #{Prologue::VERSION}"
end