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:



33
34
35
# File 'lib/cutter/colored_outputs.rb', line 33

def colors &block
  yield colors_config
end

#colors?Boolean

Returns:

  • (Boolean)


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

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

#colors_configObject



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
62
63
64
65
66
67
68
69
# File 'lib/cutter/colored_outputs.rb', line 37

def colors_config
  @colors ||= {
                # Colors for #stamper
                :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



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

def turn_colors state = :on
  @colors_state = state
end