Skip to content

Commit

Permalink
Add initial README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril David committed Oct 8, 2010
1 parent af21079 commit 7e878e8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.markdown
@@ -0,0 +1,39 @@
Pistol
======

_n. A small tool designed to reload your rack application._

Get it!
-------

$ gem install pistol

Usage
-----

# app.rb
require "sinatra/base"
require "pistol"

class App < Sinatra::Base
use Pistol, :files => Dir[__FILE__, "./app/**/*.rb"]
end

Dir["./app/**/*.rb"].each { |file| require file }

### What this does:

1. It marks `app.rb` as the main application file. It's assumed that app.rb
handles all the loading, boiler plate, etc.
2. It reloads everything in `app/**/*.rb`. You can of course specify
other paths (e.g. `./config/*.rb`, `./lib/*.rb`).

### Only in development?

Sure. Simply change it to:

class App < Sinatra::Base
configure :development do
use Pistol, :files => Dir[__FILE__, "./app/**/*.rb"]
end
end

0 comments on commit 7e878e8

Please sign in to comment.