rails_real_favicon 0.0.10 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.rdoc +6 -2
- data/lib/generators/favicon_generator.rb +22 -6
- data/lib/generators/web_app_manifest_initializer.txt +18 -10
- data/lib/rails_real_favicon/version.rb +1 -1
- data/test/dummy/log/test.log +120 -0
- metadata +7 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 299753dd3991048da5263784972483e3347603ae035cccffbf8c4222d1890270
|
4
|
+
data.tar.gz: 1da8cfcf19100eb70999665bd5923bba326398a0a61e93bf39176fe6414d7925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9dada2d8903b2e74750dc06d8ce3ec63505b531605b13e0aaa16a2ce962ead63c65e43abb7a4836e270da909052644ad80002db5a2a01bfd88c57ad822953c8
|
7
|
+
data.tar.gz: 568539bc380fbfa85a6aca05dfd3bf86e08448730caa856c6266553fca997eba9d0b25106e7711eee67d60634dd110bb446387aa92bc9e54811bbc7884cefe96
|
data/README.rdoc
CHANGED
@@ -4,7 +4,11 @@ Create a multi-platform favicon for your Ruby on Rails project with RealFaviconG
|
|
4
4
|
|
5
5
|
To use this Rails plugin:
|
6
6
|
|
7
|
-
* Go to
|
7
|
+
* Go to {RealFaviconGenerator for Ruby on Rails}[https://realfavicongenerator.net/favicon/ruby_on_rails], submit your image and craft your icons.
|
8
8
|
https://cloud.githubusercontent.com/assets/423852/11431579/88a71cb0-949b-11e5-9dd4-3cf57f4e3b1a.png
|
9
|
-
* In the result page,
|
9
|
+
* In the result page, follow the instructions.
|
10
10
|
https://cloud.githubusercontent.com/assets/423852/11431581/8c0ab45c-949b-11e5-9b4a-c3a2beba0180.png
|
11
|
+
|
12
|
+
Already have you favicon and wondering how to regenerate it again? From the root of your project, just re-run:
|
13
|
+
|
14
|
+
rails generate favicon
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require '
|
1
|
+
require 'net/http'
|
2
|
+
require 'uri'
|
2
3
|
require 'json'
|
3
4
|
require 'open-uri'
|
4
5
|
require 'zip'
|
@@ -9,8 +10,14 @@ class FaviconGenerator < Rails::Generators::Base
|
|
9
10
|
|
10
11
|
PATH_UNIQUE_KEY = '/Dfv87ZbNh2'
|
11
12
|
|
13
|
+
class_option(:timeout, type: :numeric, aliases: '-t', default: 30)
|
14
|
+
|
12
15
|
def generate_favicon
|
13
|
-
|
16
|
+
if File.exist?('config/favicon.yml') && defined?(Rails.application.config_for)
|
17
|
+
req = Rails.application.config_for(:favicon)
|
18
|
+
else
|
19
|
+
req = JSON.parse File.read('config/favicon.json')
|
20
|
+
end
|
14
21
|
|
15
22
|
req['api_key'] = API_KEY
|
16
23
|
|
@@ -23,9 +30,18 @@ class FaviconGenerator < Rails::Generators::Base
|
|
23
30
|
req['master_picture']['type'] = 'inline'
|
24
31
|
req['master_picture']['content'] = Base64.encode64(File.binread(master_pic))
|
25
32
|
|
26
|
-
|
27
|
-
|
28
|
-
resp =
|
33
|
+
uri = URI.parse("https://realfavicongenerator.net/api/favicon")
|
34
|
+
timeout = options[:timeout]
|
35
|
+
resp = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https", read_timeout: timeout) do |http|
|
36
|
+
request = Net::HTTP::Post.new uri
|
37
|
+
request.body = { favicon_generation: req }.to_json
|
38
|
+
request["Content-Type"] = "application/json"
|
39
|
+
begin
|
40
|
+
JSON.parse(http.request(request).body)
|
41
|
+
rescue Net::ReadTimeout
|
42
|
+
raise RuntimeError.new("Operation timed out after #{timeout} seconds, pass a `-t` option for a longer timeout")
|
43
|
+
end
|
44
|
+
end
|
29
45
|
|
30
46
|
zip = resp['favicon_generation_result']['favicon']['package_url']
|
31
47
|
FileUtils.mkdir_p('app/assets/images/favicon')
|
@@ -66,7 +82,7 @@ class FaviconGenerator < Rails::Generators::Base
|
|
66
82
|
end
|
67
83
|
|
68
84
|
File.open(local_path, "wb") do |saved_file|
|
69
|
-
open(url, "rb") do |read_file|
|
85
|
+
URI.open(url, "rb") do |read_file|
|
70
86
|
saved_file.write(read_file.read)
|
71
87
|
end
|
72
88
|
end
|
@@ -1,10 +1,18 @@
|
|
1
|
-
# This file was generated by rails_favicon_generator, from
|
2
|
-
# https://realfavicongenerator.net/
|
3
|
-
|
4
|
-
# It makes files with .webmanifest extension first class files in the asset
|
5
|
-
# pipeline. This is to preserve this extension, as is it referenced in a call
|
6
|
-
# to asset_path in the _favicon.html.erb partial.
|
7
|
-
|
8
|
-
Rails.application.config.assets.configure do |env|
|
9
|
-
|
10
|
-
|
1
|
+
# This file was generated by rails_favicon_generator, from
|
2
|
+
# https://realfavicongenerator.net/
|
3
|
+
|
4
|
+
# It makes files with .webmanifest extension first class files in the asset
|
5
|
+
# pipeline. This is to preserve this extension, as is it referenced in a call
|
6
|
+
# to asset_path in the _favicon.html.erb partial.
|
7
|
+
|
8
|
+
Rails.application.config.assets.configure do |env|
|
9
|
+
mime_type = 'application/manifest+json'
|
10
|
+
extensions = ['.webmanifest']
|
11
|
+
|
12
|
+
if Sprockets::VERSION.to_i >= 4
|
13
|
+
extensions << '.webmanifest.erb'
|
14
|
+
env.register_preprocessor(mime_type, Sprockets::ERBProcessor)
|
15
|
+
end
|
16
|
+
|
17
|
+
env.register_mime_type(mime_type, extensions: extensions)
|
18
|
+
end
|
data/test/dummy/log/test.log
CHANGED
@@ -58,3 +58,123 @@ FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
|
58
58
|
------------------------------------------------------------
|
59
59
|
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
60
60
|
------------------------------------------------------------
|
61
|
+
-------------------------------------------------------------
|
62
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
63
|
+
-------------------------------------------------------------
|
64
|
+
-------------------------------------------------------------
|
65
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
66
|
+
-------------------------------------------------------------
|
67
|
+
------------------------------------------------------------
|
68
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
69
|
+
------------------------------------------------------------
|
70
|
+
--------------------------------
|
71
|
+
RailsRealFaviconTest: test_truth
|
72
|
+
--------------------------------
|
73
|
+
------------------------------------------------------------
|
74
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
75
|
+
------------------------------------------------------------
|
76
|
+
-------------------------------------------------------------
|
77
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
78
|
+
-------------------------------------------------------------
|
79
|
+
-------------------------------------------------------------
|
80
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
81
|
+
-------------------------------------------------------------
|
82
|
+
--------------------------------
|
83
|
+
RailsRealFaviconTest: test_truth
|
84
|
+
--------------------------------
|
85
|
+
-------------------------------------------------------------
|
86
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
87
|
+
-------------------------------------------------------------
|
88
|
+
-------------------------------------------------------------
|
89
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
90
|
+
-------------------------------------------------------------
|
91
|
+
------------------------------------------------------------
|
92
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
93
|
+
------------------------------------------------------------
|
94
|
+
--------------------------------
|
95
|
+
RailsRealFaviconTest: test_truth
|
96
|
+
--------------------------------
|
97
|
+
-------------------------------------------------------------
|
98
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
99
|
+
-------------------------------------------------------------
|
100
|
+
------------------------------------------------------------
|
101
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
102
|
+
------------------------------------------------------------
|
103
|
+
-------------------------------------------------------------
|
104
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
105
|
+
-------------------------------------------------------------
|
106
|
+
--------------------------------
|
107
|
+
RailsRealFaviconTest: test_truth
|
108
|
+
--------------------------------
|
109
|
+
-------------------------------------------------------------
|
110
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
111
|
+
-------------------------------------------------------------
|
112
|
+
-------------------------------------------------------------
|
113
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
114
|
+
-------------------------------------------------------------
|
115
|
+
------------------------------------------------------------
|
116
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
117
|
+
------------------------------------------------------------
|
118
|
+
--------------------------------
|
119
|
+
RailsRealFaviconTest: test_truth
|
120
|
+
--------------------------------
|
121
|
+
-------------------------------------------------------------
|
122
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
123
|
+
-------------------------------------------------------------
|
124
|
+
-------------------------------------------------------------
|
125
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
126
|
+
-------------------------------------------------------------
|
127
|
+
------------------------------------------------------------
|
128
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
129
|
+
------------------------------------------------------------
|
130
|
+
--------------------------------
|
131
|
+
RailsRealFaviconTest: test_truth
|
132
|
+
--------------------------------
|
133
|
+
-------------------------------------------------------------
|
134
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
135
|
+
-------------------------------------------------------------
|
136
|
+
-------------------------------------------------------------
|
137
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
138
|
+
-------------------------------------------------------------
|
139
|
+
------------------------------------------------------------
|
140
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
141
|
+
------------------------------------------------------------
|
142
|
+
--------------------------------
|
143
|
+
RailsRealFaviconTest: test_truth
|
144
|
+
--------------------------------
|
145
|
+
--------------------------------
|
146
|
+
RailsRealFaviconTest: test_truth
|
147
|
+
--------------------------------
|
148
|
+
-------------------------------------------------------------
|
149
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
150
|
+
-------------------------------------------------------------
|
151
|
+
------------------------------------------------------------
|
152
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
153
|
+
------------------------------------------------------------
|
154
|
+
-------------------------------------------------------------
|
155
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
156
|
+
-------------------------------------------------------------
|
157
|
+
--------------------------------
|
158
|
+
RailsRealFaviconTest: test_truth
|
159
|
+
--------------------------------
|
160
|
+
-------------------------------------------------------------
|
161
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
162
|
+
-------------------------------------------------------------
|
163
|
+
------------------------------------------------------------
|
164
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
165
|
+
------------------------------------------------------------
|
166
|
+
-------------------------------------------------------------
|
167
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
168
|
+
-------------------------------------------------------------
|
169
|
+
-------------------------------------------------------------
|
170
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_HTML
|
171
|
+
-------------------------------------------------------------
|
172
|
+
-------------------------------------------------------------
|
173
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_JSON
|
174
|
+
-------------------------------------------------------------
|
175
|
+
------------------------------------------------------------
|
176
|
+
FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
|
177
|
+
------------------------------------------------------------
|
178
|
+
--------------------------------
|
179
|
+
RailsRealFaviconTest: test_truth
|
180
|
+
--------------------------------
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_real_favicon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philippe Bernard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,28 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rest-client
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '2.0'
|
26
|
+
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: json
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,14 +50,14 @@ dependencies:
|
|
64
50
|
requirements:
|
65
51
|
- - "~>"
|
66
52
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
53
|
+
version: '2'
|
68
54
|
type: :runtime
|
69
55
|
prerelease: false
|
70
56
|
version_requirements: !ruby/object:Gem::Requirement
|
71
57
|
requirements:
|
72
58
|
- - "~>"
|
73
59
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
60
|
+
version: '2'
|
75
61
|
description: Generate and install a favicon for all platforms with RealFaviconGenerator.
|
76
62
|
email:
|
77
63
|
- philippe@realfavicongenerator.net
|
@@ -164,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
150
|
- !ruby/object:Gem::Version
|
165
151
|
version: '0'
|
166
152
|
requirements: []
|
167
|
-
|
168
|
-
rubygems_version: 2.4.5.1
|
153
|
+
rubygems_version: 3.0.3
|
169
154
|
signing_key:
|
170
155
|
specification_version: 4
|
171
156
|
summary: Manage the favicon of your RoR project with RealFaviconGenerator
|