Class: ReactRailsAPI::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/react-rails-api/cli.rb

Constant Summary collapse

TEMPLATE =
File.join __dir__, 'template.rb'

Instance Method Summary collapse

Instance Method Details

#new(path) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/react-rails-api/cli.rb', line 9

def new(path)
  opts = default_options
  opts << '--database=postgresql' if options[:database]
  opts << '--skip-active-record' if !options[:database]
  opts << "--template=#{TEMPLATE}"
  exec "rails new #{path} #{opts.join ' '}"
end

#versionObject



19
20
21
# File 'lib/react-rails-api/cli.rb', line 19

def version
  puts ReactRailsAPI::VERSION
end