mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Reform config hash to not require re-aligning.
Change to not require to re-aline, whenever we add a long key. see https://github.com/pry/pry/pull/1218. Thanks to kyrylo.
This commit is contained in:
parent
8df4864c00
commit
0788e77920
1 changed files with 106 additions and 36 deletions
|
@ -2,42 +2,112 @@ class Pry::Config::Default
|
||||||
include Pry::Config::Behavior
|
include Pry::Config::Behavior
|
||||||
|
|
||||||
default = {
|
default = {
|
||||||
:input => proc { lazy_readline },
|
input: proc {
|
||||||
:output => proc { $stdout },
|
lazy_readline
|
||||||
:commands => proc { Pry::Commands },
|
},
|
||||||
:prompt_name => proc { Pry::DEFAULT_PROMPT_NAME },
|
output: proc {
|
||||||
:prompt => proc { Pry::DEFAULT_PROMPT },
|
$stdout
|
||||||
:prompt_safe_objects => proc { Pry::DEFAULT_PROMPT_SAFE_OBJECTS },
|
},
|
||||||
:print => proc { Pry::DEFAULT_PRINT },
|
commands: proc {
|
||||||
:quiet => proc { false },
|
Pry::Commands
|
||||||
:exception_handler => proc { Pry::DEFAULT_EXCEPTION_HANDLER },
|
},
|
||||||
:exception_whitelist => proc { Pry::DEFAULT_EXCEPTION_WHITELIST },
|
prompt_name: proc {
|
||||||
:hooks => proc { Pry::DEFAULT_HOOKS },
|
Pry::DEFAULT_PROMPT_NAME
|
||||||
:pager => proc { true },
|
},
|
||||||
:system => proc { Pry::DEFAULT_SYSTEM },
|
prompt: proc {
|
||||||
:color => proc { Pry::Helpers::BaseHelpers.use_ansi_codes? },
|
Pry::DEFAULT_PROMPT
|
||||||
:default_window_size => proc { 5 },
|
},
|
||||||
:editor => proc { Pry.default_editor_for_platform }, # TODO: Pry::Platform.editor
|
prompt_safe_objects: proc {
|
||||||
:should_load_rc => proc { true },
|
Pry::DEFAULT_PROMPT_SAFE_OBJECTS
|
||||||
:should_load_local_rc => proc { true },
|
},
|
||||||
:should_trap_interrupts => proc { Pry::Helpers::BaseHelpers.jruby? }, # TODO: Pry::Platform.jruby?
|
print: proc {
|
||||||
:disable_auto_reload => proc { false },
|
Pry::DEFAULT_PRINT
|
||||||
:command_prefix => proc { "" },
|
},
|
||||||
:auto_indent => proc { Pry::Helpers::BaseHelpers.use_ansi_codes? },
|
quiet: proc {
|
||||||
:correct_indent => proc { true },
|
false
|
||||||
:collision_warning => proc { false },
|
},
|
||||||
:output_prefix => proc { "=> "},
|
exception_handler: proc {
|
||||||
:requires => proc { [] },
|
Pry::DEFAULT_EXCEPTION_HANDLER
|
||||||
:should_load_requires => proc { true },
|
},
|
||||||
:should_load_plugins => proc { true },
|
exception_whitelist: proc {
|
||||||
:windows_console_warning => proc { true },
|
Pry::DEFAULT_EXCEPTION_WHITELIST
|
||||||
:control_d_handler => proc { Pry::DEFAULT_CONTROL_D_HANDLER },
|
},
|
||||||
:memory_size => proc { 100 },
|
hooks: proc {
|
||||||
:extra_sticky_locals => proc { {} },
|
Pry::DEFAULT_HOOKS
|
||||||
:command_completions => proc { proc { commands.keys } },
|
},
|
||||||
:file_completions => proc { proc { Dir["."] } },
|
pager: proc {
|
||||||
:ls => proc { Pry::Config.from_hash(Pry::Command::Ls::DEFAULT_OPTIONS) },
|
true
|
||||||
:completer => proc {
|
},
|
||||||
|
system: proc {
|
||||||
|
Pry::DEFAULT_SYSTEM
|
||||||
|
},
|
||||||
|
color: proc {
|
||||||
|
Pry::Helpers::BaseHelpers.use_ansi_codes?
|
||||||
|
},
|
||||||
|
default_window_size: proc {
|
||||||
|
5
|
||||||
|
},
|
||||||
|
editor: proc {
|
||||||
|
Pry.default_editor_for_platform
|
||||||
|
}, # TODO: Pry::Platform.editor
|
||||||
|
should_load_rc: proc {
|
||||||
|
true
|
||||||
|
},
|
||||||
|
should_load_local_rc: proc {
|
||||||
|
true
|
||||||
|
},
|
||||||
|
should_trap_interrupts: proc {
|
||||||
|
Pry::Helpers::BaseHelpers.jruby?
|
||||||
|
}, # TODO: Pry::Platform.jruby?
|
||||||
|
disable_auto_reload: proc {
|
||||||
|
false
|
||||||
|
},
|
||||||
|
command_prefix: proc {
|
||||||
|
""
|
||||||
|
},
|
||||||
|
auto_indent: proc {
|
||||||
|
Pry::Helpers::BaseHelpers.use_ansi_codes?
|
||||||
|
},
|
||||||
|
correct_indent: proc {
|
||||||
|
true
|
||||||
|
},
|
||||||
|
collision_warning: proc {
|
||||||
|
false
|
||||||
|
},
|
||||||
|
output_prefix: proc {
|
||||||
|
"=> "
|
||||||
|
},
|
||||||
|
requires: proc {
|
||||||
|
[]
|
||||||
|
},
|
||||||
|
should_load_requires: proc {
|
||||||
|
true
|
||||||
|
},
|
||||||
|
should_load_plugins: proc {
|
||||||
|
true
|
||||||
|
},
|
||||||
|
windows_console_warning: proc {
|
||||||
|
true
|
||||||
|
},
|
||||||
|
control_d_handler: proc {
|
||||||
|
Pry::DEFAULT_CONTROL_D_HANDLER
|
||||||
|
},
|
||||||
|
memory_size: proc {
|
||||||
|
100
|
||||||
|
},
|
||||||
|
extra_sticky_locals: proc {
|
||||||
|
{}
|
||||||
|
},
|
||||||
|
command_completions: proc {
|
||||||
|
proc { commands.keys }
|
||||||
|
},
|
||||||
|
file_completions: proc {
|
||||||
|
proc { Dir["."] }
|
||||||
|
},
|
||||||
|
ls: proc {
|
||||||
|
Pry::Config.from_hash(Pry::Command::Ls::DEFAULT_OPTIONS)
|
||||||
|
},
|
||||||
|
completer: proc {
|
||||||
require "pry/input_completer"
|
require "pry/input_completer"
|
||||||
Pry::InputCompleter
|
Pry::InputCompleter
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue