| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Drop support for Ruby 1.9.x
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Revert "Escape non-printing characters"
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Methods that don't have a source location (e.g., C methods, or methods
created via metaprogramming or even `alias_method` to C methods) are not
reasonable possible matching methods for a "weird method" we need to
locate.
In this case `renamed_method_source_location` can also return `nil` if
the actual code in question is a bare script (i.e., no methods). If that
script is loaded via `eval` then we'll end up in the weird method path
in the first place, but no method matching can be found, and if a
no-source-location method exists, we'll return that.
Down the line that's particularly painful because the source loading
thinks it's a C method, but it can actually be from metaprogramming (and
`alias_method`!), and then `Pry::Method#pry_doc_info` raises an error,
and `wherami` breaks even though we already have valid `__FILE__` and
`__LINE__` values.
|
| |/
|/|
| |
| | |
inside the trap signal
|
| | |
|
| | |
|
| |
| |
| |
| | |
Co-Authored-by: SilverPhoenix99 <silver.phoenix99@gmail.com>
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Cherry-picked file changes from 7c08e24dba0d47ad09288613c834507575bba7e9
Co-Authored-by: SilverPhoenix99 <silver.phoenix99@gmail.com>
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
| |
* fix pry indent frozen error
* fix generation of mutable strings
* fix String.new with no argument
* rubocop: fix offences of the Style/EmptyLiteral cop
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example failure: https://github.com/pry/pry/runs/3010680604
```
ArgumentError: wrong number of arguments (given 4, expected 1)
/home/runner/work/pry/pry/vendor/bundle/ruby/2.4.0/gems/psych-4.0.1/lib/psych.rb:323:in `safe_load'
```
I am not sure what exactly causes the failure but deleting simplecov dependency
fixes (I guess?) this problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mutex#synchronize will throw an error if called from code passed to
Signal.trap. This makes it impossible to start a working Pry session
inside a signal handler.
Currently, calling binding.pry inside signal handling code raises an
exception because Pry uses mutexes to solve various thread-safety
issues.
This commit updates Pry.start to detect whether we'll have the ability
to use Mutex#synchronize. If not, we'll print an error message and
return instead of raising an error.
https://github.com/pry/pry/issues/2191
|
|
|
|
|
|
|
|
| |
* validates file presence in Config#default_rc_file
Return `nil` if no default rc file is present in the filesystem.
This fixes the behavior if $XDG_CONFIG_HOME is set, but no rc file at
the path `$XDG_CONFIG_HOME/pry/pryrc` (while it may be at `~/.pryrc`).
|
|
|
|
| |
Fixes #2199 (`_out_` Ring is ill-addressible)
|
|
|
|
|
|
|
| |
Fixes #2181 (Bad formatting)
One of the regexps matches against string that were already colored. To prevent
that I used a negative look-ahead and rejected color sequences.
|
|\
| |
| | |
Fix breakage in output with colors disabled
|
| | |
|
| |
| |
| |
| | |
The previous implementation was removing more than that. When Pry.color = false, it was messing up the output of a few commands.
|
|\ \
| | |
| | | |
Escape non-printing characters
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| | |
Spec started failing because a statement which we expected to be a
syntax error is now interpreted as a valid pattern-matching statement.
Swapping the hash-rockets for colons turns this back into a syntax
error.
|
|\ \
| | |
| | | |
Fix bundler_spec test
|
| |/
| |
| |
| | |
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
|
|\ \
| |/
|/| |
Remove autoloading of plugins
|
| | |
|
| | |
|
|\ \
| | |
| | | |
pry-backtrace frozen bug
|
| |/ |
|
|\ \
| | |
| | | |
Improve appearance of help command listing
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit improves the appearance of regex aliases in the help index
by storing the result of calling #inspect on the regex as the listing.
For example, consider the `whereami` alias `/whereami[!?]+/`.
Previously this would appear in the help index as
`(?-mix:whereami[!?]+)`. This commit fixes this so it appears as
`/whereami[!?]+/`.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Returning `nil` on unknown option was default behaviour for Pry v0.12.x. In
e5556a2be8627ec3fe594c738f10422d5a1f5d43 I changed that but I am not sure if it
was intentional. This breaks plugins such as
pry-theme (https://github.com/kyrylo/pry-theme/issues/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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously when catching syntax errors in the REPL, we were only showing
the last syntax error displayed by the ruby output. However, ruby can
generate multiple syntax error messages within a single SyntaxException.
For example, this code generates multiple syntax error messages:
```
$ ruby -e 'puts {"key"=>"val"}.to_json'
-e:1: syntax error, unexpected =>, expecting '}'
puts {"key"=>"val"}.to_json
-e:1: syntax error, unexpected '}', expecting end-of-input
puts {"key"=>"val"}.to_json
```
We can't predict which error message would be most helpful for the
consumer - we should show both of them.
This commit modifies the string replacement we're doing when printing
SyntaxExceptions so any number of syntax error lines will be shown
correctly.
Issue: https://github.com/pry/pry/issues/2102
The error message of SyntaxError is different from Ruby's one
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improves on #2086 (Directly delegate internally-used Method methods)
(we add tests here)
Description by @michaelherold
> Relying on `method_missing` for all delegation to `Method` methods means
> that it's easier for the wrong method to be called when gems mess with
> `Object` or other such core areas.
> See https://github.com/ankane/ownership/pull/3 for an example of this.
> By defining explicit delegators, at least for the methods that we use
> internally withing Pry, we can eliminate this issue and be more
> communicative around the methods on the `Pry::Method` class.
I omitted the `source_location` changes because they need some clarification.
|
|
|
|
|
|
|
|
| |
Fixes the following warning:
```
The Gemfile specifies no dependencies
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The spec was failing because on 2.7 hash directly return nil without
hashing the key if they are empty:
```ruby
m = Module.new do
def self.hash; end
end
h = {}
h[m] # => nil
h[1] = 2
h[m] # => ArgumentError
```
So we need to require IRB so that the to_ignore set isn't empty
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider the following class definition:
```
out = class Cor
def blimey; end
pry_eval(binding, 'whereami -c')
end
```
For classes defined as part of an expression like this, "whereami -c"
was failing to find the class definition. To fix this, we modify the
regular expression so the "class" keyword is no longer required to
appear at the beginning of the line IF there is an equals sign preceding
it.
https://github.com/pry/pry/issues/2052
|
|
|
|
| |
Remove duplicate `opts[:show]` check in hist.
|
|
|
|
|
|
| |
Two tests are breaking, and I kind of understand why, but I'm
not sure what to do about it. Figured I should commit and send
a PR in hopes of another brain being able to help me out :)
|
|
|
|
|
|
|
| |
There are sporadic failures with some of the tests (seems to be isolated to the
code that uses `Pry.config.commands`). Passing `binding` to `pry_eval` seems to
be fixing them. To be quite fair, I'm not sure why that happens but it feels
like the right fix because we do the same in many other tests.
|