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

10 commits

Author SHA1 Message Date
r-obert
b5538b8501
Remove unnecessary classes / modules used by config (#1897)
* Remove` Pry::Config::Default`

* Remove `Pry::Config::Memoization`

* Remove confusing use of `instance_eval`

* Add `Pry::Config.defaults`
  Returns an instance of `Pry::Config`, initialized with Pry defaults.
  Replaces the previous role of `Pry::Config::Default`.
2018-12-01 08:51:52 +01:00
robert
c8f23b3464 automatically call Pry::Config::Lazy objects before returning them.
The pry-rails prompt uses `pry.config.prompt_name` but assumes it
will always be a string and never tries to `.call` the object, which means
we can end up with a prompt like this:

    [2] [vagrant][development] #<Pry::Config::Lazy:0x000000000fde07b0>(main)>

This commit solves the problem for pry-rails and other prompts who make
the same mistake by calling `.call` for them, automatically, upon read from
a config object.

The commit also removes the issue where every prompt has to deal with `prompt_name`
being a string / Proc-like object then acting accordingly.
2018-11-20 14:10:21 +01:00
robert
5e613045f3 rubcop fixes 2018-11-18 01:33:52 +01:00
robert
2e77969bbb do not dup Pry::Config::Lazy objects on read from default. 2018-11-18 01:31:33 +01:00
r-obert
505cccf691 rename Pry::Config::Lazy to Pry::Config::Memoization (ref #1503) 2017-06-23 06:18:19 +01:00
strcmp
c584d173a1 fix 'at least one lazy method has to be called before #lazy_keys could ..' 2015-12-31 16:02:34 -08:00
strcmp
983daf6fd5 rename module 2015-12-29 06:50:49 +00:00
strcmp
ba34c6a4cb use the more common approach to assigning key default of [] 2015-12-29 02:33:40 +00:00
strcmp
bf057cc348 fix return value of lazy method 2015-12-28 11:54:22 +00:00
strcmp
2e00481ab7 make 'Pry::Config::Default' less of a special case by adding Pry::Config::Lazy 2015-12-28 11:33:12 +00:00