Project

General

Profile

Actions

Feature #8586

closed

Add a simple file server to WEBrick

Added by tenderlovemaking (Aaron Patterson) over 11 years ago. Updated almost 3 years ago.

Status:
Closed
Target version:
-
[ruby-core:55722]

Description

Hi,

Frequently I need to run a simple file server in a directory, for example to temporarily share files, or try out some html / JS. If I want to do this with Ruby, I have to download a gem, or write a few lines with WEBrick.

I'd like to add a simple file server that when required will just serve the files from the current directory like this:

Simple WEBrick file server. Usage:

Start the file server, serving the files in the current directory

$ ruby -rwebrick/simple -e start

Start the file server, serving the files in the current directory on

port 5000.

$ ruby -rwebrick/simple -e start 5000

Start the file server, serving the files in /tmp on port 5000.

$ ruby -rwebrick/simple -e start 5000 /tmp

I've attached the patch that implements this. Thanks!


Files

fs.patch (780 Bytes) fs.patch tenderlovemaking (Aaron Patterson), 07/01/2013 08:00 AM

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • Status changed from Open to Closed

ruby -run -e httpd -- -p 5000 /tmp

Actions #2

Updated by hsbt (Hiroshi SHIBATA) almost 3 years ago

  • Project changed from 14 to Ruby master
Actions

Also available in: Atom PDF

Like0
Like0Like0