(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
* We always need use_sigaltstack=0 because Ruby registers sigaltstack
handlers
* We also need to disable leak detection (unless RUBY_FREE_AT_EXIT is
set - I might experiment later with automatically enabling leak
detection if RUBY_FREE_AT_EXIT is set).
Burning it into the built ruby binary in this way avoids people needing
to remember to start their Ruby program with these flags all the time.
We also need a small fix in mkmf to make sure that test programs also
don't have leak detection enabled (this is never desirable)
[Bug #20256]
(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>
Attribute readers and writers can be marked as `:nodoc` to keep them
undocumented:
```ruby
attr_reader :name # :nodoc:
```
For aliases this behaviour should be the same:
```ruby
alias_method :old :new # :nodoc:
```
https://github.com/ruby/rdoc/commit/30f14e8271
* add bin/prism ripper to compare Ripper output
* block arg handling is quirky, do it per-call-site
* block required params
* boolean values
* various assign-operator support
* breaks, early fragile begin/rescue/end
* more fixtures being checked
https://github.com/ruby/prism/commit/31732cb720
We keep adding more scripts to /bin that are doing the same kinds
of processing. Instead, this commit consolidates them all into a
single CLI that shares the same logic so that we can consistently
read files in the same way.
It keeps around 2 binstubs for bin/lex and bin/parse since those
are the most used and I'm sure people have built up muscle memory
for those. Those scripts are now just wrappers for forwarding to
bin/prism.
https://github.com/ruby/prism/commit/bddcb9bf17