Class: LaunchBase::CLI

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

Instance Method Summary collapse

Instance Method Details

#helpObject



39
40
41
42
# File 'lib/launch_base/cli.rb', line 39

def help
  show_banner
  super
end

#new(project_path) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/launch_base/cli.rb', line 24

def new(project_path)
  installed_rails_version = Utilities.get_rails_version

  if installed_rails_version
    if Utilities.rails_up_to_date?(installed_rails_version)
      run "rails new #{project_path} -m #{gem_home}/templates/launch_base_default_template.rb"
    else
      say "Your current installation of Rails is outdated (#{installed_rails_version}). "\
          "Please upgrade to Rails #{RAILS_VERSION}"
    end
  else
    say "No installation of Rails found. Please install Rails #{RAILS_VERSION}"
  end
end

#updateObject



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

def update
  run 'bundle update launch_base --conservative'
end