rack-dev-mark

Gem Version Build Status Coverage Status

Differentiate development environment from production.

Screenshot

Development

screenshot development

Production

screenshot production

Installation

Add the rack-dev-mark gem to your Gemfile.

gem "rack-dev-mark"

And run bundle install. The rest of the installation depends on whether the asset pipeline is being used.

Then, initialize planbcd.

Usage

For your Rack app

require 'rack/dev-mark'
use Rack::DevMark::Middleware
run MyApp

For your Rails app

This gem inserts rack middleware for all the environment except production automatically.

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

Use custom theme

Define a sub class of Rack::DevMark::Theme::Base somewhere in your app.

require 'rack/dev-mark/theme/base'

class NewTheme < Rack::DevMark::Theme::Base
  def insert_into(html, env)
    # Do something for your theme
    html
  end
end

Then, insert it in your app.

For your Rack app

use Rack::DevMark::Middleware, Rack::DevMark::Theme::NewTheme.new

For your Rails app

module MyApp
  class Application < Rails::Application
    config.middleware.delete Rack::DevMark::Middleware
    config.middleware.use Rack::DevMark::Middleware, NewTheme.new
  end
end

Copyright (c) 2014 Daisuke Taniwaki. See LICENSE for details.