On 2016-11-18 17:29, Ryan Davis wrote:
>> On Nov 18, 2016, at 14:18, KING SABRI <king.sabri / gmail.com> wrote:
>> 
>> Is there anyway to make the ruby commandline detects the .rb files 
>> like python?
> 
> No clue what this means...

What he *probably* means is that he's on Windows, and wants to just type 
<foo.rb> and have it execute.  Which means he needs to go and Google 
"Windows file associations", so that he can associate files ending in 
.rb with the Ruby interpreter.

Note that Ruby, itself, doesn't do this -- rather, the operating system 
does.  (In Linux/Unix, the OS follows the "shebang" method, where if an 
execute-enabled text file's first line begins with "#!", followed by the 
path to an interpreter, typing that file's name will invoke the 
interpreter.  This won't work with Windows because it needs to be told 
about specific file associations.)

-Ken

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