Class: Fontist::FontconfigCLI

Inherits:
Thor
  • Object
show all
Includes:
CLI::ClassOptions
Defined in:
lib/fontist/fontconfig_cli.rb

Instance Method Summary collapse

Methods included from CLI::ClassOptions

#handle_class_options, included, #log_level

Instance Method Details

#removeObject



19
20
21
22
23
24
25
26
27
# File 'lib/fontist/fontconfig_cli.rb', line 19

def remove
  handle_class_options(options)
  Fontconfig.remove(options)
  Fontist.ui.success("Fontconfig file has been successfully removed.")
  CLI::STATUS_SUCCESS
rescue Errors::FontconfigFileNotFoundError => e
  Fontist.ui.error(e.message)
  CLI::STATUS_FONTCONFIG_FILE_NOT_FOUND
end

#updateObject



6
7
8
9
10
11
12
13
14
# File 'lib/fontist/fontconfig_cli.rb', line 6

def update
  handle_class_options(options)
  Fontconfig.update
  Fontist.ui.success("Fontconfig file has been successfully updated.")
  CLI::STATUS_SUCCESS
rescue Errors::FontconfigNotFoundError => e
  Fontist.ui.error(e.message)
  CLI::STATUS_FONTCONFIG_NOT_FOUND
end