1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
Commit graph

4280 commits

Author SHA1 Message Date
Barrett Ingram
25f5022fcf Add CI support for ruby 3 and fix broken spec
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.
2021-01-02 18:06:21 -06:00
Kyrylo Silin
7fb884f1d9
Merge pull request from utkarsh2102/fix-bundler_spec-test
Fix bundler_spec test
2020-11-28 23:26:54 +08:00
Kyrylo Silin
ae085970d9 CHANGELOG: mention & 2020-11-28 22:46:51 +08:00
Kyrylo Silin
a619cfba12
Merge pull request from mvz/issue-1241-remove-autoloading-of-plugins
Remove autoloading of plugins
2020-11-28 22:42:42 +08:00
Kyrylo Silin
845cd6d4ef
Merge pull request from tbrisker/patch-1
Update `?` alias to use show-source
2020-11-28 22:15:53 +08:00
Kyrylo Silin
22c35975ec
Merge pull request from VSPPedro/update-readme
Reflect latest version (0.13.1) in README
2020-09-11 13:25:43 +08:00
Pedro Paiva
470419e7b5 Update README 2020-09-10 23:13:16 -03:00
卜部昌平
b548784b4a
do not undef =~ unless defined ()
Undefining a nonexistent definition is an error in Ruby.  This has not been a problem because there always was `Object#=~` predefined.  But we are planning to delete that useless method.  This would become an error unless properly guarded.
2020-08-06 21:21:10 +08:00
Utkarsh Gupta
b61aad5000 Fix bundler_spec test
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
2020-06-16 19:35:43 +05:30
Tomer Brisker
c256b40e68
Update ? alias to use show-source
`show-doc` is deprecated in favor of `show-source -d`. Updating the `?` alias accordingly.
2020-05-03 14:00:05 +03:00
Kyrylo Silin
9d9ae4a0b0
Merge pull request from pry/release-0-13-1
Release v0.13.1
2020-04-12 15:34:51 +08:00
Kyrylo Silin
e6f7a940a6 Release v0.13.1 2020-04-12 15:31:06 +08:00
Kyrylo Silin
0979640396
Merge pull request from ahorek/frozen_pry_bug
pry-backtrace frozen bug
2020-04-12 15:17:59 +08:00
Kyrylo Silin
7a4166fb04
Merge pull request from barrettkingram/fix-help-command-listing
Improve appearance of help command listing
2020-04-12 15:17:32 +08:00
Kyrylo Silin
9094b5f8d4
Merge pull request from pry/config-nil-on-unknown-option
config: return `nil` on unknown option instead of raising
2020-04-12 15:17:03 +08:00
Kyrylo Silin
5dd061c340 config: return nil on unknown option instead of raising
Returning `nil` on unknown option was default behaviour for Pry v0.12.x. In
e5556a2be8 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.
2020-04-12 15:10:57 +08:00
pavel
da81c96027 pry-backtrace frozen bug 2020-03-25 01:01:56 +01:00
Barrett Ingram
a164846c4d Improve help listing for regex aliases
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[!?]+/`.
2020-03-22 14:43:20 -05:00
Barrett Ingram
0b3b71e714 Display Bang command as "!" instead of regex in help listing 2020-03-22 14:18:13 -05:00
Matijs van Zuijlen
6901976387 Mark block arguments as unused 2020-03-22 15:11:50 +01:00
Matijs van Zuijlen
20d63ca783 Remove plugin system in favor of regular requires 2020-03-22 13:02:21 +01:00
Matijs van Zuijlen
ef8602bf98 Remove should_load_plugins config option 2020-03-22 12:51:37 +01:00
Matijs van Zuijlen
714bcb5b3a Do not load plugins by default 2020-03-22 12:47:13 +01:00
Kyrylo Silin
f0328a4dfa CHANGELOG: mention 2020-03-22 00:40:40 +08:00
Kyrylo Silin
e9ad447996
Merge pull request from barrettkingram/fix-syntax-error-display
Display all syntax error messages when catching SyntaxException
2020-03-22 00:35:33 +08:00
Barrett Ingram
f6736d5262 Display all syntax error messages when catching SyntaxException
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
2020-03-21 11:17:27 -05:00
Kyrylo Silin
2208ed30f2
Merge pull request from pry/release-0-13-0
Release v0.13.0
2020-03-21 19:13:19 +08:00
Kyrylo Silin
3cdd6f4951 Release v0.13.0 2020-03-21 19:08:40 +08:00
Kyrylo Silin
fc30295031
Merge pull request from pry/1859-vi-overhang-fix
repl: clear line after indenting when Vi mode is enabled
2020-03-21 18:22:27 +08:00
Kyrylo Silin
b634abccb7 repl: clear line after indenting when Vi mode is enabled
Fixes  (Pry still leaves duplicated characters on long enough input)
2020-03-21 18:17:55 +08:00
Kyrylo Silin
bb10f95019
Merge pull request from pry/pry-method-robustness
method: delegate internally-used methods
2020-03-21 16:59:31 +08:00
Kyrylo Silin
ff6567d3f4 method: delegate internally-used methods
Improves on  (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.
2020-03-21 16:53:58 +08:00
Kyrylo Silin
36c7fdbc48
Merge pull request from pry/gemfile-warning-fix
spec/integration/bundler: fix the "no dependencies" warning
2020-03-21 11:00:03 +08:00
Kyrylo Silin
7bf0bb4210 spec/integration/bundler: fix the "no dependencies" warning
Fixes the following warning:

```
The Gemfile specifies no dependencies
```
2020-03-21 10:48:23 +08:00
Kyrylo Silin
129bc35fde
Merge pull request from casperisfine/fix-completion-spec-ruby-2.7
Fix completion_spec on MRI 2.7.0
2020-03-20 23:18:31 +08:00
Jean Boussier
b77ac183d8 Fix completion_spec on MRI 2.7.0
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
2020-03-20 13:33:39 +01:00
Kyrylo Silin
62dbbdb23e CHANGELOG: mention 2020-03-20 19:54:22 +08:00
Kyrylo Silin
dc6ce461bb
Merge pull request from barrettkingram/whereami_bug_fix
Fix whereami -c bug when class definition is not beginning of line
2020-03-20 19:52:23 +08:00
Kyrylo Silin
68ee107c58
Merge pull request from pry/file-and-line-locator-refactoring
commands/edit/file_and_line_locator: refactor eval expression
2020-03-20 19:22:14 +08:00
Kyrylo Silin
c6b014839a commands/edit/file_and_line_locator: refactor eval expression
Thanks for the catch:
272b3290b5 (commitcomment-36938715)
2020-03-20 19:15:14 +08:00
Kyrylo Silin
6462ae85ea
Merge pull request from pry/method-source-bump
gemspec: bump method_source to `~> 1.0`
2020-03-19 21:22:48 +08:00
Kyrylo Silin
d0f118767e gemspec: bump method_source to ~> 1.0
This should finally fix our build on Ruby 2.7.
2020-03-19 21:16:00 +08:00
Kyrylo Silin
1590d794cc
Merge pull request from sairam/patch-1
update website domain
2020-03-19 08:39:15 +08:00
Sai Ram Kunala
bf574814d7
update website domain 2020-03-18 22:54:09 +05:30
Kyrylo Silin
ae42014a91
Merge pull request from secf00tprint/master
removed gist section - Readme
2020-03-17 18:23:24 +08:00
Kyrylo Silin
10805da9c3
Merge pull request from taki/fix-warning-on-rake
I fix `warning: deprecated Object#=~ is called on Proc; it always returns nil` in Ruby 2.7
2020-03-17 18:22:20 +08:00
Kyrylo Silin
c7b0d4aa97
Merge pull request from pry/2099-safe-global-fix
exceptions: check if $SAFE is supported by Ruby
2020-03-17 18:21:45 +08:00
Kyrylo Silin
be870b780d exceptions: check if $SAFE is supported by Ruby
Fixes  ($SAFE will become a normal global variable in Ruby 3.0)

MRI < 2.7 supports `$SAFE` variable, which is associated with
taint/untaint methods. All of that is deprecated in 2.7 with a lot of
warning messages generated, and no other effect.

None of this is supported on other Ruby platforms.

Related Ruby ticket:
https://bugs.ruby-lang.org/issues/8468
2020-03-17 18:04:26 +08:00
Kyrylo Silin
d8deccde68
Merge pull request from pry/ruby-27-testing
circle: test against stable Ruby 2.7
2020-03-17 17:44:16 +08:00
Kyrylo Silin
039be1fbef circle: test against stable Ruby 2.7 2020-03-17 17:39:42 +08:00