Object
add padding to the left of an action that was performed.
# File lib/compass/logger.rb, line 82 def action_padding(action) ' ' * [(max_action_length - action.to_s.length), 0].max end
# File lib/compass/logger.rb, line 60 def color(c) if Compass.configuration.color_output && c && COLORS.has_key?(c.to_sym) if defined?($boring) && $boring "" else "\e[#{COLORS[c.to_sym]}m" end else "" end end
Emit a log message
# File lib/compass/logger.rb, line 77 def log(msg) puts msg end
the maximum length of all the actions known to the logger.
# File lib/compass/logger.rb, line 87 def max_action_length @max_action_length ||= actions.inject(0){|memo, a| [memo, a.to_s.length].max} end
Record an action that has occurred
# File lib/compass/logger.rb, line 33 def record(action, *arguments) msg = "" msg << color(ACTION_COLORS[action]) if Compass.configuration.color_output msg << "#{action_padding(action)}#{action}" msg << color(:clear) if Compass.configuration.color_output msg << " #{arguments.join(' ')}" log msg end
Generated with the Darkfish Rdoc Generator 2.