Class: Esse::CLI::Root

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRoot

Returns a new instance of Root.



33
34
35
36
37
38
39
# File 'lib/esse/cli.rb', line 33

def initialize(*)
  super

  after_initialize
  load_app_config(options[:require])
  setup_listeners if !options[:silent] && Esse.config.cli_event_listeners?
end

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/esse/cli.rb', line 45

def self.exit_on_failure?
  true
end

.source_rootObject



41
42
43
# File 'lib/esse/cli.rb', line 41

def self.source_root
  File.expand_path('../cli', __FILE__)
end

Instance Method Details

#installObject



64
65
66
67
68
69
70
71
72
# File 'lib/esse/cli.rb', line 64

def install
  path = Pathname.new(File.expand_path(options[:path], Dir.pwd))
  path = path.dirname unless path.directory?
  @app_dir = path.basename
  template(
    'templates/config.rb.erb',
    path.join('config/esse.rb'),
  )
end

#versionObject



58
59
60
# File 'lib/esse/cli.rb', line 58

def version
  Output.print_message('Esse version: %<version>s', version: Esse::VERSION)
end