<commit_before>= adsf

adsf (A Dead Simple Fileserver) is a tiny static file server that you can launch instantly in any directory, like this:

  attignawantan ✓ ~/my_site ▸ ls -l
  total 0
  drwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 about
  drwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 contact
  -rw-r--r--  1 ddfreyne  staff   0 May 29 10:04 index.html
  drwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 projects
  attignawantan ✓ ~/my_site ▸ adsf
  2009-05-29 10:04:44] INFO  WEBrick 1.3.1
  [2009-05-29 10:04:44] INFO  ruby 1.8.7 (2008-08-11) [i686-darwin9.6.1]
  [2009-05-29 10:04:44] INFO  WEBrick::HTTPServer#start: pid=2757 port=3000

… and now you can go to http://localhost:3000/ and start browsing.

Some more details about adsf:

* adsf has only one feature and that is serving static files.
* The only documentation you'll get is from the --help commandline option. :)
* Rack is the only dependency.
* It is licenced under the MIT licence.

== Authors

* <NAME>
* <NAME>

== Contact

You can reach me at <<EMAIL>>.<commit_msg>documented using adsf programmatically<commit_after>= adsf

adsf (A Dead Simple Fileserver) is a tiny static file server that you can launch instantly in any directory, like this:

  attignawantan ✓ ~/my_site ▸ ls -l
  total 0
  drwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 about
  drwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 contact
  -rw-r--r--  1 ddfreyne  staff   0 May 29 10:04 index.html
  drwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 projects
  attignawantan ✓ ~/my_site ▸ adsf
  2009-05-29 10:04:44] INFO  WEBrick 1.3.1
  [2009-05-29 10:04:44] INFO  ruby 1.8.7 (2008-08-11) [i686-darwin9.6.1]
  [2009-05-29 10:04:44] INFO  WEBrick::HTTPServer#start: pid=2757 port=3000

… and now you can go to http://localhost:3000/ and start browsing.

Some more details about adsf:

* adsf has only one feature and that is serving static files.
* Rack is the only dependency.
* It is licenced under the MIT licence.

== Using adsf programmatically

You can use adsf programmatically in your Rack applications. nanoc (http://nanoc.stoneship.org/) uses adsf for its “view” command, for example. adsf consists of one middleware class that finds index filenames, and rewrites these requests so that Rack::File can be used to serve these files.

Here’s an example middleware/application stack that runs a web server with the "public/" directory as its web root:

	use Adsf::Rack::IndexFileFinder, :root => "public/"
	run Rack::File.new("public/")

The +:root+ option is required; it should contain the path to the web root.

You can also specify an +:index_filenames+ option, containing the names of the index filenames that will be served when a directory containing an index file is requested. Usually, this will simply be +[ 'index.html' ]+, but under different circumstances (when using IIS, for exmaple), the array may have to be modified to include index filenames such as +default.html+ or +index.xml+. Here’s an example middleware/application stack that uses custom index filenames:

	use Adsf::Rack::IndexFileFinder,
	  :root => "public/",
	  :index_filenames => %w( index.html index.xhtml index.xml )
	run Rack::File.new("public/")

== Authors

* <NAME>
* <NAME>

== Contact

You can reach me at <<EMAIL>>.
{'fraction_non_alphanumeric': 0.09551597051597052, 'fraction_numerical': 0.06756756756756757, 'mean_word_length': 3.7134587554269176, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2911178', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1111, 'n_words': 454}