class LaunchBase::CLI::Base

Public Class Methods

install_modules(project_path, options) click to toggle source
# File lib/launch_base/cli/base.rb, line 57
def self.install_modules(project_path, options)
  Plugin.each_plugin do |_plugin_name, plugin|
    if options[plugin.command_line_flag]
      plugin.install(destination_root: project_path)
    end
  end
end

Public Instance Methods

help() click to toggle source
Calls superclass method
# File lib/launch_base/cli/base.rb, line 52
def help
  show_banner
  super
end
new(project_path) click to toggle source
# File lib/launch_base/cli/base.rb, line 36
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 #{Utilities.gem_home}/templates/launch_base_default_template.rb"
      Base.install_modules(project_path, options)
    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
update() click to toggle source
# File lib/launch_base/cli/base.rb, line 22
def update
  run 'bundle update launch_base --conservative'
end

Private Instance Methods

show_banner() click to toggle source
# File lib/launch_base/cli/base.rb, line 67
def show_banner
  say "\u{1f680} Kabisa #{LaunchBase}\n\n"
end