All Projects → accessd → Rails Env Favicon

accessd / Rails Env Favicon

Licence: mit
Gem to display the rails environment on the favicon

Programming Languages

javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Rails Env Favicon

Plots2
a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! 🎈
Stars: ✭ 666 (+214.15%)
Mutual labels:  environment, rails
Rails Timeago
A Rails helper for time tags that can be used with the jQuery Timeago plugin.
Stars: ✭ 210 (-0.94%)
Mutual labels:  rails
Icare
Open Source Carpooling Platform
Stars: ✭ 196 (-7.55%)
Mutual labels:  rails
Docker Web Framework Examples
Example apps that demonstate how to use Docker with your favorite web frameworks.
Stars: ✭ 204 (-3.77%)
Mutual labels:  rails
Ruby Docs Samples
Ruby samples for Google Cloud Platform products.
Stars: ✭ 198 (-6.6%)
Mutual labels:  rails
Stupidedi
Ruby API for parsing and generating ASC X12 EDI transactions
Stars: ✭ 205 (-3.3%)
Mutual labels:  rails
Emacs Direnv
direnv integration for emacs
Stars: ✭ 194 (-8.49%)
Mutual labels:  environment
Sorcery
Magical authentication for Rails 3 & 4
Stars: ✭ 2,345 (+1006.13%)
Mutual labels:  rails
Empirical Core
Empirical-Core is our web app for managing students, assigning activities, and viewing results. Core seamlessly incorporates 3rd party applications via the Empirical API.
Stars: ✭ 209 (-1.42%)
Mutual labels:  rails
Arctic admin
Responsive Theme for ActiveAdmin
Stars: ✭ 201 (-5.19%)
Mutual labels:  rails
On ruby
💎 ♦️ Whitelabel Site for Ruby Communities
Stars: ✭ 201 (-5.19%)
Mutual labels:  rails
Rabl Rails
Rails 4.2 & 5 templating system with JSON, XML and Plist support.
Stars: ✭ 200 (-5.66%)
Mutual labels:  rails
Activerecord Turntable
ActiveRecord Sharding Plugin
Stars: ✭ 206 (-2.83%)
Mutual labels:  rails
Ansible Rails
Ruby on Rails deployment using Ansible - with Lets Encrypt, Sidekiq, PostgreSQL, nginx & puma
Stars: ✭ 199 (-6.13%)
Mutual labels:  rails
Terraform Aws Elastic Beanstalk Environment
Terraform module to provision an AWS Elastic Beanstalk Environment
Stars: ✭ 211 (-0.47%)
Mutual labels:  environment
Todo Apps
Sample ToDo application (various languages) running on IBM Cloud
Stars: ✭ 195 (-8.02%)
Mutual labels:  rails
Env Var
Verification, sanitization, and type coercion for environment variables in Node.js
Stars: ✭ 201 (-5.19%)
Mutual labels:  environment
Vuejs Rails Starterkit
Vue.js + Rails Starting Kit GitHub Template to develop Hybrid Mobile Application: https://vuejs-rails-starterkit.herokuapp.com
Stars: ✭ 205 (-3.3%)
Mutual labels:  rails
Bugsnag Ruby
Bugsnag error monitoring & reporting software for rails, sinatra, rack and ruby
Stars: ✭ 211 (-0.47%)
Mutual labels:  rails
Environ Config
Python Application Configuration With Environment Variables
Stars: ✭ 210 (-0.94%)
Mutual labels:  environment

Rails Env Favicon

Gem Version

Made changes in the code to debug and do not understand what's wrong. Hell, I'm on the debug production! This happened to you? To me several times. Library offers one of the ways to solve this problem.

Most everyone will understand from one picture:

ScreenShot

This means that on the first tab we have development environment, on second stage, and third it's production(we don't need change this favicon).

It uses Tinycon - A small library for manipulating the favicon.

And one more option:

ScreenShot

Icon will be gray on non production environment.

It you need this separately you can use Grayscale-Favicon - adopted for node package managers version.

Js usage for this task justified by the fact that more often than not have to worry about favicon caching, because favicon changes on the fly after it's loaded. However, if you do not like to use js for this problem, you may use alternative version of gem which uses https://github.com/rmagick/rmagick, follow to branch rmagick

Installation

Add this line to your application's Gemfile:

gem 'rails-env-favicon'

And then execute:

$ bundle

Setup:

# adds initializer
rails g rails_env_favicon:install

In your JavaScript manifest (e.g. application.js):

//= require rails_env_favicon

Config

In config/initializers/rails_env_favicon.rb

RailsEnvFavicon.setup do |config|
  # If true then favicon will be gray on non production env
  config.make_grayscale = false
  # or if make_grayscale = false then draw badge on favicon with this options:
  config.text_color = '#ffffff'
  config.background_color = '#549a2f'
end

You can also configure the condition of changing favicon and badge label, just override RailsEnvFavicon module methods. For example:

module RailsEnvFavicon
  def self.badge_label
    ENV['TEATRO'].present? ? 'T' : ::Rails.env.first.upcase
  end

  def self.applicable?
    !::Rails.env.production? || ENV['TEATRO'].present?
  end
end

Issues

  • If you change a configuration to apply changes, you have to:

    • Execute rm -rf tmp/cache/* in app directory, for assets cache cleaning.
    • Restart web server.

Contributing

  1. Fork it ( http://github.com/accessd/rails_env_favicon/fork )
  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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].