n. A small tool designed to reload your rack application.
$ gem install pistol
# app.rb
require "sinatra/base"
require "pistol"
class App < Sinatra::Base
use Pistol, Dir[__FILE__, "./app/**/*.rb"] do
reset! and load(__FILE__)
end
end
Dir["./app/**/*.rb"].each { |file| require file }
- It instructs Pistol to watch for changes in any of the files passed.
- If changes occur, the block is executed.
Sure. Simply change it to:
class App < Sinatra::Base
configure :development do
use Pistol, Dir[__FILE__, "./app/**/*.rb"] do
reset! and load(__FILE__)
end
end
end