Class: Blacksmith::FontForge

Inherits:
Executable show all
Defined in:
lib/blacksmith/font_forge.rb

Instance Method Summary collapse

Methods inherited from Executable

#check_dependency!, #installed?, method_missing

Instance Method Details

#executableObject



3
4
5
# File 'lib/blacksmith/font_forge.rb', line 3

def executable
  'fontforge'
end

#execute(file_or_instructions) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/blacksmith/font_forge.rb', line 7

def execute(file_or_instructions)
  check_dependency!
  
  case file_or_instructions
  when String
    with_temporary_instuctions_file(file_or_instructions) do |path|
      execute!(path)
    end
  when File
    path = file_or_instructions.path
    execute!(path)
  else
    raise ArgumentError, "FontForge#execute expects a File or String"
  end
end