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

21 commits

Author SHA1 Message Date
Ryan Fitzgerald
87f8ac439e Initialize History lazily, make it work without Readline 2014-02-02 19:51:39 -08:00
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
Kohei Suzuki
d1e2c7f0ae ~/.pry_history should not be world-readable 2013-05-26 18:53:32 +09:00
Kyrylo Silin
6463387d07 History: increment @original_lines
Fix broken `Pry::History#session_line_count`. Add a test.
2013-03-17 10:18:52 +02:00
Ryan Fitzgerald
c1f8c3f954 History doc tweaks and other misc faffing 2012-12-28 17:50:06 -08:00
Conrad Irwin
e378f023d4 Re-instate linewise saver 2012-12-28 17:35:37 -08:00
Conrad Irwin
3ee084e5e2 Un-break pusher abstraction 2012-12-28 17:28:08 -08:00
Conrad Irwin
dd1cf6b064 Remove unused method 2012-12-28 17:22:41 -08:00
Conrad Irwin
09160e7906 write to history incrementally
This makes it less essential for drivers to finalize the pry instance.
2012-12-28 16:57:30 -08:00
John Mair
c3d27d9f31 passing extra prompt data via an OpenStruct 2012-07-13 02:53:19 +12:00
Ryan Fitzgerald
493c085888 Fix all warnings on startup in 1.9.3 2012-05-28 16:37:32 -07:00
Jordon Bedwell
9dc32f09c3 Make sure the expand_path in read_from_file is in the rescue too. 2012-03-05 05:21:54 -06:00
Jordon Bedwell
db03696bfc Don't use File.writeable? rescue instead and only for Errno::EACCESS. 2012-03-05 05:17:01 -06:00
Jordon Bedwell
112c8ee6d9 Fix my horrible spelling. Thanks @banister.
Signed-off-by: Jordon Bedwell <jordon@envygeeks.com>
2012-02-22 11:49:35 -06:00
Jordon Bedwell
43f3e15efe Send a warning just incase there is an error in ~/.pryrc.
Signed-off-by: Jordon Bedwell <jordon@envygeeks.com>
2012-02-21 21:46:33 -06:00
Jordon Bedwell
c97ecf0b25 Don't save history if we can't write, don't load if we can't read.
Fixes: #466.
Signed-off-by: Jordon Bedwell <jordon@envygeeks.com>
2012-02-15 05:33:15 -06:00
Ryan Fitzgerald
3ae259b2b7 clean up history tests a bit 2011-12-01 21:26:22 -08:00
Ryan Fitzgerald
dabe9c50da modularize History reading, writing, and readline integration 2011-12-01 21:03:48 -08:00
Ryan Fitzgerald
58f9c8b726 fix command history to work with indentation 2011-10-09 01:42:21 -07:00
Ryan Fitzgerald
100c9ab9ee add documentation for History 2011-09-05 13:58:33 -07:00
Ryan Fitzgerald
1c05331873 move input_history.rb to history.rb 2011-09-05 02:00:14 -07:00
Renamed from lib/pry/input_history.rb (Browse further)