rack-config_env

Build Status Coverage Status

A rack middleware to configure rack env

Installation

Add the following to your Gemfile:

gem 'rack-config_env'

And then execute:

$ bundle

How to Use

This gem provides a rack middleware Rack::ConfigEnv which enables to configure rack's env.

Rails

# config/application.rb
require 'logger'
require 'rack-config_env'

class Application < Rails::Application
  config.autoload_paths += %W(#{config.root}/lib)
  config.middleware.insert_after(0, Rack::ConfigEnv, { 'action_dispatch.logger' => Logger.new(STDOUT) })
end

Middleware check.

bundle exec rake middleware

Sinatra

# config.ru
require 'rack-config_env'

use Rack::ConfigEnv, { 'rack.errors' => STDERR }
run App

ChangeLog

See CHANGELOG.md for details.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright (c) 2014 Naotoshi Seo. See LICENSE.txt for details.