rails_real_favicon 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ae286ec1a6efb3fce7475eafad975f491f98bfd
4
- data.tar.gz: e2974267b071f6a7c3f31c706eb881374f441f3f
3
+ metadata.gz: 2850adddecf5d7eddde7fb82b49377aad05f0825
4
+ data.tar.gz: 7b81ffb622c8fe7fc55a30c981bfb099d5356475
5
5
  SHA512:
6
- metadata.gz: 15cae28a0bdc6099b933c1c3af579db91f0f3ae0885b65ab9c6035c3f1b9df2c3ce0970a2cbc0e4e08af0410b79bb9184bdb781cd93e675920408bf7c985b44a
7
- data.tar.gz: 8dbc08b193f1c6945571f798266664bc479a32782bbac58c095ccbcab256ff6d6f057fc62b5224521e06d059c7a370541d6c3080a663fd45c061769495a05f31
6
+ metadata.gz: 6d1751c252e32dbc7fcfedebdf2e240d7878189d43545df562ff46f6fd66a3c1712c77abd728718de3784276c7ee03547167b37f08ef662599cbe492dad15762
7
+ data.tar.gz: 872503f8f85132d95ca1e2adf3567484ad31fd48fe1a8bdf8f2f5766ea031289d0460744597a9671c345d32331bfb7533c8df7006128d65d44a4f6210c78fdd3
@@ -1,4 +1,5 @@
1
- require 'rest-client'
1
+ require 'net/http'
2
+ require 'uri'
2
3
  require 'json'
3
4
  require 'open-uri'
4
5
  require 'zip'
@@ -27,9 +28,13 @@ class FaviconGenerator < Rails::Generators::Base
27
28
  req['master_picture']['type'] = 'inline'
28
29
  req['master_picture']['content'] = Base64.encode64(File.binread(master_pic))
29
30
 
30
- response = RestClient.post("https://realfavicongenerator.net/api/favicon",
31
- {favicon_generation: req}.to_json, content_type: :json)
32
- resp = JSON.parse(response)
31
+ uri = URI.parse("https://realfavicongenerator.net/api/favicon")
32
+ resp = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
33
+ request = Net::HTTP::Post.new uri
34
+ request.body = { favicon_generation: req }.to_json
35
+ request["Content-Type"] = "application/json"
36
+ JSON.parse(http.request(request).body)
37
+ end
33
38
 
34
39
  zip = resp['favicon_generation_result']['favicon']['package_url']
35
40
  FileUtils.mkdir_p('app/assets/images/favicon')
@@ -1,10 +1,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
- env.register_mime_type('application/manifest+json', extensions: ['.webmanifest'])
10
- end
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
+ env.register_mime_type('application/manifest+json', extensions: ['.webmanifest'])
10
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsRealFavicon
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -70,3 +70,63 @@ FaviconGeneratorTest: test_replace_URLs_by_asset_path_in_XML
70
70
  --------------------------------
71
71
  RailsRealFaviconTest: test_truth
72
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
+ --------------------------------
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.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philippe Bernard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-07 00:00:00.000000000 Z
11
+ date: 2019-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.1'
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'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: json
43
29
  requirement: !ruby/object:Gem::Requirement