Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: return nil on unknown option instead of raising #2126

Merged
merged 1 commit into from Apr 12, 2020

Conversation

kyrylo
Copy link
Member

@kyrylo kyrylo commented Apr 12, 2020

Returning nil on unknown option was default behaviour for Pry v0.12.x. In
e5556a2 I changed that but I am not sure if it
was intentional. This breaks plugins such as
pry-theme (kyrylo/pry-theme#59).

Returning nil makes more sense, because we can write code like this:

Pry.config.foo ||= 123

...whereas as of now this is no longer possible and you would need to use
respond_to? to achieve the same effect.

Returning `nil` on unknown option was default behaviour for Pry v0.12.x. In
e5556a2 I changed that but I am not sure if it
was intentional. This breaks plugins such as
pry-theme (kyrylo/pry-theme#59).

Returning `nil` makes more sense, because we can write code like this:

```
Pry.config.foo ||= 123
```

...whereas as of now this is no longer possible and you would need to use
`respond_to?` to achieve the same effect.
@kyrylo kyrylo force-pushed the config-nil-on-unknown-option branch from fb60852 to 5dd061c Compare April 12, 2020 07:11
@kyrylo kyrylo merged commit 9094b5f into master Apr 12, 2020
@kyrylo kyrylo deleted the config-nil-on-unknown-option branch April 12, 2020 07:17
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Apr 27, 2020
Update ruby-pry to 0.13.1.


### [v0.13.1][v0.13.1] (April 12, 2020)

#### Bug fixes

* Fixed bug where on invalid input only the last syntax error is displayed
  (instead of all of them) ([#2117](pry/pry#2117))
* Fixed `Pry::Config` raising `NoMethodError` on undefined option instead of
  returning `nil` (usually invoked via `Pry.config.foo_option` calls)
  ([#2126](pry/pry#2126))
* Fixed `help` command not displaying regexp aliases properly
  ([#2120](pry/pry#2120))
* Fixed `pry-backtrace` not working ([#2122](pry/pry#2122))
seikichi added a commit to seikichi/pry-inline that referenced this pull request May 6, 2020
The `pry-inline` doesn't work with `pry` v0.13.0 because of the
`Pry::Config` problem (see: pry/pry#2126).

This commit changes dependent pry version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant