Class: Gorails::Commands::Jumpstart

Inherits:
Gorails::Command
  • Object
show all
Defined in:
lib/gorails/commands/jumpstart.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.helpObject



24
25
26
# File 'lib/gorails/commands/jumpstart.rb', line 24

def self.help
  "Create a new Ruby on Rails application with the Jumpstart template. https://github.com/excid3/jumpstart\nUsage: {{command:#{Gorails::TOOL_NAME} jumpstart myapp}}"
end

Instance Method Details

#call(args, _name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gorails/commands/jumpstart.rb', line 8

def call(args, _name)
  name = args.first

  if name.nil?
    puts CLI::UI.fmt "{{red:Application name is required.}}"
    puts "Try again with \"gorails jumpstart myapp\""
    exit 1
  end

  CLI::UI::Frame.open("Generating Jumpstart application \"#{name}\"") do
    Bundler.with_original_env do
      system "rails new #{name} -d postgresql -m https://raw.githubusercontent.com/excid3/jumpstart/master/template.rb"
    end
  end
end