Skip to content

Instantly share code, notes, and snippets.

@bil-bas
Created July 3, 2011 13:43
Show Gist options
  • Save bil-bas/1062233 to your computer and use it in GitHub Desktop.
Save bil-bas/1062233 to your computer and use it in GitHub Desktop.
### Overriding global customization
Pry.config settings apply to all Pry instances, but some values can be overridden for a specific instance. The values that can be overridden are: `input`, `output`, `print`, `exception_handler`, `prompt`, and `hooks`. To override a given value, pass a new value as a hashed option for the method that initiates Pry.
Example: Overriding a global default at instantiation
```ruby
Pry.config.input = File.open("test.rb")
# Use a string-io for this specific instance.
Pry.start binding, :input => StringIO.new("ls\nexit")
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment