Class: Fontist::FontInstaller
- Inherits:
-
Object
- Object
- Fontist::FontInstaller
- Defined in:
- lib/fontist/font_installer.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
-
#initialize(formula, font_name: nil, no_progress: false, location: nil, format_spec: nil, confirmation: "no") ⇒ FontInstaller
constructor
A new instance of FontInstaller.
- #install(confirmation:) ⇒ Object
Constructor Details
#initialize(formula, font_name: nil, no_progress: false, location: nil, format_spec: nil, confirmation: "no") ⇒ FontInstaller
Returns a new instance of FontInstaller.
8 9 10 11 12 13 14 15 16 |
# File 'lib/fontist/font_installer.rb', line 8 def initialize(formula, font_name: nil, no_progress: false, location: nil, format_spec: nil, confirmation: "no") @formula = formula @font_name = font_name @no_progress = no_progress @location = InstallLocation.create(formula, location_type: location) @format_spec = format_spec @confirmation = confirmation end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
6 7 8 |
# File 'lib/fontist/font_installer.rb', line 6 def location @location end |
Instance Method Details
#install(confirmation:) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/fontist/font_installer.rb', line 18 def install(confirmation:) raise_platform_error unless platform_compatible? raise_fontist_version_error unless supported_version? raise_licensing_error unless license_is_accepted?(confirmation) install_font end |