Issue #12634 has been updated by Andrew Vit.


This is handled by your shell before passing to ruby. Compare:

~~~
ruby -e 'puts ARGV.inspect' *
["file1", "file2"]

ruby -e 'puts ARGV.inspect' '*'
["*"]
~~~

----------------------------------------
Bug #12634: Ruby converts '*' on command line to a file name
https://bugs.ruby-lang.org/issues/12634#change-59826

* Author: Krzysztof Wicher
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Repro:
- ruby script.rb *
- script.rb:
puts ARGV[0]

output:
<random file name>

expected output:
*

OS: Windows 10


This is annoying when passing glob as an arg. Also happens when passing anything starting with `*`



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>