Top Level Namespace

Defined Under Namespace

Modules: Kernel, RubyText

Constant Summary collapse

X =

shorthand

Curses

Instance Method Summary collapse

Instance Method Details

#debug(*args) ⇒ Object



3
4
5
6
# File 'lib/output.rb', line 3

def debug(*args)
  return unless $debug
  $debug.puts *args
end

#fb2cp(fg, bg) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/output.rb', line 8

def fb2cp(fg, bg)
  fg ||= :blue
  bg ||= :white
  f2 = X.const_get("COLOR_#{fg.upcase}")
  b2 = X.const_get("COLOR_#{bg.upcase}")
  cp = $ColorPairs[[fg, bg]]
  [f2, b2, cp]
end

#import(meth, recv) ⇒ Object



26
27
28
29
30
# File 'lib/rubytext.rb', line 26

def import(meth, recv)
  Kernel.module_eval do
    define_method(meth) {|*args| recv.send(meth, *args) }
  end
end