Class: DragonflyFonts::Processors::SetWoffMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/dragonfly_fonts/processors/set_woff_metadata.rb

Instance Method Summary collapse

Instance Method Details

#call(content, uniqueid, licensee_name = '') ⇒ Object

Raises:



6
7
8
9
10
11
12
13
# File 'lib/dragonfly_fonts/processors/set_woff_metadata.rb', line 6

def call(content, uniqueid, licensee_name = '')
  raise UnsupportedFormat unless content.ext
  raise UnsupportedFormat unless FONT_FORGE_SUPPORTED_FORMATS.include?(content.ext.downcase)

  content.shell_update(ext: 'woff') do |old_path, new_path|
    "#{woff_meta_script} #{old_path} #{new_path} #{Shellwords.escape(uniqueid)} #{Shellwords.escape(licensee_name)}"
  end
end

#update_url(attrs, *_args) ⇒ Object



15
16
17
# File 'lib/dragonfly_fonts/processors/set_woff_metadata.rb', line 15

def update_url(attrs, *_args)
  attrs.style = 'woffmeta'
end