/usr/lib/ruby/vendor_ruby/pry/commands/ls/local_names.rb is in pry 0.10.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | class Pry
class Command::Ls < Pry::ClassCommand
class LocalNames < Pry::Command::Ls::Formatter
def initialize(no_user_opts, args, _pry_)
super(_pry_)
@no_user_opts = no_user_opts
@args = args
@sticky_locals = _pry_.sticky_locals
end
def correct_opts?
super || (@no_user_opts && @args.empty?)
end
def output_self
local_vars = grep.regexp[@target.eval('local_variables')]
output_section('locals', format(local_vars))
end
private
def format(locals)
locals.sort_by(&:downcase).map do |name|
if @sticky_locals.include?(name.to_sym)
color(:pry_var, name)
else
color(:local_var, name)
end
end
end
end
end
end
|