class Minitest::Emoji

Constants

VERSION

Attributes

chars[R]
io[R]

Public Class Methods

add_theme(name, chars) click to toggle source
# File lib/minitest/emoji_plugin.rb, line 61
def self.add_theme name, chars
  self.themes[name.to_sym] = chars
end
add_utf_theme(name, p=0x1f49a, f=0x1f4a9, e=0x1f525, s=0x1f633) click to toggle source
# File lib/minitest/emoji_plugin.rb, line 65
def self.add_utf_theme name, p=0x1f49a, f=0x1f4a9, e=0x1f525, s=0x1f633
  p, f, e, s = [p, f, e, s].pack("U*").chars.map { |c| "#{c} " }
  add_theme name, "." => p, "E" => e, "F" => f, "S" => s
end
copy_theme(to, from) click to toggle source
# File lib/minitest/emoji_plugin.rb, line 70
def self.copy_theme to, from
  themes[to] = themes[from]
end
emoji!() click to toggle source
# File lib/minitest/emoji_plugin.rb, line 37
def self.emoji!
  @emoji = true
end
emoji?() click to toggle source
# File lib/minitest/emoji_plugin.rb, line 41
def self.emoji?
  @emoji ||= false
end
new(io) click to toggle source
# File lib/minitest/emoji_plugin.rb, line 104
def initialize io
  @io    = io
  @chars = self.class.theme
end
show_all_themes() click to toggle source
# File lib/minitest/emoji_plugin.rb, line 98
def self.show_all_themes
  themes.each do |n, c|
    puts "%10s: %s%s%s%s" % [n, c["."], c["F"], c["E"], c["S"] ]
  end
end
theme() click to toggle source
# File lib/minitest/emoji_plugin.rb, line 53
def self.theme
  @theme ||= self.themes[:default]
end
theme!(name) click to toggle source
# File lib/minitest/emoji_plugin.rb, line 45
def self.theme! name
  unless self.themes.include? name.to_sym
    puts "Theme #{name} not found."
    exit 1
  end
  @theme ||= self.themes[name.to_sym]
end
themes() click to toggle source
# File lib/minitest/emoji_plugin.rb, line 57
def self.themes
  @themes ||= {}
end

Public Instance Methods

method_missing(msg, *args) click to toggle source
Calls superclass method
# File lib/minitest/emoji_plugin.rb, line 113
def method_missing msg, *args
  return super unless io.respond_to? msg
  io.send(msg, *args)
end
print(o) click to toggle source