Sha256: 85f9b58af2be4f1574a8c3f63730d5a49970037162a8d72ecb35ae8ae9f8ba3b

Contents?: true

Size: 963 Bytes

Versions: 18

Compression:

Stored size: 963 Bytes

Contents

module Fontist
  class FontconfigCLI < Thor
    include CLI::ClassOptions

    desc "update", "Update fontconfig configuration to use fontist fonts"
    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

    desc "remove", "Remove fontist file in fontconfig configuration"
    option :force, type: :boolean, aliases: :f,
                   desc: "Proceed even if does not exist"
    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
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fontist-1.21.2 lib/fontist/fontconfig_cli.rb
fontist-1.21.1 lib/fontist/fontconfig_cli.rb
fontist-1.20.0 lib/fontist/fontconfig_cli.rb
fontist-1.19.0 lib/fontist/fontconfig_cli.rb
fontist-1.18.2 lib/fontist/fontconfig_cli.rb
fontist-1.17.1 lib/fontist/fontconfig_cli.rb
fontist-1.17.0 lib/fontist/fontconfig_cli.rb
fontist-1.16.0 lib/fontist/fontconfig_cli.rb
fontist-1.15.2 lib/fontist/fontconfig_cli.rb
fontist-1.15.1 lib/fontist/fontconfig_cli.rb
fontist-1.15.0 lib/fontist/fontconfig_cli.rb
fontist-1.14.6 lib/fontist/fontconfig_cli.rb
fontist-1.14.5 lib/fontist/fontconfig_cli.rb
fontist-1.14.4 lib/fontist/fontconfig_cli.rb
fontist-1.14.3 lib/fontist/fontconfig_cli.rb
fontist-1.14.2 lib/fontist/fontconfig_cli.rb
fontist-1.14.1 lib/fontist/fontconfig_cli.rb
fontist-1.14.0 lib/fontist/fontconfig_cli.rb