rack-dev-mark
Differentiate development environment from production. You can choose themes
Screenshot
Development

Production

Installation
Add the rack-dev-mark gem to your Gemfile.
gem "rack-dev-mark"
And run bundle install.
For your Rack app
require 'rack/dev-mark'
use Rack::DevMark::Middleware
run MyApp
For your Rails app
In config/application.rb
module MyApp
class Application < Rails::Application
if !%w(production).include?(Rails.env)
config.middleware.insert_before ActionDispatch::ShowExceptions, Rack::DevMark::Middleware
end
end
end
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, revision)
# Do something for your theme
html
end
end
Then, insert it in your app.
For your Rack app
use Rack::DevMark::Middleware, NewTheme.new
For your Rails app
In config/application.rb
module MyApp
class Application < Rails::Application
if !%w(production).include?(Rails.env)
config.middleware.insert_before ActionDispatch::ShowExceptions, Rack::DevMark::Middleware, NewTheme.new
end
end
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Copyright
Copyright (c) 2014 Daisuke Taniwaki. See LICENSE for details.

