Module: Hieroglyph

Defined in:
lib/hieroglyph.rb,
lib/hieroglyph/font.rb,
lib/hieroglyph/glyph.rb,
lib/hieroglyph/version.rb,
lib/hieroglyph/noop_sheet.rb,
lib/hieroglyph/command_line.rb,
lib/hieroglyph/character_sheet.rb

Defined Under Namespace

Classes: CharacterSheet, CommandLine, Font, Glyph, NoopSheet

Constant Summary collapse

VERSION =
'0.1.5'

Class Method Summary collapse

Class Method Details

.colorize(str, color_code, pad) ⇒ Object



9
10
11
# File 'lib/hieroglyph.rb', line 9

def self.colorize(str, color_code, pad)
  Hieroglyph.log("\e[#{color_code}m#{str}\e[0m", pad)
end

.delete(file) ⇒ Object



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

def self.delete(file)
  if File.exist? file
    trimmed_file = file.gsub(/\.\//, '')
    Hieroglyph.status "#{trimmed_file} exists, deleting"
    File.delete file
  end
end

.error(str, pad = 2) ⇒ Object



22
23
24
# File 'lib/hieroglyph.rb', line 22

def self.error(str, pad=2)
  colorize(str, 31, pad)
end

.header(str) ⇒ Object



13
14
15
16
# File 'lib/hieroglyph.rb', line 13

def self.header(str)
  Hieroglyph.log
  Hieroglyph.log("\033[1m#{str}\e[22m", 0)
end

.imagemagick_installed?Boolean

Returns:

  • (Boolean)


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

def self.imagemagick_installed?
  ::IMAGEMAGICK_INSTALLED
end

.log(str = "", pad = 2) ⇒ Object



5
6
7
# File 'lib/hieroglyph.rb', line 5

def self.log(str="", pad=2)
  puts str.rjust(str.length + pad)
end

.make(options) ⇒ Object



30
31
32
# File 'lib/hieroglyph.rb', line 30

def self.make(options)
  Font.new(options)
end

.status(str, pad = 2) ⇒ Object



18
19
20
# File 'lib/hieroglyph.rb', line 18

def self.status(str, pad=2)
  colorize(str, 33, pad)
end

.success(str, pad = 2) ⇒ Object



26
27
28
# File 'lib/hieroglyph.rb', line 26

def self.success(str, pad=2)
  colorize(str, 32, pad)
end