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
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#config_file_prefix ⇒ Object
readonly
Returns the value of attribute config_file_prefix.
-
#pastel ⇒ Object
readonly
Returns the value of attribute pastel.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object (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_prefix ⇒ Object (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 |
#pastel ⇒ Object (readonly)
Returns the value of attribute pastel.
22 23 24 |
# File 'lib/libis/tools/cli/cli_helper.rb', line 22 def pastel @pastel end |
#prompt ⇒ Object (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 |