| Age | Commit message (Collapse) | Author |
|
to it
(https://github.com/ruby/irb/pull/856)
* Test IRB's behaviour with empty input
* Handle empty input and pass it to debugger
Since `rdbg` accepts empty input to repeat the previous command, IRB
should take empty input in `irb:rdbg` sessions and pass them to the
debugger.
Currently, IRB simply ignores empty input and does nothing. This commit
creates `EmptyInput` to represent empty input so it can fit into the
current IRB's input processing flow in `Irb#eval_input`.
https://github.com/ruby/irb/commit/0e9db419be
|
|
(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/871)
https://github.com/ruby/irb/commit/87c279ccf2
|
|
(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/870)
* Assign `@eval_path` through `irb_path=` method
This simplifies the original caching logic for the `eval_path` method
and makes it easier to understand.
* Refactor SourceFinder::Source
https://github.com/ruby/irb/commit/c63e4c4035
|
|
(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/865)
https://github.com/ruby/irb/commit/afe1f459cc
|
|
(https://github.com/ruby/irb/pull/864)
* Remove useless ivar
* Simplify tracer test setup
* Treat tracer like a normal development dependency
* Only require ext/tracer when value is truthy
* Make tracer integration skip IRB traces
https://github.com/ruby/irb/commit/a97a4129a7
|
|
(https://github.com/ruby/irb/pull/857)
The new tests are skipped when ruby below 3.1, as it was a default gem on it, and in a version we do not support.
This also move definition of `use_tracer` to module Context instead of monkey patch.
https://github.com/ruby/irb/commit/08834fbd5f
|
|
https://github.com/ruby/irb/commit/0ab96ed426
|
|
(https://github.com/ruby/irb/pull/852)
* Add a warning for when the history path doesn't exist
* warn when the directory does not exist
* added test for when the history_file does not exist
* Update lib/irb/history.rb
---------
https://github.com/ruby/irb/commit/9e6fa67212
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
(https://github.com/ruby/irb/pull/849)
* Use rubocop to enforce a few styling rules
* Add a CI job for linting
https://github.com/ruby/irb/commit/4f60cd88bb
|
|
not defined
(https://github.com/ruby/irb/pull/853)
The issue (https://github.com/ruby/debug/issues/1064) is caused by a
combination of factors:
1. When user starts an IRB session without a history file, the
`@loaded_history_lines` ivar is not defined.
2. If the user then starts the `irb:rdbg` session, the history counter
is not set, because the `@loaded_history_lines` is not defined.
3. Because `irb:rdbg` saves the history before passing Ruby expression
to the debugger, it saves the history with duplicated lines. The number
grows in exponential order.
4. When the user exits the `irb:rdbg` session, the history file could be
bloated with duplicated lines.
This commit fixes the issue by resetting the history counter even when
`@loaded_history_lines` is not defined.
https://github.com/ruby/irb/commit/4afc98c258
|
|
(https://github.com/ruby/irb/pull/850)
https://github.com/ruby/irb/commit/06b2d00dd3
|
|
(https://github.com/ruby/irb/pull/838)
https://github.com/ruby/irb/commit/a641746b18
|
|
https://github.com/ruby/irb/commit/2ffacaa031
|
|
https://github.com/ruby/irb/commit/dbd0e368c4
|
|
https://github.com/ruby/irb/commit/78dea58000
|
|
(https://github.com/ruby/irb/pull/837)
https://github.com/ruby/irb/commit/f052097c4b
|
|
(https://github.com/ruby/irb/pull/836)
https://github.com/ruby/irb/commit/73b35bb7f4
|
|
(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/834)
https://github.com/ruby/irb/commit/eff8d0d46a
|
|
(https://github.com/ruby/irb/pull/832)
The candidate list for empty input is all methods + all variables +
all constants + all keywords. It's a long list that is not useful.
https://github.com/ruby/irb/commit/812dc2df7b
|
|
(https://github.com/ruby/irb/pull/831)
https://github.com/ruby/irb/commit/5843616c78
|
|
(https://github.com/ruby/irb/pull/826)
* Fix display_document params in noautocomplete mode
* Fix wrong preposing and target order in display_document
The fixed wrong-ordered value is not used in RegexpCompletor, so this change does not affect the test.
https://github.com/ruby/irb/commit/08208adb5e
|
|
(https://github.com/ruby/irb/pull/818)
https://github.com/ruby/irb/commit/7421359b92
|
|
(https://github.com/ruby/irb/pull/817)
1. Because `IRB.rc_file` always generates an rc file name, even if the
file doesn't exist, we should check the file exists before trying to
load it.
2. If any type of errors occur while loading the rc file, we should
warn the user about it.
https://github.com/ruby/irb/commit/37ffdc6b19
|
|
(https://github.com/ruby/irb/pull/813)
https://github.com/ruby/irb/commit/e79a90a1e6
|
|
(https://github.com/ruby/irb/pull/738)
[DOC] RDoc for module IRB
https://github.com/ruby/irb/commit/f3a0626298
|
|
(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/801)
https://github.com/ruby/irb/commit/a1e431bd83
|
|
(https://github.com/ruby/irb/pull/802)
https://github.com/ruby/irb/commit/173980974b
|
|
(https://github.com/ruby/irb/pull/800)
For apps/libs that test against IRB, it's recommended to set `TERM=dumb`
so they get minimum disruption from Reline's interactive-focus features.
Therefore, we should follow the convention to disable pager when `TERM=dumb`.
https://github.com/ruby/irb/commit/8a3002a39e
|
|
(https://github.com/ruby/irb/pull/798)
https://github.com/ruby/irb/commit/4acc9b8d6c
|
|
(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
|
|
(https://github.com/ruby/irb/pull/795)
* Scrub past history input before split
* Don't rewrite ENV["LANG"]
https://github.com/ruby/irb/commit/0f344f66d9
|
|
(https://github.com/ruby/irb/pull/784)
* Page evaluation result's output
This will make it easier to work with long output that exceeds the terminal's height.
* Use consistent TERM in rendering tests
This makes sure we get consistent result on all platforms.
https://github.com/ruby/irb/commit/4fedce93d3
|
|
implementation
(https://github.com/ruby/irb/pull/772)
https://github.com/ruby/irb/commit/a4868a5373
|
|
* Remove trailing spaces
* Migrate show_source tests to integration tests
Because show_source tests often need to define class and/or methods,
they can easily leak state to other tests. Changing them to integration
tests will ensure that they are run in a clean environment.
* Fix NoMethodError caused by SourceFinder#method_target
https://github.com/ruby/irb/commit/3c39f13397c72a8db24e50afdcb8942e6c4ea12f
|
|
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/789)
If `output_modifier_proc`'s `complete` arg is true, it means the input is
submitted. In that case, debugger hint doesn't provide value to users
and adds noise to the output. So we hide it in such case.
https://github.com/ruby/irb/commit/f86d9dbe2f
|
|
(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/783)
With either `IRB.conf[:USE_PAGER] = false` or `--no-pager` commnad line flag.
I decided use `--no-pager` instead of `--use-pager` because it matches with
Pry and git's command line flags.
https://github.com/ruby/irb/commit/df1c3b9042
|
|
(https://github.com/ruby/irb/pull/768)
When user enters irb:rdbg session, they don't get the same hint that the
`debug` gem provides, like
```
(rdbg) n # next command
```
This means that users may accidentally execute commands when they want to
retrieve the value of a variable.
So this commit adds a Reline output modifier to add a simiar hint:
```
irb:rdbg(main):002> n # debug command
```
It is not exactly the same as `debug`'s because in this case the importance
is to help users distinguish between value evaluation and debugger command
execution.
https://github.com/ruby/irb/commit/fdf24de851
|
|
(https://github.com/ruby/irb/pull/781)
https://github.com/ruby/irb/commit/7d6849e44e
|
|
CaseMatchNode)
(https://github.com/ruby/irb/pull/778)
https://github.com/ruby/irb/commit/943c14b12e
|