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

7 commits

Author SHA1 Message Date
Robert Gleeson
5db725eca6 implement Pry global and pry-local configuration.
maybe best explained with an example:
      [1] pry(main)> Pry.config.hi = "hi"
      => "hi"
      [2] pry(main)> _pry_.config.hi
      => "hi"
      [3] pry(main)> _pry_.config.x = 1
      => 1
      [4] pry(main)> Pry.config.x
      => nil
      [5] pry(main)>

'Pry.config' is an instance of Pry::Config::Default. it defines the initial
default configuration values an instance of 'Pry' is going to have. an instance
of 'Pry' uses an instance of Pry::Config who relies on Pry.config as a default
or fallback for keys it cannot find locally.

for example 'Pry.config.color = true' is seen by _all_ pry REPLs who are active
but _pry_.config.color = false is seen only by the REPL session being interacted
with. a number of "config shortcircuts" are still available, for example it is
possible to say `_pry_.input = StringIO.new` or `Pry.input = StringIO.new`. the
shortcuts are maintained for the Pry class and instances of the Pry class through
Pry::Config.shortcuts.

Pry::Config::Convenience adds a method called 'config_shortcuts' which can be used
to setup shortcut access to 'some_obj.config.blah' as 'some_obj.blah'

a lot of tests still fail, so work in progress.

this should help solve #1055.
2014-01-19 03:18:46 +01:00
Ryan Fitzgerald
3e31d01d0b Add rubysl-prettyprint to Gemfile for rbx 2013-11-23 18:23:34 -08:00
Ryan Fitzgerald
eb150b71d7 Fix specs on rbx-2.1.0 2013-11-23 18:11:29 -08:00
☈king
552b7e18e5 Avoid warning with warny rubygems 2013-02-26 07:27:51 -06:00
☈king
9e6269c1da Dev dep on 'jist' + better Guard deps 2012-12-06 22:45:07 -06:00
Ryan Fitzgerald
981f12ddc2 Add simple Guardfile 2012-09-08 20:27:41 -07:00
Shawn Anderson
f87c54bd79 added bundler gemfile 2011-09-13 11:39:04 -04:00