Parent

Included Modules

Class/Module Index [+]

Quicksearch

Test::Unit::ColorScheme

Public Class Methods

[](id) click to toggle source
# File lib/test/unit/color-scheme.rb, line 45
def [](id)
  @@schemes[id.to_s]
end
[]=(id, scheme_or_spec) click to toggle source
# File lib/test/unit/color-scheme.rb, line 49
def []=(id, scheme_or_spec)
  if scheme_or_spec.is_a?(self)
    scheme = scheme_or_spec
  else
    scheme = new(scheme_or_spec)
  end
  @@schemes[id.to_s] = scheme
end
all() click to toggle source
# File lib/test/unit/color-scheme.rb, line 41
def all
  @@schemes.merge("default" => default)
end
default() click to toggle source
# File lib/test/unit/color-scheme.rb, line 10
def default
  @@default ||= new("pass" =>
                      Color.new("green", :foreground => false) +
                      Color.new("white", :bold => true),
                    "failure" =>
                      Color.new("red", :foreground => false) +
                      Color.new("white", :bold => true),
                    "pending" => Color.new("magenta", :bold => true),
                    "omission" => Color.new("blue", :bold => true),
                    "notification" => Color.new("cyan", :bold => true),
                    "error" => Color.new("yellow", :bold => true) +
                               Color.new("black", :foreground => false),
                    "case" => Color.new("white", :bold => true) +
                               Color.new("blue", :foreground => false),
                    "suite" => Color.new("white", :bold => true) +
                               Color.new("green", :foreground => false),
                    "diff-inserted-tag" =>
                       Color.new("red", :bold => true),
                    "diff-deleted-tag" =>
                       Color.new("green", :bold => true),
                    "diff-difference-tag" =>
                       Color.new("cyan", :bold => true),
                    "diff-inserted" =>
                       Color.new("red", :foreground => false) +
                       Color.new("white", :bold => true),
                    "diff-deleted" =>
                       Color.new("green", :foreground => false) +
                       Color.new("white", :bold => true))
end
new(scheme_spec) click to toggle source
# File lib/test/unit/color-scheme.rb, line 59
def initialize(scheme_spec)
  @scheme = {}
  scheme_spec.each do |key, color_spec|
    self[key] = color_spec
  end
end

Public Instance Methods

[](name) click to toggle source
# File lib/test/unit/color-scheme.rb, line 66
def [](name)
  @scheme[name.to_s]
end
[]=(name, color_spec) click to toggle source
# File lib/test/unit/color-scheme.rb, line 70
def []=(name, color_spec)
  @scheme[name.to_s] = make_color(color_spec)
end
each(&block) click to toggle source
# File lib/test/unit/color-scheme.rb, line 74
def each(&block)
  @scheme.each(&block)
end
to_hash() click to toggle source
# File lib/test/unit/color-scheme.rb, line 78
def to_hash
  hash = {}
  @scheme.each do |key, color|
    hash[key] = color
  end
  hash
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.