Skip to content

Commit

Permalink
Update readme for the newer version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril David committed Dec 1, 2010
1 parent 85db65b commit eda9586
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.markdown
Expand Up @@ -16,24 +16,26 @@ Usage
require "pistol" require "pistol"


class App < Sinatra::Base class App < Sinatra::Base
use Pistol, :files => Dir[__FILE__, "./app/**/*.rb"] use Pistol, Dir[__FILE__, "./app/**/*.rb"] do
reset! and load(__FILE__)
end
end end


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


### What this does: ### What this does:


1. It marks `app.rb` as the main application file. It's assumed that app.rb 1. It instructs Pistol to watch for changes in any of the files passed.
handles all the loading, boiler plate, etc. 2. If changes occur, the block is executed.
2. It reloads everything in `app/**/*.rb`. You can of course specify
other paths (e.g. `./config/*.rb`, `./lib/*.rb`).


### Only in development? ### Only in development?


Sure. Simply change it to: Sure. Simply change it to:


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

0 comments on commit eda9586

Please sign in to comment.