Class: Blacksmith

Inherits:
Object
  • Object
show all
Defined in:
lib/blacksmith.rb,
lib/blacksmith/version.rb

Defined Under Namespace

Classes: CSSForge, DependencyMissing, Error, Executable, Font, FontBuilder, FontForge, Glyph, HTMLForge, Point, TTFAutoHint

Constant Summary collapse

VERSION =
"0.3.2"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename = nil, &block) ⇒ Blacksmith

Returns a new instance of Blacksmith.



34
35
36
# File 'lib/blacksmith.rb', line 34

def initialize(filename = nil, &block)
  @font = FontBuilder.execute(filename, &block)
end

Class Method Details

.forge(*args, &block) ⇒ Object



20
21
22
# File 'lib/blacksmith.rb', line 20

def forge(*args, &block)
  new(*args, &block).forge
end

.root_directoryObject



24
25
26
# File 'lib/blacksmith.rb', line 24

def root_directory
  File.expand_path('../..', __FILE__)
end

.run(args = []) ⇒ Object



14
15
16
17
18
# File 'lib/blacksmith.rb', line 14

def run(args = [])
  if args.empty?
    new(File.join(Dir.pwd, 'Forgefile')).forge
  end
end

.support_directoryObject



28
29
30
# File 'lib/blacksmith.rb', line 28

def support_directory
  File.join(root_directory, 'support')
end

Instance Method Details

#forgeObject



38
39
40
41
42
43
44
45
46
# File 'lib/blacksmith.rb', line 38

def forge
  check_environment
  
  forge_font
  auto_hint_font
  convert_font
  forge_css
  forge_html
end