| Age | Commit message (Collapse) | Author |
|
They were added in https://github.com/ruby/irb/commit/b34f26a0dd3b589e6fc321a6248d173682c9202f
https://github.com/ruby/irb/commit/0e760d2674
|
|
https://github.com/ruby/irb/commit/daffb8bfe5
|
|
https://github.com/ruby/irb/commit/0db0a8ddc5
|
|
https://github.com/ruby/irb/commit/45b539af39
|
|
https://github.com/ruby/irb/commit/da54e7f081
|
|
https://github.com/ruby/irb/commit/d14e56a65d
|
|
In addition to String values, $LOAD_PATH can also take objects that
respond_to the `to_path` method, like Pathname objects. So `irb` should
be able to handle those objects too.
And if $LOAD_PATH contains objects that can't be converted into String,
`irb` should simply ignore it.
https://github.com/ruby/irb/commit/b2f562176b
|
|
script
Also add --script option to turn the option back on.
Previously there wasn't a way to get an interactive IRB session
and access arguments provided on the command line.
Additionally, handle `-` as script as stdin. In Unix-like tools, `-`
means to take standard input instead of a file. This doesn't
result in exactly the same output for:
```
echo 'p ARGV' > args.rb; irb args.rb a b c
```
and
```
echo 'p ARGV' | irb - a b c
```
Due to how irb handles whether stdin is a tty.
However, this change allows use of `-` as a argument, instead of
giving an unrecognized switch error. This required some small
changes to context.rb (to handle `-` as standard input) and
input-method.rb (to have FileInputMethod accept IO arguments in
addition to strings).
Implements [Feature #15371]
https://github.com/ruby/irb/commit/4192683ba2
|
|
https://github.com/ruby/irb/commit/6bbde84369
|
|
file doesn't exist
If history file didn't exist when irb was started, @loaded_history_mtime
would be nil. However, if the history file didn't exist before, but it
exists when saving history, that means the history file was modified,
and we should handle it the same way as we handle the other case where
the history file was modified.
Fixes #388
https://github.com/ruby/irb/commit/8d277aafcb
|
|
RDoc is implemented as soft dependency in IRB. See how the rdoc is required in
the files. I reverted the commit below.
```
$ grep -ril rdoc lib/
lib/irb/cmd/help.rb
lib/irb/completion.rb
lib/irb/easter-egg.rb
lib/irb/input-method.rb
```
---
Revert "Remove `require` in signal handler to avoid ThreadError"
This reverts commit https://github.com/ruby/irb/commit/5f749c613c89.
https://github.com/ruby/irb/commit/b24852058f
|
|
This has been introduced in https://github.com/ruby/irb/commit/026700499dfd,
but it seems that this is just be mistake, otherwise the later handling
of `LoadError` would not be needed.
https://github.com/ruby/irb/commit/54c8df06ff
|
|
https://github.com/ruby/irb/commit/8a074a6904
|
|
(https://github.com/ruby/irb/pull/377)
* Include updated help message
https://github.com/ruby/irb/commit/ff129f3794
|
|
(https://github.com/ruby/irb/pull/370)
Changed:
Added text to options that said just 'same as ruby -whatever'.
Added defaults.
Removed an errant tab.
https://github.com/ruby/irb/commit/dfe454cc33
|
|
loaded
ruby/debug uses `irb/color` selectively:
https://github.com/ruby/debug/blob/0ac22406bb8f65bc76f9f5576a00c729cac693af/lib/debug/color.rb#L4
And in that case, `IRB.conf` won't be defined. So Color.colorable? needs
to consider that.
This also fixes the Ruby trunk CI.
https://github.com/ruby/irb/commit/b2cd07e795
|
|
* Use colorable: argument as the only coloring control
* Centalize color controling logic at Color.colorable?
There are 2 requirements for coloring output:
1. It's supported on the platform
2. The user wants it: `IRB.conf[:USE_COLORIZE] == true`
Right now we check 1 and 2 separately whenever we colorize things.
But it's error-prone because while 1 is the default of `colorable`
parameter, 2 always need to manually checked. When 2 is overlooked, it
causes issues like https://github.com/ruby/irb/pull/362
And there's 0 case where we may want to colorize even when the user
disables it. So I think we should merge 2 into `Color.colorable?` so it
can be automatically picked up.
* Add tests for all inspect modes
* Simplify inspectors' coloring logic
* Replace use_colorize? with Color.colorable?
* Remove Context#use_colorize cause it's redundant
https://github.com/ruby/irb/commit/1c53023ac4
|
|
When outputting a (possibly truncated) value, IRB will query the
window size. However, if IRB was piped to another process, stdout
will no longer be a TTY and will not support the `winsize` method.
This fix ensure that stdout is a TTY.
https://github.com/ruby/irb/commit/125de5eeea
|
|
(https://github.com/ruby/irb/pull/362)
https://github.com/ruby/irb/commit/534688dfc4
|
|
If this is at the top level, it stops the documentation of the
entire module, but not only the part in this file.
https://github.com/ruby/irb/commit/86c41b06ad
|
|
If you call `binding.irb` on a class defined `#print`, it will crash, so call `Kernel.print`.
Fix [Bug #18389] `binding.irb` can fail in some classes that implement `context` and `print` methods.
https://github.com/ruby/irb/commit/d54b271984
|
|
https://github.com/ruby/irb/commit/d5060f7668
|
|
1. `require` can mislead Ruby to load system irb's files and cause
constant redefined warnings as other code loads the same module/class
from lib folder.
2. Most files already use `require_relative`.
https://github.com/ruby/irb/commit/848d339f2e
|
|
(https://github.com/ruby/irb/pull/323)
https://github.com/ruby/irb/commit/1c03bd3373
|
|
https://github.com/ruby/irb/commit/b1d9c34441
|
|
https://github.com/ruby/irb/commit/a4b95d6634
|
|
https://github.com/ruby/irb/commit/b80ec5821e
|
|
https://github.com/ruby/irb/commit/f36ad549c4
|
|
Changed to use `#pos` `#event` `#tok` `#state` since using Lexer::Elem#[0~4] now gives a warning.
see: https://github.com/ruby/ruby/commit/8944009be7418614ce7d4077807ac2b60d4d5d85
https://github.com/ruby/reline/commit/9adbb9af32
|
|
`chcp` returns different encoding
https://github.com/ruby/irb/commit/f80971994a
|
|
https://github.com/ruby/irb/commit/4cade4b7e5
|
|
Use in_keyword_case_scope?
Return fast
https://github.com/ruby/irb/commit/8acc7f8dc7
|
|
I pushed reline#389 for when convert-meta is not turned on in .inputrc.
Alt+D in irb also needs to be set to the keycode for not using convert-meta.
https://github.com/ruby/irb/commit/328eddf851
|
|
Fix bug infinite loop when pasting multilines fo code in Ruby 2.6.
This is not reproduced in Ruby 2.7.
Changes added in https://github.com/ruby/irb/pull/242/files#diff-612b926e42ed78aed1a889ac1944f7d22229b3a489cc08f837a7f75eca3d3399R155 are also reflected in Ruby 2.6.
https://github.com/ruby/irb/commit/0a77f75bf0
|
|
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
|
|
Rename method
https://github.com/ruby/irb/commit/619aecb412
|
|
https://github.com/ruby/irb/commit/5018f2cb99
|
|
https://github.com/ruby/irb/commit/3f79cb506f
|
|
https://github.com/ruby/irb/commit/6330601629
|
|
https://github.com/ruby/irb/commit/7ee15bc668
|
|
This reverts commit 27dd2867cda5c789efaa5078214ad2fd82adcebf.
This is to fix the test I added.
(I separated commits to test a new behavior of ruby-commit-hook)
https://github.com/ruby/irb/commit/fe055d521a
|
|
https://github.com/ruby/irb/commit/49b9f644c2
|
|
https://github.com/ruby/irb/commit/4f686afbca
|
|
correctly
https://github.com/ruby/irb/commit/5df6e1f027
|
|
https://github.com/ruby/irb/commit/f34da7fa04
|
|
by using variable names
https://github.com/ruby/irb/commit/a23a88b8c9
|
|
https://github.com/ruby/irb/commit/4d7cefcaa4
|
|
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
|
|
Fixes calling exit after binding.irb.
Fixes [Bug #18234]
https://github.com/ruby/irb/commit/4ea8d376f2
|
|
`rdoc` has been required so it looks unnecessary
https://github.com/ruby/irb/commit/5f749c613c
|