Sha256: 387ee71aecea08946afb0f3da3f3056c90a7b621fb70ea9f8a62b9af7e790db6
Contents?: true
Size: 856 Bytes
Versions: 1
Compression:
Stored size: 856 Bytes
Contents
require 'exogenesis/support/passenger' # Installs and Removes Fonts class Fonts < Passenger register_as :fonts needs :fonts_path with_emoji :book def up install_all_fonts end def down collect_fonts do |file| rm_rf target_font_path(file) end end private def install_all_fonts collect_fonts do |file| install_font(file) end end def collect_fonts Dir.glob(File.join(fonts_path, '**/*.{ttf,otf}')).each do |file| yield file end end def install_font(file) if File.exist? target_font_path(file) skip_task "Copying #{File.basename file}", 'Already copied' else execute "Copying #{File.basename file}", "cp '#{file}' '#{target_font_path(file)}'" end end def target_font_path(file) File.join(ENV['HOME'], 'Library/Fonts', File.basename(file)) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
exogenesis-1.0.0 | lib/exogenesis/passengers/fonts.rb |