Module: Rextra::Debug::DebugHelper

Defined in:
lib/rextra/debug.rb

Class Method Summary collapse

Class Method Details

.output(*args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rextra/debug.rb', line 11

def self.output *args
  outs = [STDERR]
  #outs << logger if defined? RAILS_ENV # FIXME
  args.each do |arg|
    outs.each do |out|
      out.puts(
        if defined? Term::ANSIColor
          Term::ANSIColor::green { arg.to_s }
        else
          arg.to_s
        end
      )
    end
  end
end

.prepareObject



6
7
8
9
# File 'lib/rextra/debug.rb', line 6

def self.prepare
  output("\n" + Term::ANSIColor::yellow{ '_/\\_' * 20 }) if
    (require('term/ansicolor') rescue nil)
end