Sha256: 3cf34a8d008eb4fb41efadba9b161834b686cc861ae856b91b17ab7c37dc68d8

Contents?: true

Size: 707 Bytes

Versions: 9

Compression:

Stored size: 707 Bytes

Contents

module Ninjs
  class Notification
    @@growl_support = false
    @@indicators = {
      none: "",
      log: "\e[32m>>>\e[0m ",
      event: "\e[33m<<<\e[0m ",
      added: "\e[32m+++\e[0m ",
      error: "\e[0;31m!!!\e[0m "
    }
    
    def self.notify(message, style)
      @@indicators[style] + message
    end
    
    def self.notice(message)
      self.notify(message, :none)
    end
    
    def self.log(message)
      self.notify(message, :log)
    end
    
    def self.event(message)
      self.notify(message, :event)
    end
    
    def self.added(message)
      self.notify(message, :added)
    end
    
    def self.error(message)
      self.notify(message, :error)
    end
    
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ninjs-0.16.8 lib/ninjs/notification.rb
ninjs-0.16.7 lib/ninjs/notification.rb
ninjs-0.16.6 lib/ninjs/notification.rb
ninjs-0.16.5 lib/ninjs/notification.rb
ninjs-0.16.4 lib/ninjs/notification.rb
ninjs-0.16.3 lib/ninjs/notification.rb
ninjs-0.16.2 lib/ninjs/notification.rb
ninjs-0.16.1 lib/ninjs/notification.rb
ninjs-0.16.0 lib/ninjs/notification.rb