class Boppers::CLI

Public Class Methods

exit_on_failure?() click to toggle source
# File lib/boppers/cli.rb, line 7
def self.exit_on_failure?
  true
end

Public Instance Methods

app(name) click to toggle source
# File lib/boppers/cli.rb, line 57
def app(name)
  require "boppers/generator/app"

  base_path = File.expand_path(name)

  generator = Generator::App.new
  generator.destination_root = base_path
  generator.invoke_all
end
plugin(name) click to toggle source
# File lib/boppers/cli.rb, line 36
def plugin(name)
  require "boppers/generator/plugin"

  unless %w{bopper notifier}.include?(options[:type])
    message = "ERROR: --type needs to be either 'bopper' or 'notifier'"
    shell.error shell.set_color(message, :red)
    exit 1
  end

  suffix = "-notifier" if options[:type] == "notifier"
  base_path = File.dirname(File.expand_path(name))
  base_name = "boppers-#{File.basename(name)}#{suffix}"

  generator = Generator::Plugin.new
  generator.plugin_type = options[:type]
  generator.destination_root = File.join(base_path, base_name)
  generator.invoke_all
end
setup(name) click to toggle source
# File lib/boppers/cli.rb, line 69
def setup(name)
  file = File.expand_path("../../setup/#{name}.rb", __dir__)

  unless File.file?(file)
    message = "ERROR: invalid setup name."
    shell.error shell.set_color(message, :red)
    exit 1
  end

  require file
  Setup.call(shell)
end
start() click to toggle source
# File lib/boppers/cli.rb, line 18
def start
  require options[:require]
  Runner.new.call
end
version() click to toggle source
# File lib/boppers/cli.rb, line 26
def version
  say "Boppers v#{VERSION}"
end