1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
Jeremy Evans b07db96744 [ruby/irb] Support --noscript option to not use first non-option argument as 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
2022-09-17 02:25:26 +09:00
..
-ext-
base64
benchmark
bigdecimal
cgi
coverage
csv
date
did_you_mean
digest
drb
dtrace
erb
error_highlight
etc
excludes
fiber
fiddle
fileutils
fixtures/fake_sorted_set_gem
io
irb
json
lib
logger
mkmf
monitor
net
nkf
objspace
open-uri
openssl
optparse
ostruct
pathname
psych
racc
rdoc
readline
reline
resolv
rinda
ripper
ruby
rubygems
socket
stringio
strscan
syslog
uri
win32ole
yaml
zlib
runner.rb
test_abbrev.rb
test_delegate.rb
test_extlibs.rb
test_find.rb
test_forwardable.rb
test_getoptlong.rb
test_ipaddr.rb
test_mutex_m.rb
test_observer.rb
test_open3.rb
test_pp.rb
test_prettyprint.rb
test_pstore.rb
test_pty.rb
test_rbconfig.rb
test_securerandom.rb
test_set.rb
test_shellwords.rb
test_singleton.rb
test_sorted_set.rb
test_syslog.rb
test_tempfile.rb
test_time.rb
test_timeout.rb
test_tmpdir.rb
test_trick.rb
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb