Class: Boppers::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/boppers/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/boppers/cli.rb', line 7

def self.exit_on_failure?
  true
end

Instance Method Details

#app(name) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/boppers/cli.rb', line 45

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) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/boppers/cli.rb', line 32

def plugin(name)
  require "boppers/generator/plugin"

  base_path = File.dirname(File.expand_path(name))
  base_name = "boppers-#{File.basename(name)}"

  generator = Generator::Plugin.new
  generator.destination_root = File.join(base_path, base_name)
  generator.invoke_all
end

#startObject



18
19
20
21
# File 'lib/boppers/cli.rb', line 18

def start
  require options[:require]
  Runner.new.call
end

#versionObject



26
27
28
# File 'lib/boppers/cli.rb', line 26

def version
  say "Boppers v#{VERSION}"
end