class Tapout::Config
Configuration.
TODO: Rename the ANSI options with a _color suffix,
or something to that effect.
Attributes
error[R]
ANSI err
fail[R]
ANSI fail
highlight[R]
ANSI highlight
lines[R]
omit[R]
ANSI omit
pass[R]
ANSI pass
todo[R]
ANSI todo
trace[R]
Public Class Methods
new()
click to toggle source
Initialize new Config
instance.
# File lib/tapout/config.rb, line 28 def initialize initialize_defaults end
Public Instance Methods
error=(ansi)
click to toggle source
# File lib/tapout/config.rb, line 116 def error=(ansi) @error = [ansi].flatten end
fail=(ansi)
click to toggle source
# File lib/tapout/config.rb, line 109 def fail=(ansi) @fail = [ansi].flatten end
highlight=(ansi)
click to toggle source
# File lib/tapout/config.rb, line 95 def highlight=(ansi) @highlight = [ansi].flatten end
initialize_defaults()
click to toggle source
Initialize defaults.
-
Default trace depth is 12.
-
Default snippet size is 3 (which means 7 total).
# File lib/tapout/config.rb, line 37 def initialize_defaults @trace = 12 @lines = 3 @minimal = false @highlight = [:bold] @fadelight = [:dark] @pass = [:green] @fail = [:red] @error = [:red] @todo = [:yellow] @omit = [:yellow] end
lines=(count)
click to toggle source
# File lib/tapout/config.rb, line 78 def lines=(count) @lines = count.to_i end
minimal=(boolean)
click to toggle source
# File lib/tapout/config.rb, line 88 def minimal=(boolean) @minimal = boolean ? true : false end
minimal?()
click to toggle source
# File lib/tapout/config.rb, line 83 def minimal? @minimal end
omit=(ansi)
click to toggle source
# File lib/tapout/config.rb, line 130 def omit=(ansi) @omit = [ansi].flatten end
pass=(ansi)
click to toggle source
# File lib/tapout/config.rb, line 102 def pass=(ansi) @pass = [ansi].flatten end
todo=(ansi)
click to toggle source
# File lib/tapout/config.rb, line 123 def todo=(ansi) @todo = [ansi].flatten end
trace=(depth)
click to toggle source
# File lib/tapout/config.rb, line 65 def trace=(depth) @trace = depth.to_i end
trace_depth()
click to toggle source
Alias for trace
.
# File lib/tapout/config.rb, line 70 def trace_depth @trace end
update(settings, &block)
click to toggle source
# File lib/tapout/config.rb, line 53 def update(settings, &block) settings.each do |k,v| __send__("#{k}=", v) end if settings block.call(self) if block self end