michaeldv/awesome_print — Issue #70: conflict with gem colorize
Author: codeglot
Created: 2011-12-23 04:45:46+00:00
State: open

gem 'awesome_print'
gem 'colorize'

this creates a conflict

ruby-1.9.2-p180-mri :002 > ap Article.last
ArgumentError: wrong number of arguments (1 for 0)

Solution:

# Pick the color and apply it to the given string as necessary.
#------------------------------------------------------------------------------
def colorize(str, type)
debugger
str = CGI.escapeHTML(str) if @options[:html]
if @options[:plain] || !@options[:color][type] || !colorize?
@options[:html] ? "

#{s}

" : str
elsif !@options[:html] && @options[:color] && type
str.send(@options[:color][type], @options[:html])
else
str.send(@options[:color][type], @options[:html])
end
end