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 +4 -4
- data/CHANGES.md +7 -0
- data/README.md +12 -0
- data/app/assets/javascripts/rails_env_favicon.js.erb +2 -2
- data/lib/rails-env-favicon.rb +5 -1
- data/lib/rails-env-favicon/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef4c05add59d76f8e0cbedac117b65206da795e1
|
4
|
+
data.tar.gz: 2f986559bd2b8f63d17b784413f6ff5bd736cff7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00ed51cebcbd0d733d2414b1cd13bf23f5dbdcf8017b6dc68af1f072fd99894bd3e1b9439ea6bc25cfd70519cf523feb23b858e611afee868e59d9d6caf4f775
|
7
|
+
data.tar.gz: fc220a0e7f85afc2c0a67e857cee44a07cf44dda318e82a25bd6145cad5018cb1a95c248c92d3abf283e443789543aa1ced8b825d1bc34b960c1fa082957a505
|
data/CHANGES.md
ADDED
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
|
-
<%
|
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.
|
15
|
+
Tinycon.setBubble("<%= RailsEnvFavicon.badge_label %>");
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
data/lib/rails-env-favicon.rb
CHANGED
@@ -10,10 +10,14 @@ module RailsEnvFavicon
|
|
10
10
|
mattr_accessor :make_grayscale
|
11
11
|
self.make_grayscale = false
|
12
12
|
|
13
|
-
def self.
|
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
|
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
|
+
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-
|
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
|