Age | Commit message (Collapse) | Author |
|
From Reidline to Reline
Update description used in take_corresponding_syntax_to_kw_do and is_the_in_correspond_to_a_for methods
Use possessive noun correctly
Second element
https://github.com/ruby/irb/commit/4fa9714d6f
|
|
https://github.com/ruby/irb/commit/692eb9b9b5
|
|
https://github.com/ruby/irb/commit/5af637b3c1
|
|
https://github.com/ruby/irb/commit/973bac83ff
|
|
https://github.com/ruby/irb/commit/e736a77076
|
|
|
|
This fixes at least an issue where irb will incorrectly assume
code opens a heredoc when it does not, such as this code:
```ruby
s1 = 'testing'
s2 = 'this'
s2 <<s1
p s1
s1
```
Ruby parses the `s2 <<s1` as `s2.<<(s1)`, not as a heredoc, because
`s2` is a local variable in scope. irb was using ripper without
letting ripper know that `s2` was a local variable, so ripper would
lex it as a heredoc instead of a method call.
Fix the situation by prepending a line at line 0 with all local
variable definitions in scope whenever lexing. This fixes the
heredoc issue, and potentially other issues that depend on whether
an identifier is a local variable or not.
Fixes [Bug #17530]
https://github.com/ruby/irb/commit/4ed2187f76
|
|
Follow https://github.com/ruby/irb/pull/237.
This PR fixes the following `Encoding::ConverterNotFoundError`.
```console
% bin/spring stop && bin/rails c
Spring stopped.
Running via Spring preloader in process 58395
Loading development environment (Rails 6.0.3.7)
irb(main):001:0> "こんにちは".do_something
Traceback (most recent call last):
(snip)
12: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:547:in `eval_input'
11: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:232:in `each_top_level_statement'
10: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:232:in `catch'
9: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:233:in `block in each_top_level_statement'
8: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:233:in `loop'
7: from /Users/koic/src/github.com/ruby/irb/lib/irb/ruby-lex.rb:251:in `block (2 levels) in each_top_level_statement'
6: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:548:in `block in eval_input'
5: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:758:in `signal_status'
4: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:586:in `block (2 levels) in eval_input'
3: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:650:in `handle_exception'
2: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `encode_with_invalid_byte_sequence'
1: from /Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `new'
/Users/koic/src/github.com/ruby/irb/lib/irb.rb:601:in `initialize': code
converter not found (UTF-8 to UTF-8) (Encoding::ConverterNotFoundError)
```
First, this patch skips `Encoding::Converter.new` for the same encoding.
https://github.com/ruby/irb/blob/170531df19bce289444afe97360480efed5f27f0/lib/irb.rb#L601
Next, this is a talk about the condition for skipping. `IRB.conf[:LC_MESSAGES].encoding`
becomes `"UTF-8"` string when `Reline.encoding_system_needs.name` is set in the below.
https://github.com/ruby/irb/blob/170531df19bce289444afe97360480efed5f27f0/lib/irb/input-method.rb#L269
OTOH, `message.encoding` is `Encoding::UTF_8`, so these are compared as a string by this patch.
https://github.com/ruby/irb/commit/6df6e76cfc
|
|
https://github.com/ruby/irb/commit/4452adbe04
|
|
https://github.com/ruby/irb/commit/5832cfe75b
|
|
While here, fixing tab/space issues in help message, and sync
rdoc for IRB class to match the help message.
https://github.com/ruby/irb/commit/ef8e3901cc
|
|
* using the appropriciate exception instead of `break` so that the session
can be continue after the `irb_source` and `irb_load` commands
* suppress extra new line due to one more `#prompt` call
https://github.com/ruby/irb/commit/bdefaa7cfd
|
|
https://github.com/ruby/irb/commit/fcf6b34bc5
|
|
https://github.com/ruby/irb/commit/36118015ba
|
|
https://github.com/ruby/irb/commit/30dc5d43fe
|
|
[Bug #17466]
https://github.com/ruby/irb/commit/1c76845cca
|
|
https://github.com/ruby/irb/commit/d09d3c3d68
|
|
This fixes ruby/irb#141.
https://github.com/ruby/irb/commit/0815317d42
|
|
https://github.com/ruby/irb/commit/b43f35d8f3
|
|
You can use "measure" command to check performance in IRB like below:
irb(main):001:0> 3
=> 3
irb(main):002:0> measure
TIME is added.
=> nil
irb(main):003:0> 3
processing time: 0.000058s
=> 3
irb(main):004:0> measure :off
=> nil
irb(main):005:0> 3
=> 3
You can set "measure :on" by "IRB.conf[:MEASURE] = true" in .irbrc, and, also,
set custom performance check method:
IRB.conf[:MEASURE_PROC][:CUSTOM] = proc { |context, code, line_no, &block|
time = Time.now
result = block.()
now = Time.now
puts 'custom processing time: %fs' % (Time.now - time) if IRB.conf[:MEASURE]
result
}
https://github.com/ruby/irb/commit/3899eaf2e2
|
|
https://github.com/ruby/irb/commit/fc1426d34e
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3688
|
|
ECHO_ON_ASSIGNMENT
https://github.com/ruby/irb/commit/4c89b0775b
|
|
https://github.com/ruby/irb/commit/0feeae38c5
|
|
Omit the results evaluated at assignment if they are too long.
The behavior of ECHO_ON_ASSIGNMENT being on by default is hard to understand,
so I change it to off by default. Instead, we turn OMIT_ON_ASSIGNMENT on by
default. The result is displayed on assignment, but it will always be short
and within one line of the screen.
https://github.com/ruby/irb/commit/c5ea79d5ce
|
|
https://github.com/ruby/irb/commit/0ac3bc7296
|
|
|
|
https://github.com/ruby/irb/commit/13572d8cdc
|
|
The old implementation performance test code:
require 'objspace'
puts "%.5g MB" % (ObjectSpace.memsize_of_all * 0.001 * 0.001)
/\A.*\Z/ !~ ('abc' * 20_000_000)
puts "%.5g MB" % (ObjectSpace.memsize_of_all * 0.001 * 0.001)
and run `time test.rb`:
2.5868 MB
62.226 MB
real 0m1.307s
user 0m0.452s
sys 0m0.797s
The new implementation performance test code:
require 'objspace'
puts "%.5g MB" % (ObjectSpace.memsize_of_all * 0.001 * 0.001)
('abc' * 20_000_000).include?("\n")
puts "%.5g MB" % (ObjectSpace.memsize_of_all * 0.001 * 0.001)
and run `time test.rb`:
2.5861 MB
62.226 MB
real 0m0.132s
user 0m0.088s
sys 0m0.042s
https://github.com/ruby/irb/commit/40d6610baf
|
|
https://github.com/ruby/irb/commit/e37dc7e58e
|
|
https://github.com/ruby/irb/commit/ed5cf375a6
https://github.com/ruby/irb/commit/5b7bbf9c34
|
|
https://github.com/ruby/irb/commit/9eb1801a66
|
|
https://github.com/ruby/irb/commit/4bb1340687
|
|
Fixed misspellings reported at [Bug #16437], for default gems.
|
|
|
|
|
|
|
|
Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
|
Untaint is deprecated and has no effect on Ruby 2.7+.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2615
|
|
Fixes Ruby Bug 9876.
|
|
When reading Binding#irb, the file of the calling source is reflected in __FILE__ and __dir__.
Notes:
Merged: https://github.com/ruby/ruby/pull/1896
|
|
|
|
This reverts commit 1ee88c51b3c319b74b69540e111e4a1c24833cad.
|
|
|
|
e9e17cbc051e894dfd27eda5feca2939f65552db (enabling the warning by
default) caused a warning in test-spec:
```
/data/chkbuild/tmp/build/20190802T213005Z/ruby/spec/ruby/core/binding/irb_spec.rb
Binding#irb
- creates an IRB session with the binding in scope/data/chkbuild/tmp/build/20190802T213005Z/ruby/spec/ruby/core/binding/fixtures/irb.rb:3: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190802T213005Z.log.html.gz
ref: [Bug #4352]
|
|
|
|
|
|
|
|
|