Age | Commit message (Collapse) | Author |
|
(https://github.com/ruby/irb/pull/542)
https://github.com/ruby/irb/commit/edd6c30e16
|
|
(https://github.com/ruby/irb/pull/541)
https://github.com/ruby/irb/commit/1dc2a406a3
|
|
(https://github.com/ruby/irb/pull/537)
https://github.com/ruby/irb/commit/110e4a3219
|
|
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.
|
|
empty symbol
(https://github.com/ruby/irb/pull/534)
https://github.com/ruby/irb/commit/35697f3ef3
|
|
rubygems.org
(https://github.com/ruby/irb/pull/532)
https://github.com/ruby/irb/commit/f01c2a6ac1
|
|
<module/class>`
(https://github.com/ruby/irb/pull/496)
https://github.com/ruby/irb/commit/e3d21f9329
|
|
Workspace#filter_backtrace
(https://github.com/ruby/irb/pull/526)
* Add a comment about Rails' patch on Workspace#filter_backtrace
* Update lib/irb/workspace.rb
Co-authored-by: Sorah Fukumori <sora134@gmail.com>
---------
https://github.com/ruby/irb/commit/9443d911fc
Co-authored-by: Sorah Fukumori <sora134@gmail.com>
|
|
`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/522)
https://github.com/ruby/irb/commit/97dae166ae
|
|
(https://github.com/ruby/irb/pull/488)
The context argument was introduced in this change:
https://github.com/ruby/irb/commit/6806669d178f90f38b99c144bdfee06bdb93a229#diff-296327851fb7a2c307c2d0693b769f58c01aaf315972f290500d10081ee200a9
perhaps for potential usages. But after that it's never used.
|
|
https://github.com/ruby/irb/commit/a55ace0791
|
|
(https://github.com/ruby/irb/pull/508)
https://github.com/ruby/irb/commit/dd7f25cd45
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
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.
|
|
methods
(https://github.com/ruby/irb/pull/502)
* Remove unnecessary parameter defaults
These methods are always called with tokens specified. So their default
`@tokens` value is never used and is misleading.
* Remove unnecessary context default
* Require tokens for `RubyLex#check_state`
|
|
https://github.com/ruby/irb/commit/cef125850d
|
|
https://github.com/ruby/irb/commit/7a94bc4135
|
|
https://github.com/ruby/irb/commit/07fae94862
|
|
(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/489)
* Remove unnecessary Binding#source_location check
`Binding#source_location` was added in 2.6, which is the minimum supported
version now. So this check is no longer necessary.
* Remove unused IRB.delete_caller
This method was added in the earliest version of IRB:
https://github.com/ruby/irb/commit/f47808999d24865fba1929dea1a7011ff5a517d6
But it's not currently referenced by anything. We can verify this with a
org-wide search result:
https://github.com/search?q=org%3Aruby+delete_caller&type=code
|
|
(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/350)
Simplify part of regex ``[_a-zA-Z0-9]`` with equivalent shorthand ``\w``.
Replace case-when with match ``$1`` or default value ``?"``, making intention more clear.
|
|
HOME directory, not current directory
https://github.com/ruby/irb/commit/33a5e55ffd
|
|
https://github.com/ruby/irb/commit/b7973dd2d2
|
|
https://github.com/ruby/irb/commit/f65ec49684
|
|
https://github.com/ruby/irb/commit/a8ea9963c6
|
|
(https://github.com/ruby/irb/pull/481)
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
https://github.com/ruby/irb/commit/229476ba76
|
|
(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/commit/d799c5c9da
|
|
(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
|
|
descriptions
(https://github.com/ruby/irb/pull/463)
https://github.com/ruby/irb/commit/7e857655ac
|
|
(https://github.com/ruby/irb/pull/472)
* Lazily load the multi-irb extension
We now have plan to implement a command that prints all commands'
information, which will need to load all command files without actually
running them.
But because the `multi-irb` extension patches IRB's top-level methods,
loading it would cause unintentional side-effects.
So this commit moves related requires into command execution to avoid the problem.
* Make extend_irb_context private
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
|
|
`IRB_USE_AUTOCOMPLETE=false`
(https://github.com/ruby/irb/pull/469)
* Allow using IRB_USE_AUTOCOMPLETE=false to disable autocompletion
Currently, the only 2 ways to disable autocompletion are:
1. Create `.irbrc` and set `IRB.conf[:USE_AUTOCOMPLETE] = false`
2. Add the `--noautocomplete` flag when using the `irb` executable
Both of them are less convenient than setting a env var and are
lesser known to devs.
And given the number of problems the autocompletion has (see #445), I
think we should allow disabling it with a simple `IRB_USE_AUTOCOMPLETE=false`.
* Mention some env var configs in the README
|
|
https://github.com/ruby/irb/commit/e0ec5e1bd8
|
|
(https://github.com/ruby/irb/pull/461)
https://github.com/ruby/irb/commit/367797bb05
|
|
https://github.com/ruby/irb/commit/f9507923fa
|
|
(https://github.com/ruby/irb/pull/458)
* Fix the debug.gem force-loader for Ruby 3.2
* Support 1.7.0dev format as well
|
|
(https://github.com/ruby/irb/pull/449)
* Seamlessly integrate a few debug commands
* Improve the break command support
* Utilize skip_src option if available
* Add step and delete commands
* Write end-to-end tests for each debugger command
* Add documentation
* Add backtrace, info, catch commands
https://github.com/ruby/irb/commit/976100c1c2
|
|
Asked by ko1 to release https://github.com/ruby/irb/pull/444 for
simplifying https://github.com/ruby/debug/pull/808,
and hsbt made me a gem owner for this.
Stan said 1.4.3 should have been 1.5.0, but now that it's already
released and it's not worth yanking it, we're not doing that change.
However, now that this release includes `debug` and `edit`, I think it's
a good opportunity to hit the version 1.5.0.
https://github.com/ruby/irb/commit/85937d71f6
|
|
* Add edit command
* Make find_source a public singleton method
* Add document for the edit command
* Make find_end private
* Remove duplicated private
https://github.com/ruby/irb/commit/4321674aa7
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
|
|
(https://github.com/ruby/irb/pull/451)
* Document a full list of commands
* Document debug as well
* Make it less duplicated
|
|
(https://github.com/ruby/irb/pull/448)
* Minor fixes on debug command
* Discover and load debug.gem even if it's not in Gemfile
* Eliminate else for rescue
* Discover the latest one from all gem paths
|
|
(https://github.com/ruby/irb/pull/447)
* Minor fixes on debug command
* Update lib/irb/cmd/debug.rb
|
|
https://github.com/ruby/irb/commit/30faa13fa3
|
|
https://github.com/ruby/irb/commit/1bddbbf602
|