Class: Translatomatic::CLI::Config

Inherits:
Base
  • Object
show all
Defined in:
lib/translatomatic/cli/config.rb

Overview

Configuration functions for the command line interface

Instance Method Summary collapse

Instance Method Details

#describeObject

Describe available configuration settings



37
38
39
40
41
42
# File 'lib/translatomatic/cli/config.rb', line 37

def describe
  run do
    puts t("cli.config.configuration")
    print_config_table(:key, :type, :desc)
  end
end

#listObject

List current configuration settings



27
28
29
30
31
32
# File 'lib/translatomatic/cli/config.rb', line 27

def list
  run do
    puts t("cli.config.configuration")
    print_config_table(:key, :value)
  end
end

#remove(key) ⇒ void

This method returns an undefined value.

Remove a configuration setting

Parameters:

  • key (String)

    configuration key to remove



20
21
22
# File 'lib/translatomatic/cli/config.rb', line 20

def remove(key)
  run { conf.remove(key) }
end

#set(key, value) ⇒ String

Change a configuration setting

Parameters:

  • key (String)

    configuration key

  • value (String)

    new value for the configuration

Returns:



11
12
13
# File 'lib/translatomatic/cli/config.rb', line 11

def set(key, value)
  run { conf.set(key, value) }
end