Project

ribbonit

0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
Display an elegant Github like ribbon to your Rails application showing environment informations (Rails environment, Ruby version, Rails version, ...)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.2.33
>= 0
~> 12.0
~> 3.6

Runtime

>= 0
 Project Readme

Ribbonit

Ribbonit displays an elegant ribbon to the corner of the page displaying useful information about the application: Rails environment, Rails version, Ruby version.

It is completely inspired from the Github 'fork me' ribbon.

Gem Version Travis CI Codacy Badge Grade Codacy Badge Coverage Dependency Status

Installation

Add this line to your application's Gemfile:

# Gemfile
gem 'ribbonit'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ribbonit

Usage

  1. Run initializer
$ bin/rails g ribbonit:install

This will create a ribbonit.rb file in config/initializers

  1. Import assets
/* application.css */

/*
*= require ribbon
*/
  1. Call ribbon in layout
/ application.slim
...
body
  = ribbonit

Options

You can customize some options through the initializer. Here are the default ones:

# config/initializers/ribbonit.rb
Ribbonit.configure do |config|
  # rails_version: Version of Ruby on Rails
  # ruby_version: Version of Ruby
  # git_branch: Current git branch (only displayed in development)
  config.infos_to_display = %i[rails_version ruby_version git_branch]

  # additional extra content to display at the bottom of ribbon
  config.extra_content = nil # 'Foo bar'

  config.root_link = false # Wrap ribbon with root_url link ?

  config.hide_for_small = true # Display ribbon in small devices ?
  config.position = 'top-left' # top-right, bottom-left, bottom-right
  config.sticky = true # stick to page corner ?

  # Available colors:
  # orange, blue, green, red, purple, black, white
  config.themes = {
    development: 'black',
    staging: 'blue',
    my_custom_environment: 'purple'
  }
end

To add a custom environment, just add it inside the themes option and set the color you want (careful, if you define config.themes in your initializer it will erase default environments values so you will have to readd them).

Screenshots

Colors

Orange Blue Green Red Purple Black White

Positions

Top/Left Top/Right Bottom/Right Bottom/Left

Environments

Development Staging

Additional informations

Git branch

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