Merge branch 'master' into pry-lazy

This commit is contained in:
strcmp 2015-12-28 13:49:17 +00:00
commit 6cbaf40969
3 changed files with 26 additions and 0 deletions

View File

@ -1,4 +1,5 @@
### HEAD
* Add `Pry.configure` as an alternative to the current way of changing configuration options in `.pryrc` files. [#1502](https://github.com/pry/pry/pull/1502)
* Add `Pry::Config::Behavior#eager_load!` to add a possible workaround for issues like [#1501](https://github.com/pry/pry/issues/1501)
* Remove Slop as a runtime dependency by vendoring v3.4 as Pry::Slop.
People can depend on Slop v4 and Pry at the same time without running into version conflicts. ([#1497](https://github.com/pry/pry/issues/1497))

View File

@ -32,6 +32,21 @@ class Pry
def history
@history ||= History.new
end
#
# @example
# Pry.configure do |config|
# config.eager_load! # optional
# config.input = # ..
# config.foo = 2
# end
#
# @yield [config]
# Yields a block with {Pry.config} as its argument.
#
def configure
yield config
end
end
#

View File

@ -5,6 +5,16 @@ describe Pry do
@str_output = StringIO.new
end
describe ".configure" do
it "yields a block with Pry.config as its argument" do
Pry.config.foo = nil
Pry.configure do |config|
config.foo = "bar"
end
expect(Pry.config.foo).to eq("bar")
end
end
describe "Exotic object support" do
# regression test for exotic object support
it "Should not error when return value is a BasicObject instance" do