mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
b9cddb5609
the list-inspectors command shows a list of available inspectors as well as the active inspectors in the list. inspectors are drawn with a name as well as a short description. change-inspector can be used to change the inspector by the name found in the list-inspectors command. an inspector in pry is something that prints a return value in a repl session. i'm not crazy about the name `inspector` but the traditional name used in pry(`print`) didn't fit well. some discussion led us to `inspector` for lack of a better word, see #1176 on github for discussion
27 lines
841 B
Ruby
27 lines
841 B
Ruby
class Pry::Inspector
|
|
MAP = {
|
|
"default" => {
|
|
value: Pry::DEFAULT_PRINT,
|
|
description: <<-DESCRIPTION.each_line.map(&:lstrip!)
|
|
the default pry inspector. it has paging and color support, and uses pretty_inspect
|
|
when printing an object.
|
|
DESCRIPTION
|
|
},
|
|
|
|
"simple" => {
|
|
value: Pry::SIMPLE_PRINT,
|
|
description: <<-DESCRIPTION.each_line.map(&:lstrip)
|
|
a simple inspector that uses #puts and #inspect when printing an object.
|
|
it has no pager, color, or pretty_inspect support.
|
|
DESCRIPTION
|
|
},
|
|
|
|
"clipped" => {
|
|
value: Pry::CLIPPED_PRINT,
|
|
description: <<-DESCRIPTION.each_line.map(&:lstrip)
|
|
the clipped inspector has the same features as the 'simple' inspector but prints
|
|
large objects as a smaller string.
|
|
DESCRIPTION
|
|
}
|
|
}
|
|
end
|