mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
7bf25494e2
Because we were defining `quiet?` on Pry::Config::Default, calls to it would always delegate to the default config object and then return false. To make it possible to enable quiet mode, we need the transformation from `quiet?` to `quiet` to happen earlier. The simplest way to accomplish this is just to define the `quiet?` method explicitly.
25 lines
605 B
Ruby
25 lines
605 B
Ruby
module Pry::Config::Convenience
|
|
SHORTCUTS = [
|
|
:input,
|
|
:output,
|
|
:commands,
|
|
:print,
|
|
:exception_handler,
|
|
:hooks,
|
|
:color,
|
|
:pager,
|
|
:editor,
|
|
:memory_size,
|
|
:extra_sticky_locals
|
|
]
|
|
|
|
|
|
def config_shortcut(*names)
|
|
names.each do |name|
|
|
reader = name
|
|
setter = "#{name}="
|
|
define_method(reader) { config.public_send(name) }
|
|
define_method(setter) { |value| config.public_send(setter, value) }
|
|
end
|
|
end
|
|
end
|