Sha256: 6303b2b076dbcda90dc99d44263ac4368893111088e41f74825c9f378b9b1f30

Contents?: true

Size: 967 Bytes

Versions: 2

Compression:

Stored size: 967 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'xosd'

module Ramaze

  class Xosd < ::Xosd
    include Informing

    trait :timeout => 3
    trait :lines => 3

    trait :colors => {
      :error => "#FF0000",
      :info => "#00FF00",
      :warn => "#EAA61E",
      :debug => "#FFFFFF"
    }

    def initialize
      super(class_trait[:lines])

      self.font            = "-*-*-*-*-*-*-24-*-*-*-*-*-*-*"
      self.align           = 'center'
      self.color           = '#FFFFFF'
      self.valign          = 'top'
      self.timeout         = class_trait[:timeout]
      self.outline_color   = "#000000"
      self.outline_width   = 1
      self.vertical_offset = 20
    end

    def inform(tag, *args)
      self.color = class_trait[:colors][tag.to_sym]

      args.each_with_index do |arg, i|
        display(arg, i)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-0.1.1 lib/ramaze/inform/xosd.rb
ramaze-0.1.0 lib/ramaze/inform/xosd.rb