Class: Raboot::CLI

Inherits:
Thor
  • Object
show all
Includes:
Utils, Version, Thor::Actions
Defined in:
lib/raboot/cli.rb

Constant Summary

Constants included from Version

Version::MAJOR, Version::MINOR, Version::PATCH, Version::STRING

Instance Method Summary collapse

Methods included from Utils

#rename_app, #replace_text, #validate_name?

Instance Method Details

#new(name) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/raboot/cli.rb', line 21

def new(name)
  if validate_name?(name)
    template_path = File.expand_path('~/.raboot/*')
    FileUtils.mkdir(name)
    FileUtils.cp_r(Dir.glob(template_path), name)
    rename_app(name)
    say 'Successfully generated ' + name + ' app from template'
  end
end

#versionObject



16
17
18
# File 'lib/raboot/cli.rb', line 16

def version
  say Raboot::Version::STRING
end