all-the-favicons 0.5.4 → 0.5.9

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: f023d991d4049c2c8f9def08f576d8a095b175f194fa4ddb858d8f7e63466603
4
- data.tar.gz: 40d6843c71494a708521b562bf5e85e39b3a7a070ef15304e62285aa695e7a5b
3
+ metadata.gz: d44dc94c2bbece5a99a60fcb993f8d242ad00760a1d85b57352d3cb13ef39cc5
4
+ data.tar.gz: 192ee4fc5589cdfbc881ef17641c2bb6c61a98af55099b1acaccf212ec84d866
5
5
  SHA512:
6
- metadata.gz: b26b908213dc85b13e107e36eb96023a96c4998009fa8ae0a5c54f66092ceeaea8ccd16d0e406d5ea1c8172322035c5c367aa956cbd807ce0c21b47246a62d40
7
- data.tar.gz: b8d7713900354216f9df3d9098fb61a333360496c4981aebedb813b62a372655e3fd03a1271101ffcd671011e1d55b6fcbdafbbb7bc188bedcebefb86cd0b21c
6
+ metadata.gz: 7a7c6da876e5489db7da3af66d41a6ffa26469978f0c0bcd0b1c712edadd2b54274984854cedcf7431e5864ef8d4ac75e6f438131179b904b567c12d3d02ca3f
7
+ data.tar.gz: bc4e05a6f534ebc4eb813359627e16d28222a4a31676e282326d9dff43f0eca4ba2322c15ecd828ab082cb3211e7dedb61419278b612c5568c5329c1a2ce679e
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",
data/config/routes.rb CHANGED
@@ -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.4".freeze
4
+ VERSION = "0.5.9".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.4
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inge Jørgensen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.2.0
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '5.2'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +24,6 @@ dependencies:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 4.2.0
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '5.2'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: vector2d
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -77,7 +71,7 @@ homepage: https://github.com/kord-as/all-the-favicons
77
71
  licenses:
78
72
  - MIT
79
73
  metadata: {}
80
- post_install_message:
74
+ post_install_message:
81
75
  rdoc_options: []
82
76
  require_paths:
83
77
  - lib
@@ -92,9 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
86
  - !ruby/object:Gem::Version
93
87
  version: '0'
94
88
  requirements: []
95
- rubyforge_project:
96
- rubygems_version: 2.7.6
97
- signing_key:
89
+ rubygems_version: 3.1.4
90
+ signing_key:
98
91
  specification_version: 4
99
92
  summary: Favicons for the Rails assets pipeline
100
93
  test_files: []