Class: Fontist::Fontconfig

Inherits:
Object
  • Object
show all
Defined in:
lib/fontist/fontconfig.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Fontconfig

Returns a new instance of Fontconfig.



11
12
13
# File 'lib/fontist/fontconfig.rb', line 11

def initialize(options = {})
  @options = options
end

Class Method Details

.remove(options = {}) ⇒ Object



7
8
9
# File 'lib/fontist/fontconfig.rb', line 7

def self.remove(options = {})
  new(options).remove
end

.updateObject



3
4
5
# File 'lib/fontist/fontconfig.rb', line 3

def self.update
  new.update
end

Instance Method Details

#removeObject



21
22
23
24
25
26
# File 'lib/fontist/fontconfig.rb', line 21

def remove
  return handle_file_not_found unless config_exists?

  regenerate_fontconfig_cache if fontconfig_installed?
  remove_config
end

#updateObject



15
16
17
18
19
# File 'lib/fontist/fontconfig.rb', line 15

def update
  ensure_fontconfig_installed
  create_config
  regenerate_fontconfig_cache
end