1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Commit graph

14 commits

Author SHA1 Message Date
Kyrylo Silin
d5c071fcd5
Merge pull request #1857 from r-obert/syntax-highlightable-prompt.rb
fix syntax highlighting of prompt.rb on Github & multiple editors
2018-11-11 16:05:48 +08:00
robert
cf2189351a fix syntax hightlighting of prompt.rb on GitHub & multiple editors. 2018-11-10 17:15:36 +01:00
Kyrylo Silin
28b6f5f7de prompt: delete deprecated MAP constant 2018-11-08 14:45:29 +08:00
robert
2ffb29aa14 do not create a new hash each time a prompt is accessed via Pry::Prompt[]
currently upon calling Pry::Prompt[:foo] a new Hash is created, and on all
subsequent calls a new Hash is also created. it's wasteful and careless,
so let's fix it.
2018-11-05 14:13:35 +01:00
Kyrylo Silin
60f20f8857 commands/change_prompt: incorporate 'list_prompts' functionality
Fixes #1829 (Merge `list-prompts` and `change-prompt` into one command)
2018-11-04 05:16:32 +08:00
Kyrylo Silin
54ccb43177 prompt: deprecate Pry::Prompt::MAP 2018-11-04 02:11:17 +08:00
Kyrylo Silin
3da930f908 prompt: add basic API for adding prompts
Fixes #1836 (Add an API for adding new prompts)
2018-11-04 02:11:15 +08:00
Kyrylo Silin
ace907b1b1 prompt: make it possible to set name dynamically
Fixes #1738 (Possible to make prompt_name dynamic?)

The user-facing API is the following:

```rb
Pry.config.prompt_name = Pry.lazy { rand(100) }

[1] 80(main)>
[2] 87(main)>
[3] 30(main)>
```
2018-10-28 19:02:14 +08:00
Kyrylo Silin
456f251675 prompt: refactor to reduce duplication
Since we always need to define two procs that look almost the same, duplication
was unavoidable. With help of method wrappers around procs we can reduce it.

As a bonus, the class has some YARD annotations now.
2018-10-28 16:21:56 +08:00
Kyrylo Silin
3deeeee115 config/default: rename prompt_safe_objects to prompt_safe_contexts
It makes sense to rename it because "objects" we are referring in the context of
prompt are actually prompt "contexts".
2018-10-28 16:07:44 +08:00
Kyrylo Silin
23a4ac6f0b Move prompt related code from pry.rb to prompt.rb
It makes a lot more sense to keep these procs under the `Pry::Prompt` namespace
than `Pry`, which is already heavily populated by other various things.
2018-10-28 05:35:27 +08:00
Kyrylo Silin
ae531ac738 prompt: use explicit nesting for class definition
Per https://github.com/rubocop-hq/ruby-style-guide#namespace-definition
2018-10-28 05:04:13 +08:00
Ryan Fitzgerald
20cdc22917 Various copy changes
Improves consistency of capitalization and punctuation across various
help text, plus some rewording and consolidating command groups.
2014-05-05 00:50:44 -07:00
Robert Gleeson
e617c7d420 add 'list-prompts' and 'change-prompt' commands.
the list-prompts command shows a list of available prompts as well
as the active prompt in the list. prompts are drawn with a name as
well as a short description.

change-prompt can be used to change the prompt by the name found in
the list-prompts command.
2014-03-19 14:53:28 +01:00