Sha256: 76f643eb1e26bdd40bfc9e40e3fa582bedc58e19680c41fdaea59b56549d9e3a

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

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

module Ramaze

  # Easy access to Inform

  module InformHelper

    private

    # The various (default) tags you can use are:
    #
    # :info  - just outputs whatever you give to it without modification.
    # :debug - applies #inspect to everything you pass
    # :error - can take normal strings or exception-objects
    #
    #
    # Usage:
    #
    #   inform :info, 'proceeding as planned'
    #   # [2007-04-04 23:38:39] INFO   proceeding as planned
    #
    #   inform :debug, [1,2,3]
    #   # [2007-04-04 23:38:39] DEBUG  [1, 2, 3]
    #
    #   inform :error, 'something bad happened'
    #   # [2007-04-04 23:38:39] ERROR  something bad happened
    #
    #   inform :error, exception
    #   # [2007-04-04 23:40:59] ERROR  #<RuntimeError: Some exception>
    #   # [2007-04-04 23:40:59] ERROR  hello.rb:23:in `index'
    #   # ... rest of backtrace ...

    def inform tag, *args
      Inform.send(tag, *args)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-0.3.0 lib/ramaze/helper/inform.rb
ramaze-0.3.5 lib/ramaze/helper/inform.rb