From 50a1d0bcd0a4757166e3dee7f09ad3e09d22a637 Mon Sep 17 00:00:00 2001 From: John Mair Date: Wed, 3 Aug 2011 09:29:07 +1100 Subject: [PATCH] migrating ls command away from array output --- lib/pry/default_commands/ls.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/pry/default_commands/ls.rb b/lib/pry/default_commands/ls.rb index 81e8d10b..25168477 100644 --- a/lib/pry/default_commands/ls.rb +++ b/lib/pry/default_commands/ls.rb @@ -181,11 +181,7 @@ Shows local and instance variables by default. if !v.first.empty? text << "#{k}:\n--\n" filtered_list = v.first.grep options[:grep] - if Pry.color - text << CodeRay.scan(Pry.view(filtered_list), :ruby).term + "\n" - else - text << Pry.view(filtered_list) + "\n" - end + text << text().bright_green(filtered_list.join(" ")) text << "\n\n" end end @@ -201,11 +197,10 @@ Shows local and instance variables by default. list = info.values.sort_by(&:last).map(&:first).inject(&:+) list = list.grep(options[:grep]) if list list.uniq! if list - if Pry.color - text << CodeRay.scan(list.inspect, :ruby).term + "\n" - else - text << list.inspect + "\n" - end + + list = [] if !list + text << text().bright_green(list.join(" ")) + if !options[:f] stagger_output(text) else