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.



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

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)


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

def self.exit_on_failure?
  true
end

.source_rootObject



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

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

Instance Method Details

#installObject



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

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



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

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