rails-env-favicon 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 360876ef2a17013757041f0c08850c43c7cd5a46
4
- data.tar.gz: 061d6dbb8015cfc604289a955dc2bb9e07febf66
3
+ metadata.gz: ef4c05add59d76f8e0cbedac117b65206da795e1
4
+ data.tar.gz: 2f986559bd2b8f63d17b784413f6ff5bd736cff7
5
5
  SHA512:
6
- metadata.gz: 7ee020c8021c9d3d5d3980f9db9f5fa123c7abdfa6a5aa1faa904e70e106a8135adb5940f26659c21ad573c1f2dcddb0c947b1a0d2ffadbb6d159eb498acfde9
7
- data.tar.gz: 122b036f8bacbd22753edc1193773bb562bd3ebcc2839290056e700168f942436ec1fa8d0108c97fe523301bb2f8b84b337b8efbda4506fc9505711b4c7ff317
6
+ metadata.gz: 00ed51cebcbd0d733d2414b1cd13bf23f5dbdcf8017b6dc68af1f072fd99894bd3e1b9439ea6bc25cfd70519cf523feb23b858e611afee868e59d9d6caf4f775
7
+ data.tar.gz: fc220a0e7f85afc2c0a67e857cee44a07cf44dda318e82a25bd6145cad5018cb1a95c248c92d3abf283e443789543aa1ced8b825d1bc34b960c1fa082957a505
@@ -0,0 +1,7 @@
1
+ ## v0.0.5
2
+
3
+ * added the ability to configure the conditions of changing favicon and badge label
4
+
5
+ ## v0.0.4
6
+
7
+ * add option for grayscale favicon
data/README.md CHANGED
@@ -54,6 +54,18 @@ In config/initializers/rails_env_favicon.rb
54
54
  config.background_color = '#549a2f'
55
55
  end
56
56
 
57
+ You can also configure the condition of changing favicon and badge label, just override `RailsEnvFavicon` module methods. For example:
58
+
59
+ module RailsEnvFavicon
60
+ def self.badge_label
61
+ ENV['TEATRO'].present? ? 'T' : ::Rails.env.first.upcase
62
+ end
63
+
64
+ def self.applicable?
65
+ !::Rails.env.production? || ENV['TEATRO'].present?
66
+ end
67
+ end
68
+
57
69
 
58
70
  Contributing
59
71
  -------------
@@ -1,4 +1,4 @@
1
- <% unless Rails.env.production? %>
1
+ <% if RailsEnvFavicon.applicable? %>
2
2
  <% if RailsEnvFavicon.make_grayscale %>
3
3
  <%= require_asset "grayscale-favicon.js" %>
4
4
  GrayscaleFavicon.grayscale();
@@ -12,6 +12,6 @@
12
12
  fallback: true
13
13
  });
14
14
 
15
- Tinycon.setBubble("<%= RailsEnvFavicon.env_letter %>");
15
+ Tinycon.setBubble("<%= RailsEnvFavicon.badge_label %>");
16
16
  <% end %>
17
17
  <% end %>
@@ -10,10 +10,14 @@ module RailsEnvFavicon
10
10
  mattr_accessor :make_grayscale
11
11
  self.make_grayscale = false
12
12
 
13
- def self.env_letter
13
+ def self.badge_label
14
14
  ::Rails.env.first.upcase
15
15
  end
16
16
 
17
+ def self.applicable?
18
+ !::Rails.env.production?
19
+ end
20
+
17
21
  class << self
18
22
  def setup
19
23
  yield self
@@ -1,3 +1,3 @@
1
1
  module RailsEnvFavicon
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-env-favicon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Accessd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-09 00:00:00.000000000 Z
11
+ date: 2014-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -74,6 +74,7 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
+ - CHANGES.md
77
78
  - Gemfile
78
79
  - LICENSE.txt
79
80
  - README.md