Class: Fontist::FontInstaller

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

Instance Method Summary collapse

Constructor Details

#initialize(formula, font_name: nil, no_progress: false) ⇒ FontInstaller

Returns a new instance of FontInstaller.



6
7
8
9
10
# File 'lib/fontist/font_installer.rb', line 6

def initialize(formula, font_name: nil, no_progress: false)
  @formula = formula
  @font_name = font_name
  @no_progress = no_progress
end

Instance Method Details

#install(confirmation:) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fontist/font_installer.rb', line 12

def install(confirmation:)
  if @formula.license_required && !"yes".casecmp?(confirmation)
    raise(Fontist::Errors::LicensingError)
  end

  install_font
end