Module: Cutter::ColoredOutputs::ClassMethods

Included in:
Cutter::ColoredOutputs
Defined in:
lib/cutter/colored_outputs.rb

Instance Method Summary collapse

Instance Method Details

#colors {|colors_config| ... } ⇒ Object

Yields:



27
28
29
# File 'lib/cutter/colored_outputs.rb', line 27

def colors &block
  yield colors_config
end

#colors?Boolean

Returns:

  • (Boolean)


22
23
24
25
# File 'lib/cutter/colored_outputs.rb', line 22

def colors?
  @colors_state ||= :on
  @colors_state == :on
end

#colors_configObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/cutter/colored_outputs.rb', line 31

def colors_config
  @colors ||= {
                :line => :blue, 
                :time => :light_blue,

                :message_name => :cyan,
                :message_line => :cyan,
                :total_line => :yellow,
                :total_count => :yellow,
               
                # Colors for #inspect!
                #  :called_from => :light_magenta,
                :class_name => :light_green,
                :method => :red,
                :method_name => :yellow,
                
                # :source => :white,
                # :source_path => :white,
                # :source_number => :white,
                # :lv => :blue,
                # :lv_names => :magenta,
                # :lv_values => :light_red,
                # :iv => :cyan,
                :iv_names => :cyan,
                :iv_values => :light_blue,
                :self_inspection => :red,
                :self_inspection_trace => :blue,
                :caller_methods => :red,
                :caller_method => :green
              }
end

#turn_colors(state = :on) ⇒ Object



18
19
20
# File 'lib/cutter/colored_outputs.rb', line 18

def turn_colors state = :on
  @colors_state = state
end