all-the-favicons 0.5.5 → 0.5.6

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
  SHA256:
3
- metadata.gz: ce08e818fabad64be32e96aa7244ee87991b569bcb954815d9093e55b8c3914d
4
- data.tar.gz: b6fec60b53b51ed058fc01741719b1aa077ccaf7b1cd738cfd9a85271dd07206
3
+ metadata.gz: a8b4ec7e5d37ab55e4aad76526326a84f79bf993df255296bd11ac58e41c2c50
4
+ data.tar.gz: 9c08fb3da6b050697348c9e7f6a600dd457d61253ef169a43f45b818c97a9b35
5
5
  SHA512:
6
- metadata.gz: 9c9fc3b85a77b3434a825a9eda6f6114e57f45818b2790fe55db8788789820248ddc958827aae06257ca061eb088b19c6720b0fafa520a7fb15ac852932c874f
7
- data.tar.gz: e7d83f5537bbc828a8a74b61ab71c3166dab25a600dbe6e236c92994ebfbea4ae0fb666b3404b673d51494995760e087b4428b86912bf551ea94ef63c329d40d
6
+ metadata.gz: a4ecb1d52242d339409f1f32eb207dbfdc40c6d7c2a8a3293d5d8ccba52b3a017809aa8bfe8fce6361d54098624ca80844adfd0a276ea3e285d81372f1b2d563
7
+ data.tar.gz: 3092929fcf9a9195378cd4ce8e23aa5496a99bf0acd4f233e5755f53b04e0fa696dcc7d866883e9e7a8af2c9dc2f213f6a92d0213f84238d5f69e280ac11d2dc
data/README.md CHANGED
@@ -30,8 +30,10 @@ You can configure colors by adding an initializer (ie
30
30
 
31
31
  ``` ruby
32
32
  AllTheFavicons.name = "MyApp" # For the Android Chrome manifest
33
+ AllTheFavicons.short_name = "MyApp"
33
34
  AllTheFavicons.ms_tile_color = "#2d89ef"
34
35
  AllTheFavicons.pinned_tab_color = "#000000"
36
+ AllTheFavicons.background_color = "#ffffff"
35
37
  AllTheFavicons.theme_color = "#ffffff"
36
38
  ```
37
39
 
@@ -5,10 +5,7 @@ class FaviconsController < ActionController::Base
5
5
  end
6
6
 
7
7
  def manifest
8
- render json: {
9
- name: AllTheFavicons.name,
10
- icons: AllTheFavicons::Android.all.map { |i| android_icon(i) }
11
- }.to_json
8
+ render json: manifest_data.to_json
12
9
  end
13
10
 
14
11
  def favicon
@@ -17,6 +14,15 @@ class FaviconsController < ActionController::Base
17
14
 
18
15
  private
19
16
 
17
+ def manifest_data
18
+ { name: AllTheFavicons.name,
19
+ short_name: AllTheFavicons.short_name,
20
+ background_color: AllTheFavicons.background_color,
21
+ theme_color: AllTheFavicons.theme_color,
22
+ icons: AllTheFavicons::Android.all.map { |i| android_icon(i) },
23
+ display: "standalone" }
24
+ end
25
+
20
26
  def android_icon(icon)
21
27
  icon.merge(src: asset_path(icon[:src]))
22
28
  end
@@ -1,7 +1,7 @@
1
1
  module FaviconsHelper
2
2
  def all_the_favicons
3
3
  icons = apple_favicons + standard_favicons + [
4
- tag(:link, rel: "manifest", href: favicons_manifest_path),
4
+ tag(:link, rel: "manifest", href: favicons_webmanifest_path),
5
5
  pinned_tab_favicon,
6
6
  tag(:meta,
7
7
  name: "msapplication-TileColor",
@@ -3,5 +3,7 @@ Rails.application.routes.draw do
3
3
  defaults: { format: "xml" })
4
4
  get("/manifest.json" => "favicons#manifest",
5
5
  defaults: { format: "json" }, as: "favicons_manifest")
6
+ get("/site.webmanifest" => "favicons#manifest",
7
+ defaults: { format: "json" }, as: "favicons_webmanifest")
6
8
  get("favicon.ico" => "favicons#favicon")
7
9
  end
@@ -12,7 +12,12 @@ require "all_the_favicons/version"
12
12
 
13
13
  module AllTheFavicons
14
14
  class << self
15
- attr_accessor :ms_tile_color, :name, :pinned_tab_color, :theme_color
15
+ attr_accessor :background_color, :ms_tile_color, :name,
16
+ :pinned_tab_color, :theme_color, :short_name
17
+
18
+ def background_color
19
+ @background_color || "#ffffff"
20
+ end
16
21
 
17
22
  def ms_tile_color
18
23
  @ms_tile_color || "#2d89ef"
@@ -22,6 +27,10 @@ module AllTheFavicons
22
27
  @name || Rails.application.class.parent_name
23
28
  end
24
29
 
30
+ def short_name
31
+ @short_name || name
32
+ end
33
+
25
34
  def pinned_tab_color
26
35
  @pinned_tab_color || "#000000"
27
36
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module AllTheFavicons
4
- VERSION = "0.5.5".freeze
4
+ VERSION = "0.5.6".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: all-the-favicons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inge Jørgensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2019-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -92,8 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubyforge_project:
96
- rubygems_version: 2.7.6
95
+ rubygems_version: 3.0.1
97
96
  signing_key:
98
97
  specification_version: 4
99
98
  summary: Favicons for the Rails assets pipeline