A Sinatra Extension that sets up rails like initializers
$ gem install sinatra-initializers
This Gem depends upon the following:
-
sinatra ( >= 1.0 )
-
bundle install
-
Execute rake or rspec
To view the settings in your app, just require and register the extension in your sub-classed Sinatra app:
require 'sinatra-initializers' class YourApp < Sinatra::Base register Sinatra::Initializers end
In your “classic” Sinatra app, you just require the extension like this:
require 'rubygems' require 'sinatra' require 'sinatra-initializers'
The configuration directory may be defined by setting the “config_directory” app variable. Unless it is setup it will default to “config/initializers”
Add initializer scripts in config/initializers. Naming follows a strict pattern of number then name for order priority
00-first_initializer.rb 01-second_initializer.rb
Contact me via email!
If something is not behaving intuitively, it is a bug, and should be reported. Report it here: github.com/chadwpry/sinatra-initializers/issues
-
TBD
-
Fork the project.
-
Make your feature addition or bug fix.
-
Commit, do not mess with rakefile, version, or history.
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
-
Send me a pull request. Bonus points for topic branches.
Copyright © 2011 Chad W Pry. Released under the MIT License.
See LICENSE for details.