Sinatra::Environments

A Sinatra Extension that sets up rails like environments base on Chad W Pry's work on github.com/chadwpry/sinatra-initializers

Installation

$  gem install sinatra-environments

Dependencies

This Gem depends upon the following:

Runtime:

  • sinatra ( >= 1.0 )

Development & Tests:

  • bundle install

  • Execute rake or rspec

Getting Started

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"

Configuration Options

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.

config/environment.rb
config/environments/development.rb

More detail needed?

Contact me via email!

Errors / Bugs

If something is not behaving intuitively, it is a bug, and should be reported. Report it here: github.com/claco/sinatra-environments/issues

TODOs

  • TBD

Note on Patches/Pull Requests

  • 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

Copyright © 2011 Chad W Pry. Released under the MIT License. Copyright © 2013 Christopher H. Laco. Released under the MIT License.

See LICENSE for details.