1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib
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
..
benchmark
bundler Remove warning for old TLS version connection 2022-09-15 14:48:47 +09:00
cgi [ruby/cgi] Implement CGI.url_encode and CGI.url_decode 2022-08-16 19:12:03 +09:00
csv
delegate
did_you_mean [ruby/did_you_mean] Fixed correction duplicates in VariableNameChecker 2022-09-01 19:47:39 +09:00
drb
erb
error_highlight [ruby/error_highlight] Apply ErrorHighlight::CoreExt to TypeError and ArgumentError 2022-08-19 18:34:15 +09:00
forwardable [ruby/forwardable] Move :stopdoc: directive 2022-03-14 14:44:46 +09:00
getoptlong
irb [ruby/irb] Support --noscript option to not use first non-option argument as script 2022-09-17 02:25:26 +09:00
logger [ruby/logger] Enhanced RDoc for Logger 2022-05-13 22:52:53 +09:00
mjit MJIT: Use the built-in PACK_MAP 2022-09-11 15:39:40 +09:00
net [ruby/net-protocol] Improve BufferedIO performance 2022-08-31 12:37:49 +09:00
observer
open3
optparse
ostruct
pstore
racc Update parser-text.rb with 4ecc13c9cb 2022-07-29 19:10:10 +09:00
random
rdoc [ruby/rdoc] Allow multiple footnotes without in-between blank lines 2022-08-08 01:12:49 +09:00
reline [ruby/reline] Fix a typo [ci skip] 2022-09-03 03:27:58 +09:00
rinda
rubygems [rubygems/rubygems] Mask the file mode when extracting files 2022-09-15 14:49:20 +09:00
set [ruby/set] Bump version to 1.0.3 2022-09-06 10:41:20 +09:00
singleton
syntax_suggest Sync SyntaxSuggest 2022-08-19 10:02:24 +09:00
timeout [ruby/timeout] gemspec: Drop unused directives "executables" 2022-07-14 16:21:25 +09:00
unicode_normalize [DOC] hide UnicodeNormalize in module index 2022-03-14 15:01:20 +09:00
uri [ruby/uri] Improve URI.register_scheme tests and automatically upcase the given scheme 2022-05-12 18:19:17 +09:00
weakref
yaml
abbrev.gemspec
abbrev.rb
base64.gemspec
base64.rb
benchmark.rb
bundler.rb Merge 16c3535413 2022-09-05 14:37:12 +09:00
cgi.rb Fix broken links of rdoc 2022-03-17 10:11:38 +09:00
csv.rb
delegate.rb
did_you_mean.rb
drb.rb
English.gemspec
English.rb
erb.gemspec
erb.rb
error_highlight.rb
fileutils.gemspec
fileutils.rb [ruby/fileutils] FileUtils.rm* methods swallows only Errno::ENOENT when force is true 2022-08-23 16:52:41 +09:00
find.gemspec
find.rb
forwardable.rb [ruby/forwardable] Freeze VERSION and FORWARDABLE_VERSION to improve Ractor-compliance 2022-09-08 14:31:42 +09:00
getoptlong.rb [ruby/getoptlong] Fixup https://github.com/ruby/getoptlong/commit/39faa7b390f0 2022-05-09 07:26:29 +09:00
ipaddr.gemspec
ipaddr.rb [ruby/ipaddr] Improve Ractor-compliance 2022-09-08 14:09:06 +09:00
irb.rb [ruby/irb] [DOC] Include updated help message (https://github.com/ruby/irb/pull/377) 2022-07-12 00:05:15 +09:00
logger.rb [ruby/logger] [DOC] Enhanced RDoc for Logger (https://github.com/ruby/logger/pull/77) 2022-05-14 05:02:18 +09:00
mkmf.rb Use $(bindir) for path to executable in mkmf 2022-08-04 16:29:22 +09:00
mutex_m.gemspec
mutex_m.rb
observer.rb
open-uri.gemspec
open-uri.rb [ruby/open-uri] [DOC] Fix markup for URI.open 2022-06-07 00:06:56 +09:00
open3.rb
optionparser.rb
optparse.rb [ruby/optparse] Also accept '-' as an optional argument (https://github.com/ruby/optparse/pull/35) 2022-07-29 19:10:10 +09:00
ostruct.rb [ruby/ostruct] v0.5.5 2022-04-01 00:18:36 +09:00
pp.gemspec
pp.rb
prettyprint.gemspec
prettyprint.rb
pstore.rb [ruby/pstore] Emphasize keys instead of roots, values instead of objects (https://github.com/ruby/pstore/pull/7) 2022-07-07 07:05:01 +09:00
racc.rb
rdoc.rb
readline.gemspec
readline.rb
reline.rb [ruby/reline] Support dumb terminal 2022-09-01 16:36:16 +09:00
resolv-replace.gemspec
resolv-replace.rb
resolv.gemspec
resolv.rb
ruby2_keywords.gemspec
rubygems.rb Merge rubygems/bundler HEAD. 2022-08-09 12:05:19 +09:00
securerandom.gemspec
securerandom.rb
set.rb [ruby/set] Fix a typo 2022-05-16 23:43:04 +09:00
shellwords.gemspec
shellwords.rb
singleton.rb
syntax_suggest.rb Sync SyntaxSuggest 2022-08-19 10:02:24 +09:00
tempfile.gemspec [ruby/tempfile] Drop unused gemspec directives 2022-05-20 17:49:14 +09:00
tempfile.rb [ruby/tempfile] Enhanced RDoc for ::new and ::create (https://github.com/ruby/tempfile/pull/10) 2022-05-20 17:49:14 +09:00
time.gemspec
time.rb fix typo in Time#xmlschema documentation 2022-07-29 19:10:10 +09:00
timeout.rb [ruby/timeout] Give a name to the background thread 2022-07-13 21:16:15 +09:00
tmpdir.gemspec
tmpdir.rb
tsort.gemspec
tsort.rb [ruby/tsort] Small tweaks for easier vendoring 2022-04-18 09:40:07 +09:00
un.gemspec
un.rb [ruby/un] Support FileUtils.cp_lr 2022-07-14 16:26:47 +09:00
uri.rb [ruby/uri] Feat: Support WSS 2022-04-22 11:59:54 +09:00
weakref.rb [DOC] Remove outdated note from WeakRef#initialize 2022-03-14 10:50:52 +01:00
yaml.rb