mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Merge branch 'master' into pry-lazy
This commit is contained in:
commit
6cbaf40969
3 changed files with 26 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
### HEAD
|
### 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)
|
* 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.
|
* 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))
|
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))
|
||||||
|
|
|
@ -32,6 +32,21 @@ class Pry
|
||||||
def history
|
def history
|
||||||
@history ||= History.new
|
@history ||= History.new
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -5,6 +5,16 @@ describe Pry do
|
||||||
@str_output = StringIO.new
|
@str_output = StringIO.new
|
||||||
end
|
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
|
describe "Exotic object support" do
|
||||||
# regression test for exotic object support
|
# regression test for exotic object support
|
||||||
it "Should not error when return value is a BasicObject instance" do
|
it "Should not error when return value is a BasicObject instance" do
|
||||||
|
|
Loading…
Reference in a new issue