From 7e878e8a8f0f31c717fca0be945f41e9236f620d Mon Sep 17 00:00:00 2001 From: Cyril David Date: Fri, 8 Oct 2010 16:20:29 +0800 Subject: [PATCH] Add initial README. --- README.markdown | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.markdown diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..65246b3 --- /dev/null +++ b/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 \ No newline at end of file