Class: Fontist::InstallLocations::UserLocation
- Inherits:
-
BaseLocation
- Object
- BaseLocation
- Fontist::InstallLocations::UserLocation
- Defined in:
- lib/fontist/install_locations/user_location.rb
Overview
User font directory location
This location represents the user-specific font directory, with platform-specific base paths:
macOS: ~/Library/Fonts/fontist/ Linux: ~/.local/share/fonts/fontist/ Windows: %LOCALAPPDATA%/Microsoft/Windows/Fonts/fontist/
## Managed vs Non-Managed
This location is managed when:
-
Using default path with /fontist subdirectory (default behavior)
This location is non-managed when:
-
User sets FONTIST_USER_FONTS_PATH to system root (e.g., ~/Library/Fonts)
-
In non-managed mode, fonts are added with unique names to avoid conflicts
## Customization
Set via environment variable:
export FONTIST_USER_FONTS_PATH=~/Library/Fonts/fontist
Or via config:
fontist config set user_fonts_path ~/Library/Fonts/fontist
Instance Attribute Summary
Attributes inherited from BaseLocation
Instance Method Summary collapse
-
#base_path ⇒ Pathname
Returns base installation path.
-
#location_type ⇒ Symbol
Returns location type identifier.
Methods inherited from BaseLocation
#find_fonts, #font_exists?, #font_path, #initialize, #install_font, #permission_warning, #requires_elevated_permissions?, #uninstall_font
Constructor Details
This class inherits a constructor from Fontist::InstallLocations::BaseLocation
Instance Method Details
#base_path ⇒ Pathname
Returns base installation path
Priority:
-
Custom path from Config.user_fonts_path (if set)
-
Platform default + /fontist subdirectory
42 43 44 45 46 47 48 49 |
# File 'lib/fontist/install_locations/user_location.rb', line 42 def base_path # Check for custom path from config/ENV custom_path = Fontist::Config.user_fonts_path return Pathname.new(File.(custom_path)) if custom_path # Default: platform-specific path + /fontist subdirectory default_user_path.join("fontist") end |
#location_type ⇒ Symbol
Returns location type identifier
31 32 33 |
# File 'lib/fontist/install_locations/user_location.rb', line 31 def location_type :user end |