| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/567)
* Give show_doc its own command class
* Print deprecation warning for `help` command
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/582)
* Suppress Reline::IOGate.cursor_pos writing escape sequence in test_debug_cmd
* Force use Reline::GeneralIO as Reline::IOGate and remove RUBY_DEBUG_NO_RELINE option for debug test
|
|
|
|
|
|
|
| |
path
(https://github.com/ruby/irb/pull/572)
https://github.com/ruby/irb/commit/0b648adf38
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/570)
https://github.com/ruby/irb/commit/710d5b1af5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/568)
In https://github.com/ruby/irb/commit/3ee79e89adb8e21b63d796e53bcc86281685076d,
`encoding_aliases.rb` was introduced to return the correct encoding object for
`ujis` and `euc` encodings.
However, the return value of `@@legacy_encoding_alias_map[@encoding_name]`
is always overridden by a second look up with `Encoding.find(@encoding_name)`.
So the logic didn't work as expected.
This commit fixes the problem.
|
|
|
|
| |
This reverts commit e7cdce83e8c8797c481ccb54c260c0db1e1afa7c.
|
| |
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/566)
https://github.com/ruby/irb/commit/df32e024be
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/564)
The current method-redefining approach brings little benefit, makes it
harder to understand the code, and causes warnings like:
> warning: method redefined; discarding old execute
This patch simplifies it while displaying more helpful message when rdoc
couldn't be loaded.
|
|
|
|
|
|
|
|
|
| |
<Class/Module>`
(https://github.com/ruby/irb/pull/562)
Instead of always printing methods inherited from Class or Module, IRB by
default should filter them out unless `<Class/Module>` is specified to be
either of those.
|
|
|
|
|
|
|
| |
tokenizing issue
(https://github.com/ruby/irb/pull/558)
https://github.com/ruby/irb/commit/f68e891ed1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/555)
* Remove all Ruby 2.6 support
* Drop Ruby 2.6 specific testing conditions
* Only run Ruby 2.7+ on CI
* Bump Ruby requirement to 2.7+
https://github.com/ruby/irb/commit/3f714b616c
|
|
|
|
|
|
|
|
|
|
| |
Ruby implementations like JRuby and TruffleRuby already indicate their
compatibility target with RUBY_VERSION. We don't need to exclude
them from accepting keyword arguments as long as they target 2.7+.
https://github.com/ruby/irb/commit/bf20faa4e6
Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
|
|
|
|
| |
https://github.com/ruby/irb/commit/2517039812
|
|
|
|
|
|
|
|
| |
* undefine Kernel#irb_original_require in without_rdoc method
* Don't rescue all LoadErrors/NameErrors in test_rendering.rb, just
the one for require 'yamatanooroti'
https://github.com/ruby/irb/commit/52b79806ea
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/541)
https://github.com/ruby/irb/commit/1dc2a406a3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
includes word break characters
(https://github.com/ruby/irb/pull/523)
* Improve method completion for string and regexp that includes word break characters
* Remove completion-test's assert_not_include because candidates no longer include every possible methods
* Add comment about string's method completion regexp
Co-authored-by: Stan Lo <stan001212@gmail.com>
* Add comment about regexp's method completion regexp
Co-authored-by: Stan Lo <stan001212@gmail.com>
---------
https://github.com/ruby/irb/commit/aa8128c533
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/529)
Consider completion for this example: `foo.bar.b`
Without type information, it is hard to know the return value of the `bar`
method, so the current implementation interates through `ObjectSpace` to
get all possible candidates for the second method.
In small projects, the performance and accuracy are acceptable. But in
bigger projects, the performance is unacceptable and the accuracy is mostly
poor.
So this commit drops the support for chained methods' completion.
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/527)
https://github.com/ruby/irb/commit/8473d0bc0f
Co-authored-by: Stan Lo <stan.lo@shopify.com>
|
|
|
|
|
|
|
| |
empty symbol
(https://github.com/ruby/irb/pull/534)
https://github.com/ruby/irb/commit/35697f3ef3
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/535)
https://github.com/ruby/irb/commit/09f16259db
|
|
|
|
|
|
|
|
|
|
|
| |
If the main object of the context has `#delete` method, the following
warning is printed.
```
irb: warn: can't alias delete from irb_delete.
```
https://github.com/ruby/irb/commit/00b39be61f
|
|
|
|
|
|
|
|
|
|
|
| |
string
(https://github.com/ruby/irb/pull/528)
* Handle long inspect and control characters in prompt string
* Add constants for prompt truncate length, omission and replace pattern
* Simply compare string instead of regexp in prompt truncation test
|
|
|
|
|
|
|
| |
<module/class>`
(https://github.com/ruby/irb/pull/496)
https://github.com/ruby/irb/commit/e3d21f9329
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`IRB::Inspector#inspect_value` errors
(https://github.com/ruby/irb/pull/511)
**Before**
```
irb(main):001:0> c = Cat.new "foo"
(Object doesn't support #inspect)
=>
```
**After**
```
irb(main):001:0> c = Cat.new "foo"
An error occurred when inspecting the object: #<NoMethodError: undefined method `is_a?' for foo:Cat
if obj.is_a?(String)
^^^^^^>
Result of Kernel#inspect: #<Cat:0x0000000109090d80 @name="foo">
=>
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/520)
* Remove redundant completion test
The test case was introduced to guard an old implementation, which relied
on `Module#name`. Commit:
https://github.com/ruby/irb/commit/8827d182746396dbf4499c2c1c8c0e9bf8375b7c
However, the current implementation has avoided calling `Module#name`
completely, so the test case is no longer necessary. Commit:
https://github.com/ruby/irb/commit/88311ce3c84251e6f420246cd14efc96e00888be
* Remove unnecessary pend
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/484)
* Improve assert_indenting helper
Instead of putting assertions inside the `auto_indent` block, we
can just make `auto_indent` return the calculated space count, and use
it for assertion outside of the `auto_indent` block call.
This simplifies the setup code and makes the intention easier to
understand.
* Introduce assert_row_indenting helper
1. Helper users shouldn't need to write 2 assertions for the current and
the next line's indentation.
2. With this new approach, we can generate clearer error message for
both cases:
When the current line's space count doesn't match
```
Incorrect spaces calculation for line:
```
> def each_top_level_statement
```
All lines:
```
def each_top_level_statement
```
<0> expected but was
<nil>
```
When the next line's space count doesn't match
```
Incorrect spaces calculation for line after the current line:
```
def each_top_level_statement
>
```
All lines:
```
def each_top_level_statement
```
<3> expected but was
<2>
```
* Replace assert_indenting with assert_row_indenting
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/508)
https://github.com/ruby/irb/commit/dd7f25cd45
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/514)
* Improve encoding error test case
The test input IRB currently uses happen to hit a compatibility bug in
TruffleRuby, which has been documented in
https://github.com/oracle/truffleruby/issues/2848
Although it'll eventually be fixed, we can make the test case support TruffleRuby
now by tweaking it just a little bit.
Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
* Remove redundant TruffleRuby omits/pends
Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
* Use a different way to test warning emission
The test case was added in https://github.com/ruby/irb/commit/d08ef68d2dfbf041d363f65686d78a937954513c
to verify that IRB emits Ruby warning as expected.
But the subject it uses relies on CRuby's regexp engine, which isn't always
used in other language implementations, like TruffleRuby. That's why we
ended up skipping TruffleRuby in this test case.
Since the test isn't about regexp itself, we can change the testing subject
and just remove the special condition for TruffleRuby.
Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
---------
https://github.com/ruby/irb/commit/6fdf4f3e97
Co-authored-by: Kevin Menard <kevin@nirvdrum.com>
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/512)
https://github.com/ruby/irb/commit/874dbcad81
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some background for this refactor:
1. Through a RubyLex instance's lifetime, the context passed to its methods
should be the same.
Given that `Context` is only initialised in `Irb#initialize`,
this should be true.
2. When `RubyLex` is initialised, the context object should be accessible.
This is also true in all 3 of `RubyLex.new`'s invocations.
With the above observations, we should be able to store the context in `RubyLex`
as an instance variable. And doing so will make `RubyLex`'s instance methods
easier to use and maintain.
https://github.com/ruby/irb/commit/5c8d3df2df
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/498)
When the main object is frozen, `IRB` wraps a `SimpleDelegator` around it.
But because `SimpleDelegator` doesn't delegate private methods, methods like
`require_relative` or `const_get` would cause error, which are needed for
lazily loading commands.
This commit works around this limitation by avoiding those private method calls
when setting up command execution.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/504)
* Simplify `RubyLex#set_prompt`
It's optional argument is never used by any caller.
* Remove the optional `p` argument from `RubyLex#set_input`
The argument is only used in a test case, which can be easily replaced by
a block argument.
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/491)
Currently, IRB has 35 test cases for 10 non-debugging commands, with the
rest 10 commands untested. So in the long-term, it could have around 70
test cases for all existing commands.
With this number of test cases, I think it's easier to manage them by grouping
them in classes (by command).
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/386)
* fix prompt and code mismatch
* Add test for prompt and code mismatch bug
https://github.com/ruby/irb/commit/a5765d8177
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/486)
https://github.com/ruby/irb/commit/31cfbeacbb
|
|
|
|
|
|
|
|
|
|
|
| |
It looks like tool/sync_default_gems.rb is not capable of cherry-picking
commits from ruby/irb. I just executed `tool/sync_default_gems.rb irb`
to fix the sync status.
I'm not sure if what's the cause. It could be related to some diff that
doesn't exist in ruby/ruby, or it might be related to non-linear history
due to merge commits. For next time, I'd like to at least exclude the
second possibility, so I disabled merge commits in ruby/irb.
|
|
|
|
| |
https://github.com/ruby/irb/commit/565eeb3c19
|
|
|
|
|
|
|
|
| |
It's not an intentional behavior of the command and it behaves
differently in different environments. So checking it actually brings
more problem than benefit.
https://github.com/ruby/irb/commit/b3203bc784
|
|
|
|
| |
https://github.com/ruby/irb/commit/cc6e6d26b6
|
|
|
|
| |
https://github.com/ruby/irb/commit/9cacb5f352
|
|
|
|
| |
https://github.com/ruby/irb/commit/998b7a74fa
|
|
|
|
| |
https://github.com/ruby/irb/commit/dbb3dc72ff
|
|
|
|
| |
https://github.com/ruby/irb/commit/ed9e435a6b
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/479)
https://github.com/ruby/irb/commit/bede04c14a
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/478)
Given that `show_doc` already supports syntax like `String#gsub`, it
should be able to take it in non-string form too, like `edit` and
`show_source` do. This ensures users can have a consistent syntax on
argument between different commands.
|
|
|
|
|
|
|
|
| |
The current `next` pre-command workaround on IRB source stepping
moves the location by 1 extra line. A better way is to make `debug`
skip IRB frames completely, which is what this commit does.
It also fixes the step command's test. The `|` in regexp was not escaped
so it was always incorrectly matched.
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/475)
In the long-term, we want to align with `Pry`, `byebug` and `debug` to
use the `help` command to list all commands, which is what `show_cmds`
currently does. And `show_doc` will be the command to look up Ruby APIs.
By aliasing `show_doc` to the current `help` now, users will have time
to get use to it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/473)
* Handle file loading commands' argument error gracefully
Currently, if users don't provide an argument to `source`,
`irb_load`, and `irb_require`, IRB raises `ArgumentError` with full
stacktrace. This is confusing because it looks similar to when IRB has
internal issues. The message also isn't helpful on helping users avoid
the error.
So in this commit, I add a new `CommandArgumentError` for commands to
raise explicitly when users' input doesn't satisfy a command's argument
requirement.
* Gracefully handle `fg` command's argument requirement
|
|
|
|
|
|
|
| |
(https://github.com/ruby/irb/pull/471)
The killing/waiting logic is borrowed from ruby/debug:
https://github.com/ruby/debug/blob/ec5ae5aebd61a99dc84028d8dffa8e7e165c1ec6/test/support/test_case.rb#L107-L136
|