Sha256: ae1093d8884c2cb5c5f5e251aec4c64a0a395226d15976379c4be46f4a2d38fe

Contents?: true

Size: 869 Bytes

Versions: 2

Compression:

Stored size: 869 Bytes

Contents

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

module Ramaze
  module Logger
    ##
    # Informer for the Knotify notfication system used on KDE.
    # Doesn't need any special libraries.
    #
    class Knotify
      include Logging

      trait :present => 16

      ##
      # Please see for more information on the API used here:
      # http://lukeplant.me.uk/articles.php?id=3
      #
      # @param [String] tag
      # @param [Hash] args
      #
      def log(tag, *messages)
        present = class_trait[:present]
        tag = tag.to_s.capitalize
        messages.flatten.each do |message|
          system(%{dcop knotify default notify Ramaze "#{tag}" "#{message}" '' '' #{present} 0})
        end
      end
    end # Knotify
  end # Logger
end # Ramaze

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-2012.04.14 lib/ramaze/log/knotify.rb
ramaze-2012.03.07 lib/ramaze/log/knotify.rb