Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Explain: ruby -run -e httpd

Tags:

ruby

I know that this command will serve file and folders from the current directory but how does it work? I know that -e allows to run the statement from the command line. But I could not find any info about -run switch. Also, I could now find method httpd which according to this should be on the Object

like image 932
Petr Beneš Avatar asked Jan 20 '18 10:01

Petr Beneš


1 Answers

But I could not find any info about -run switch.

There is no -run switch. There is an -r switch (which is simply equivalent to requireing the named file) and an un library. Just like there was no -rubygems switch in Ruby 1.9—2.4, there was the -r switch and an ubygems library (which was removed in Ruby 2.5).

Also, I could now find method httpd which according to this should be on the Object

There seems to be a bug with either the RDoc documentation generation or Ruby-Doc.org; the documentation of the un library is empty, but the method is there. Note that YARD seems to process the documentation correctly, as can be seen on the RubyDoc.info version of the same documentation.

like image 122
Jörg W Mittag Avatar answered Nov 13 '22 00:11

Jörg W Mittag