Exception: Tomo::Runtime::SettingsRequiredError

Inherits:
Error
  • Object
show all
Defined in:
lib/tomo/runtime/settings_required_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

raise_with

Methods included from Colors

enabled?

Instance Attribute Details

#command_nameObject

Returns the value of attribute command_name.



6
7
8
# File 'lib/tomo/runtime/settings_required_error.rb', line 6

def command_name
  @command_name
end

#settingsObject

Returns the value of attribute settings.



6
7
8
# File 'lib/tomo/runtime/settings_required_error.rb', line 6

def settings
  @settings
end

#taskObject

Returns the value of attribute task.



6
7
8
# File 'lib/tomo/runtime/settings_required_error.rb', line 6

def task
  @task
end

Instance Method Details

#to_consoleObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/tomo/runtime/settings_required_error.rb', line 8

def to_console
  <<~ERROR
    The #{yellow(task)} task requires #{settings_sentence}

    Settings can be specified in #{blue(DEFAULT_CONFIG_PATH)}, or by running tomo
    with the #{blue('-s')} option. For example:

      #{blue("tomo -s #{settings.first}=foo")}

    You can also use environment variables:

      #{blue("TOMO_#{settings.first.upcase}=foo tomo #{command_name}")}
  ERROR
end