Elegant Github like ribbon that displays informations about your Rails application
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
spec
vendor/assets
.github_changelog_generator
.gitignore
.rubocop.yml
.simplecov
.travis.yml
CHANGELOG.md
Gemfile
README.md
Rakefile
ribbonit.gemspec

README.md

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.sass
@import 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]

  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