Project

staff_bar

0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
Show a bar with general project information for administrators.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Staff bar

Preview

Staff bar is a tiny utility for Ruby on Rails projects. It shows a bar with some basic project information: commit hash, branch, Ruby & Rails versions, environment and caching status. You can also make a list of links that you want to show on a bar for a quick access to your internal tools.

Usage

# Add this to Gemfile
gem 'staff_bar'

# Install dependencies
bundle

Add this to app/views/layouts/application.html.erb:

...
</head>

<body>
  <%= staff_bar if current_user.staff? %>

  <%= yield %>
</body>
...

(you can change current_user.staff? to whatever your administrators logic is of course.)

Add this to your application.css to use default styles:

*= require staff_bar

To show current branch, add staff_bar capistrano tasks in Capfile:

require "staff_bar/capistrano"

This will create BRANCH file when deploying, which will staff bar use to show the branch.

Configuration

# app/config/initializers/staff_bar.rb
StaffBar.configure do |config|
  config.links = [
    { url: '/jobs', title: 'Jobs queue' },
    { url: '/logs', title: 'Open logs' }
  ];

  config.theme = :dark # or :light
  config.position = :bottom # or :top
  config.highlight_envs = [:production]
end

License

The gem is available as open source under the terms of the MIT License.