Module: L43Rmap::Cli::Color

Included in:
L43Rmap::Cli
Defined in:
lib/l43_rmap/cli/color.rb

Instance Method Summary collapse

Instance Method Details

#arg(name) ⇒ Object



6
# File 'lib/l43_rmap/cli/color.rb', line 6

def arg(name) = [:bold, :blue, "<#{name}>", :reset]

#kwd(name) ⇒ Object



8
# File 'lib/l43_rmap/cli/color.rb', line 8

def kwd(name) = [" kwd ", :bold, :cyan, name, ":", :reset]

#named(field) ⇒ Object



10
# File 'lib/l43_rmap/cli/color.rb', line 10

def named(field) = [2, :bold, :blue, "%", field, :reset]

#puterr(*chunks) ⇒ Object



11
12
13
14
# File 'lib/l43_rmap/cli/color.rb', line 11

def puterr(*chunks)
  putcol(:red, :bold, "ERROR: ", :white, *chunks)
  false
end

#puthintObject



16
17
18
19
# File 'lib/l43_rmap/cli/color.rb', line 16

def puthint 
  putcol( :yellow, :bold, "HINT: ", :reset, :bold, "run ", :green, "rmap :help|:h ", :reset, :bold, "for details")
  false
end

#sexp(head, *args) ⇒ Object



21
22
23
24
# File 'lib/l43_rmap/cli/color.rb', line 21

def sexp(head, *args)
  args = ([" "] * args.size).zip(args.map {|a| arg(a)}).flatten
  [4, "(", :bold, :green, head, args, ")"]
end