class Fontist::Font
Public Class Methods
Source
# File lib/fontist/font.rb, line 35 def self.install(name, options = {}) new(options.merge(name: name)).install end
Source
# File lib/fontist/font.rb, line 39 def self.install_many(names, options = {}) successes = [] failures = [] names.each do |name| install(name, options) successes << name rescue Fontist::Errors::GeneralError => e failures << { font: name, error: e } end { successes: successes, failures: failures } end
Source
# File lib/fontist/font.rb, line 9 def initialize(options = {}) @name = options[:name] @confirmation = options[:confirmation] || "no" @hide_licenses = options[:hide_licenses] @no_progress = options[:no_progress] || false @force = options[:force] || false @version = options[:version] @smallest = options[:smallest] @newest = options[:newest] @size_limit = options[:size_limit] @by_formula = options[:formula] @update_fontconfig = options[:update_fontconfig] @install_location = options[:location] || options[:install_location] validate_location_parameter! check_or_create_fontist_path! end
Source
# File lib/fontist/font.rb, line 57 def self.status(name) new(name: name).status end
Source
# File lib/fontist/font.rb, line 53 def self.uninstall(name) new(name: name).uninstall end
Public Instance Methods
Source
# File lib/fontist/font.rb, line 65 def find find_system_font || downloadable_font || manual_font || raise_non_supported_font end
Source
# File lib/fontist/font.rb, line 70 def install return install_formula if @by_formula (find_system_font unless @force) || download_font || manual_font || raise_non_supported_font end
Source
# File lib/fontist/font.rb, line 89 def list return all_list unless @name font_list || raise_non_supported_font end
Source
# File lib/fontist/font.rb, line 82 def status return installed_paths unless @name find_system_font || downloadable_font || manual_font || raise_non_supported_font end
Source
# File lib/fontist/font.rb, line 77 def uninstall uninstall_font || downloadable_font || manual_font || raise_non_supported_font end