Age | Commit message (Collapse) | Author |
|
it for tests
https://github.com/ruby/irb/commit/de561cafeb
|
|
https://github.com/ruby/irb/commit/c24a8e2483
|
|
https://github.com/ruby/irb/commit/4cade4b7e5
|
|
Use in_keyword_case_scope?
Return fast
https://github.com/ruby/irb/commit/8acc7f8dc7
|
|
Instead of accessing the struct as an array, access it via methods. There are other places inside of this file already using this API (for example https://github.com/ruby/ruby/blob/e0a5c3d2b71dfad038d7562fdd33f02ffd79232d/lib/irb/ruby-lex.rb#L829-L830).
This commit moves all struct array-ish calls to use their method calls instead. It is also ~1.23 faster accessing values via a method instead of as an array according to this microbenchmark:
```ruby
Elem = Struct.new(:pos, :event, :tok, :state, :message) do
def initialize(pos, event, tok, state, message = nil)
super(pos, event, tok, State.new(state), message)
end
# ...
def to_a
a = super
a.pop unless a.empty?
a
end
end
class ElemClass
attr_accessor :pos, :event, :tok, :state, :message
def initialize(pos, event, tok, state, message = nil)
@pos = pos
@event = event
@tok = tok
@state = State.new(state)
@message = message
end
def to_a
if @message
[@pos, @event, @tok, @state, @message]
else
[@pos, @event, @tok, @state]
end
end
end
# stub state class creation for now
class State; def initialize(val); end; end
```
```ruby
Benchmark.ips do |x|
x.report("struct") { struct[1] }
x.report("class ") { from_class.event }
x.compare!
end; nil
```
```
Warming up --------------------------------------
struct 1.624M i/100ms
class 1.958M i/100ms
Calculating -------------------------------------
struct 17.139M (± 2.6%) i/s - 86.077M in 5.025801s
class 21.104M (± 3.4%) i/s - 105.709M in 5.015193s
Comparison:
class : 21103826.3 i/s
struct: 17139201.5 i/s - 1.23x (± 0.00) slower
```
Notes:
Merged: https://github.com/ruby/ruby/pull/5093
|
|
The test randomly gets stuck on Solaris:
http://rubyci.s3.amazonaws.com/solaris11-sunc/ruby-master/log/20211105T060014Z.fail.html.gz
```
1) Error:
TestIRB::TestInit#test_recovery_sigint:
Timeout::Error: execution of assert_in_out_err expired timeout (100.0 sec)
pid 3195 killed by SIGTERM (signal 15)
| Switch to inspect mode.
| exit
|
```
I investigated the issue but I couldn't figure it out.
This random failure is noisy, which makes it difficult to track the CI.
So I skip the test on Soalris. Contribution is welcome.
|
|
Rename method
https://github.com/ruby/irb/commit/619aecb412
|
|
https://github.com/ruby/irb/commit/7ee15bc668
|
|
I simply forgot deleting it.
https://github.com/ruby/irb/commit/65399d5e9f
|
|
https://github.com/ruby/irb/commit/460bd12b87
|
|
https://github.com/ruby/irb/commit/68e6ca95a0
|
|
But pending them now because they need dummy document data to show doc.
https://github.com/ruby/irb/commit/ac471ee14e
|
|
|
|
https://github.com/ruby/irb/commit/daa65cded1
|
|
Use first method instead of square brackets to support 2.5 and 2.6 versions
Use tokens
Clear check_newline_depth_difference
https://github.com/ruby/irb/commit/6fec2a5d46
|
|
https://github.com/ruby/irb/commit/05c65858a0
|
|
https://github.com/ruby/irb/commit/5e29e3e39c
|
|
https://github.com/ruby/irb/commit/f4aaa70cfc
|
|
|
|
https://github.com/ruby/irb/commit/fbf52d9608
|
|
https://github.com/ruby/irb/commit/5bf1cb2078
|
|
https://github.com/ruby/irb/commit/b12f0cb8e2
|
|
https://github.com/ruby/irb/commit/4d32f0e88e
|
|
https://github.com/ruby/irb/commit/0aa2425883
|
|
The "csv" doesn't conflict with other stdlib names in any Ruby processing
system.
https://github.com/ruby/irb/commit/49203a1c83
|
|
https://github.com/ruby/irb/commit/74d635758b
|
|
https://github.com/ruby/irb/commit/a1ddf64c69
|
|
"class.method"
https://github.com/ruby/irb/commit/cc1ddb37a9
|
|
https://github.com/ruby/irb/commit/b2324727e1
|
|
https://github.com/ruby/irb/commit/142fc53e9c
|
|
https://github.com/ruby/irb/commit/856f001b60
|
|
https://github.com/ruby/irb/commit/cb9c9c64df
|
|
https://github.com/ruby/irb/commit/33b9bec954
|
|
https://github.com/ruby/irb/commit/fb637bc68f
|
|
https://github.com/ruby/irb/commit/b153d587a1
|
|
https://github.com/ruby/irb/commit/077e4ae7de
|
|
https://github.com/ruby/irb/commit/f441ce35bf
|
|
|
|
https://github.com/ruby/irb/commit/48029944a5
|
|
https://github.com/ruby/irb/commit/6160d74199
|
|
https://github.com/ruby/irb/commit/085ac42947
|
|
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
https://github.com/ruby/irb/commit/b431742430
|
|
such as `ls 42`, `ls :sym` and so on
https://github.com/ruby/irb/commit/b1d436a853
|
|
|
|
https://github.com/ruby/irb/commit/fdd5c0a71e
|
|
|
|
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
https://github.com/ruby/irb/commit/2dfdc031ec
|
|
When `NO_COLOR` is set to any non-nil value, output is not colorized.
See https://no-color.org/
https://github.com/ruby/irb/commit/401d0916fe
|
|
Create a file for test under the temporary directory.
|
|
|