From: buonomo.ulysse@... Date: 2021-05-03T16:26:39+00:00 Subject: [ruby-core:103702] [Ruby master Feature#11963] Add a simple static web server to `ruby` Issue #11963 has been updated by ulysse (Ulysse Buonomo). I guess this one can be closed, I've just ran my first `ruby -run -e httpd . -p 8080` using ruby 2.7! ---------------------------------------- Feature #11963: Add a simple static web server to `ruby` https://bugs.ruby-lang.org/issues/11963#change-91794 * Author: sgharms (STeven Harms) * Status: Open * Priority: Normal ---------------------------------------- # Introduction "Good artists copy, great artists steal." - Pablo Picasso `python -m SimpleHTTPServer` starts a static webserver in the local directory. It is helpful in many surprising ways. Ruby lacks a similar idiom. I advocate that Ruby offer something similar. # State of the Art A cursory search shows that this question has been asked a number of times (e.g. StackOverflow, blog posts) and it seems we have, as a community, yet to agree on a simple, clean standard. I believe the best and shortest chant is the following: `ruby -run -e httpd . -p ` I believe this chant is attributable to Aaron Patterson. I find this invocation unsatisfying. First, the use of `un.rb` is, admittedly, quite clever, but therefore also somewhat hard to reason about. *IF* we're going to require users to be able to reason about `-r 'un'`, let's ease their burdens and create a magic flag for `ruby` to run an in-place static server. # Suggested Semantics `ruby -simplewebserver [-p port]` # Do Not Use -m `-m` suggests module or something similar and I don't want to confuse our HONORING Python by inappropriately copying their module semantics # Conclusion At the very least, if this request is denied I'd like to have in the searchable archives why Ruby doesn't support this capability provided by its "cousin," Python. -- https://bugs.ruby-lang.org/ Unsubscribe: