summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstrcmp <28xdb6+fvutuvy4f@grr.la>2015-12-27 06:19:04 +0000
committerstrcmp <28xdb6+fvutuvy4f@grr.la>2015-12-27 06:19:04 +0000
commit41fb3ae3dbab7580d926b9de144b549bfc96502b (patch)
treed1c25be187b8934c360223845efc79a72cd1cfa1
parent0213f8f0f97061acd10f3e874fa537fbd1537f0b (diff)
downloadpry-configure.tar.gz
feedback from PRpry-configure
-rw-r--r--CHANGELOG.md2
-rw-r--r--lib/pry/pry_class.rb9
-rw-r--r--spec/pry_spec.rb3
3 files changed, 11 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 068627bc..05c2af32 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,5 @@
### HEAD
-* Add `Pry.configure` as an alternative to the current way of changing configuration options in `.pryrc` files.
+* 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))
diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb
index 8f98af4b..2a1bae76 100644
--- a/lib/pry/pry_class.rb
+++ b/lib/pry/pry_class.rb
@@ -34,7 +34,14 @@ class Pry
end
#
- # @return [void]
+ # @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
diff --git a/spec/pry_spec.rb b/spec/pry_spec.rb
index a52871d0..afd56dff 100644
--- a/spec/pry_spec.rb
+++ b/spec/pry_spec.rb
@@ -5,8 +5,9 @@ describe Pry do
@str_output = StringIO.new
end
- describe "Pry.configure" do
+ 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