Module: Libis::Tools::Cli::Helper

Included in:
Libis::Tools::CommandLine
Defined in:
lib/libis/tools/cli/cli_helper.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



22
23
24
# File 'lib/libis/tools/cli/cli_helper.rb', line 22

def config
  @config
end

#config_file_prefixObject (readonly)

Returns the value of attribute config_file_prefix.



22
23
24
# File 'lib/libis/tools/cli/cli_helper.rb', line 22

def config_file_prefix
  @config_file_prefix
end

#pastelObject (readonly)

Returns the value of attribute pastel.



22
23
24
# File 'lib/libis/tools/cli/cli_helper.rb', line 22

def pastel
  @pastel
end

#promptObject (readonly)

Returns the value of attribute prompt.



22
23
24
# File 'lib/libis/tools/cli/cli_helper.rb', line 22

def prompt
  @prompt
end

Class Method Details

.included(base) ⇒ Object



18
19
20
# File 'lib/libis/tools/cli/cli_helper.rb', line 18

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#initialize(*args) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/libis/tools/cli/cli_helper.rb', line 24

def initialize(*args)
  @prompt = TTY::Prompt.new
  @config = TTY::Config.new
  @pastel = Pastel.new
  @config.append_path Dir.home
  @config_file_prefix = '.tools.'
  prompt.warn "Default config file: #{config.filename}"
  super
end