15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/ripl/color_result.rb', line 15
def format_result(result)
return super if !config[:color_result_engine]
@result_prompt + case config[:color_result_engine].to_sym
when :coderay
require 'coderay' unless defined?(CodeRay)
CodeRay.scan( result.inspect, :ruby ).term
when :ap, :awesome_print
require 'ap' unless defined?(AwesomePrint)
result.awesome_inspect( config[:color_result_ap_options] || {} )
else require 'wirb' unless defined?(Wirb)
Wirb.start unless Wirb.running?
Wirb.colorize_result result.inspect, Ripl.config[:color_result_default_schema]
end
end
|