A Sinatra Extension that sets up rails like environments base on Chad W Pry's work on github.com/chadwpry/sinatra-initializers
$ gem install sinatra-environments
This Gem depends upon the following:
sinatra ( >= 1.0 )
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-environments" class YourApp < Sinatra::Base register Sinatra::Environments end
In your “classic” Sinatra app, you just require the extension like this:
require "rubygems" require "sinatra" require "sinatra-environments"
The configuration directory may be defined by setting the “config_directory” app variable. Unless it is setup it will default to “config/environments”
Add environment scripts in config/environments. If config/environment.rb exists, it will be loaded before any specific environment file.
Contact me via email!
If something is not behaving intuitively, it is a bug, and should be reported. Report it here: github.com/claco/sinatra-environments/issues
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. Copyright © 2013 Christopher H. Laco. Released under the MIT License.
See LICENSE for details.