Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/irb/commit/2057248e40
|
|
(https://github.com/ruby/irb/pull/873)
* Replace ExtendCommand with Command and standardize command related names
1. Rename lib/irb/extend-command.rb to lib/irb/command.rb
2. Rename lib/irb/cmd/*.rb to lib/irb/command/*.rb
3. Rename test/irb/test_cmd.rb to test/irb/test_command.rb
4. Rename ExtendCommand to Command
* Alias ExtendCommand to Command and deprecate it
* Rename Command::Nop to Command::Base
* Not deprecate old constants just yet
* Add lib/irb/cmd/nop.rb back
https://github.com/ruby/irb/commit/462c1284af
|
|
(https://github.com/ruby/irb/pull/872)
See #787 for more details.
https://github.com/ruby/irb/commit/d9192d92d0
|
|
(https://github.com/ruby/irb/pull/869)
Currently, if the signature's constant part is not defined, a NameError
would be raised.
```
irb(main):001> show_source Foo
(eval):1:in `<top (required)>': uninitialized constant Foo (NameError)
Foo
^^^
from (irb):1:in `<main>'
```
This commit fixes the issue and simplifies the `edit` command's implementation.
https://github.com/ruby/irb/commit/8c16e029d1
|
|
(https://github.com/ruby/irb/pull/862)
* Powerup show_source by enabling RubyVM.keep_script_lines
* Add file_content field to avoid reading file twice while show_source
* Change path passed to eval, don't change irb_path.
* Encapsulate source coloring logic and binary file check insode class Source
* Add edit command testcase when irb_path does not exist
* Memoize irb_path existence to reduce file existence check calculating eval_path
https://github.com/ruby/irb/commit/239683a937
|
|
(https://github.com/ruby/irb/pull/868)
* Fix exit! command warning and method behavior
* Remove arg(0) from Kernel.exit and Kernel.exit!
https://github.com/ruby/irb/commit/372bc59bf5
|
|
(https://github.com/ruby/irb/pull/867)
* Remove IRB.irb_exit! method
It's not necessary to introduce a new method just for the exit! command
at this moment.
* Rename ExitForcedAction to ForceExit
* Move force exit tests to a dedicated file
* Fix nested history saving with exit! command
Because we switched to use `Kernel#exit` instead of `exit!`, the outer
session's ensure block in `Irb#run` will be run, which will save the
history. This means the separate check to save history when force exiting
is no longer necessary.
* execute_lines helper should also capture IRB setup's output
This prevents setup warnings from being printed to test output
while allowing those output to be tested.
* Update readme
https://github.com/ruby/irb/commit/899d10ade1
|
|
(https://github.com/ruby/irb/pull/851)
* Added failing test for when writing history on exit
* Save history on exit
* Exit early when calling Kernel.exit
* use status 0 for kernel.exit
* Added test for nested sessions
* Update lib/irb.rb
---------
https://github.com/ruby/irb/commit/c0a5f31679
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
(https://github.com/ruby/irb/pull/835)
* Remove unnecessary code from the exit command's implementation
1. The parameters of `IRB.irb_exit` were never used. But there are some
libraries seem to call it with arguments + it's declared on the top-level
IRB constant. So I changed the params to anonymous splat instead of removing them.
2. `Context#exit` was completely unnecessary as `IRB.irb_exit` doesn't use
the `@irb` instance it passes. And since it's (or should be treated as)
a private method, I simply removed it.
3. The `exit` command doesn't use the status argument it receives at all.
But to avoid raising errors on usages like `exit 1`, I changed the argument to
anonymous splat instead removing it.
* Make exit an actual command
* Update readme
https://github.com/ruby/irb/commit/452b543a65
|
|
(https://github.com/ruby/irb/pull/813)
https://github.com/ruby/irb/commit/e79a90a1e6
|
|
(https://github.com/ruby/irb/pull/807)
https://github.com/ruby/irb/commit/2cccc448de
|
|
`debug` command
(https://github.com/ruby/irb/pull/806)
https://github.com/ruby/irb/commit/b7b57311cc
|
|
(https://github.com/ruby/irb/pull/761)
* Implement `history` command
Lists IRB input history with indices. Also aliased as `hist`.
* Add tests for `history` command
* Address feedback: `puts` with multiple arguments instead of `join`ing
* Address feedback: Handle nil from splitting an empty input string
* Refactor line truncation
* Add `-g` grep option to `history` command
* Add `history` command to README
* Remove unused `*args` parameter
* Allow spaces to be included in grep
* Allow `/` to be included in grep regex
* Handle `input` being an empty string
* Exclude "#{index}: " from matching the grep regex
* Add new line after joining
https://github.com/ruby/irb/commit/3f9eacbfa9
|
|
want to access a methods origin definition. It allows for chaining
of multiple esses to further go up the classes as needed.
(https://github.com/ruby/irb/pull/770)
https://github.com/ruby/irb/commit/eec1329d5a
|
|
(https://github.com/ruby/irb/pull/788)
Similar to Pry, it displays user-defined aliases in the help message with
a dedicated section. With the current default aliases, it looks like:
```
...other sections...
Aliases
$ Alias for `show_source`
@ Alias for `whereami`
```
https://github.com/ruby/irb/commit/2a0eacc891
|
|
(https://github.com/ruby/irb/pull/708)
* Add completor using prism and rbs
* Add TypeCompletion test
* Switchable completors: RegexpCompletor and TypeCompletion::Completor
* Add completion info to irb_info
* Complete reserved words
* Fix [*] (*) {**} and prism's change of KeywordParameterNode
* Fix require, frozen_string_literal
* Drop prism<=0.16.0 support
* Add Completor.last_completion_error for debug report
* Retrieve `self` and `Module.nesting` in more safe way
* Support BasicObject
* Handle lvar and ivar get exception correctly
* Skip ivar reference test of non-self object in ruby < 3.2
* BaseScope to RootScope, move method objects constant under Methods
* Remove unused Splat struct
* Drop deeply nested array/hash type calculation from actual object. Now, calculation depth is 1
* Refactor loading rbs in test, change preload_in_thread not to cache Thread object
* Use new option added in prism 0.17.1 to parse code with localvars
* Add Prism version check and warn when :type completor cannot be enabled
* build_type_completor should skip truffleruby (because endless method definition is not supported)
https://github.com/ruby/irb/commit/1048c7ed7a
|
|
(https://github.com/ruby/irb/pull/719)
https://github.com/ruby/irb/commit/3cedc5cb62
|
|
integration
(https://github.com/ruby/irb/pull/693)
* `help` should display debugger's help during irb:rdbg session
* Update `show_cmds`'s output when in irb:rdbg session
https://github.com/ruby/irb/commit/4029c2e564
|
|
(https://github.com/ruby/irb/pull/686)
* Support `VISUAL` env var, and prefer it over `EDITOR`
* Update test/irb/test_cmd.rb
---------
https://github.com/ruby/irb/commit/399b872c31
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
(https://github.com/ruby/irb/pull/575)
* Support native integration with ruby/debug
* Prevent using multi-irb and activating debugger at the same time
Multi-irb makes a few assumptions:
- IRB will manage all threads that host sub-irb sessions
- All IRB sessions will be run on the threads created by IRB itself
However, when using the debugger these assumptions are broken:
- `debug` will freeze ALL threads when it suspends the session (e.g. when
hitting a breakpoint, or performing step-debugging).
- Since the irb-debug integration runs IRB as the debugger's interface,
it will be run on the debugger's thread, which is not managed by IRB.
So we should prevent the 2 features from being used at the same time.
To do that, we check if the other feature is already activated when
executing the commands that would activate the other feature.
https://github.com/ruby/irb/commit/d8fb3246be
|
|
(https://github.com/ruby/irb/pull/654)
* Deprecate multi-irb commands
- Print deprecated message when any of the commands are used
- Put related commands under `Multi-irb` category with a deprecated
label
* Update readme
https://github.com/ruby/irb/commit/861731ac12
|
|
(https://github.com/ruby/irb/pull/661)
* Create a new Workspace command category
* Update readme
https://github.com/ruby/irb/commit/310650c213
|
|
(https://github.com/ruby/irb/pull/658)
* Decouple `edit` command from `show_source`
2 commands should not depend on each other. If `edit` command also needs
to find a source, the source finding logic should be extracted into a
separate class.
* Return nil if is not an actual file path
* Refactor SourceFinder
https://github.com/ruby/irb/commit/9790517a0c
|
|
* Page ls command's output
* Use Pager.page_content in show_cmds too
https://github.com/ruby/irb/commit/82d1687302
|
|
environment
(https://github.com/ruby/irb/pull/647)
This can:
- Make it easier to scroll up and down the commands list
- Avoid pushing up users' previous output
- Allow users to do basic search with `/<word>`
https://github.com/ruby/irb/commit/f94e8a66dd
|
|
(https://github.com/ruby/irb/pull/628)
https://github.com/ruby/irb/commit/5e87f3bfdd
Co-authored-by: Andy Waite <andyw8@users.noreply.github.com>
|
|
check_code_block(rename to check_code_syntax)
(https://github.com/ruby/irb/pull/611)
https://github.com/ruby/irb/commit/b7f4bfaaa4
|
|
(https://github.com/ruby/irb/pull/600)
https://github.com/ruby/irb/commit/b039b89343
|
|
(https://github.com/ruby/irb/pull/598)
* Rename conf to irb_context
* Drop Nop#irb method because it's only used by irb/ext/loader.rb
We don't need to expose this method to all command classes, especially
when it's just an alias of `irb_context.irb`.
|
|
(https://github.com/ruby/irb/pull/597)
https://github.com/ruby/irb/commit/0a0409c52b
|
|
(https://github.com/ruby/irb/pull/589)
* Allow `show_source` for private methods
Fix https://github.com/ruby/irb/pull/577
* Pend tests on TruffleRuby
It seems `eval(..., __LINE__ + 1)` does not work.
Other similar tests are also pended on TruffleRuby, so I think it
is acceptable.
* Use `private_method_defined?` instead of `defined?`
|
|
(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/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.
|
|
(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>
|
|
<module/class>`
(https://github.com/ruby/irb/pull/496)
https://github.com/ruby/irb/commit/e3d21f9329
|
|
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/commit/cef125850d
|
|
https://github.com/ruby/irb/commit/07fae94862
|
|
(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/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/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>
|
|
(https://github.com/ruby/irb/pull/461)
https://github.com/ruby/irb/commit/367797bb05
|
|
(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
|
|
* 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>
|