Sha256: c8a0861b34403497ec96bd4b3d634ded40de1e59b4b9971a1147ce2d6d382fae

Contents?: true

Size: 414 Bytes

Versions: 1

Compression:

Stored size: 414 Bytes

Contents

class Knotify
  COMMAND = "dcop knotify default notify eventname"
  
  def message(text)
    @message = text
    self
  end
  
  def title(text)
    @title = text
    self
  end
  
  def to_s
    command = "#{COMMAND}"
    command << " '#{@title}'" if @title
    command << " '#{@message}'" if @message
    command << " '' ''"
    command << " 12 1"
    command
  end
  
  def notify!
    system(to_s)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
notifiers-1.1.0 lib/notifiers/knotify.rb