jekyll-favicon 0.2.6 → 1.0.0.pre.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +5 -5
  2. data/.devcontainer/Dockerfile +20 -0
  3. data/.devcontainer/devcontainer.json +42 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +10 -13
  5. data/.github/PULL_REQUEST_TEMPLATE.md +11 -9
  6. data/.github/workflows/gem-push.yml +40 -0
  7. data/.github/workflows/test.yml +38 -0
  8. data/.gitignore +4 -0
  9. data/.reek.yml +25 -0
  10. data/.vscode/launch.json +16 -0
  11. data/.vscode/settings.json +7 -0
  12. data/.vscode/tasks.json +15 -0
  13. data/CHANGELOG.md +42 -0
  14. data/Gemfile +3 -1
  15. data/README.md +80 -20
  16. data/Rakefile +9 -7
  17. data/bin/console +1 -0
  18. data/bin/debug +22 -0
  19. data/config/jekyll/favicon.yml +115 -0
  20. data/config/jekyll/favicon/static_file.yml +3 -0
  21. data/config/jekyll/favicon/static_file/convertible.yml +42 -0
  22. data/config/jekyll/favicon/static_file/mutable.yml +22 -0
  23. data/config/jekyll/favicon/static_file/referenceable.yml +15 -0
  24. data/config/jekyll/favicon/static_file/sourceable.yml +3 -0
  25. data/config/jekyll/favicon/static_file/taggable.yml +22 -0
  26. data/jekyll-favicon.gemspec +24 -24
  27. data/lib/jekyll-favicon.rb +7 -16
  28. data/lib/jekyll/favicon.rb +19 -16
  29. data/lib/jekyll/favicon/configuration.rb +73 -0
  30. data/lib/jekyll/favicon/configuration/defaults.rb +49 -0
  31. data/lib/jekyll/favicon/generator.rb +10 -74
  32. data/lib/jekyll/favicon/hooks.rb +12 -10
  33. data/lib/jekyll/favicon/static_data_file.rb +17 -0
  34. data/lib/jekyll/favicon/static_file.rb +97 -0
  35. data/lib/jekyll/favicon/static_file/convertible.rb +121 -0
  36. data/lib/jekyll/favicon/static_file/mutable.rb +81 -0
  37. data/lib/jekyll/favicon/static_file/referenceable.rb +22 -0
  38. data/lib/jekyll/favicon/static_file/sourceable.rb +73 -0
  39. data/lib/jekyll/favicon/static_file/taggable.rb +53 -0
  40. data/lib/jekyll/favicon/static_graphic_file.rb +21 -0
  41. data/lib/jekyll/favicon/tag.rb +14 -17
  42. data/lib/jekyll/favicon/utils.rb +43 -0
  43. data/lib/jekyll/favicon/utils/configuration/compact.rb +58 -0
  44. data/lib/jekyll/favicon/utils/configuration/merge.rb +70 -0
  45. data/lib/jekyll/favicon/utils/configuration/patch.rb +49 -0
  46. data/lib/jekyll/favicon/utils/convert.rb +39 -0
  47. data/lib/jekyll/favicon/utils/tag.rb +70 -0
  48. data/lib/jekyll/favicon/version.rb +3 -1
  49. metadata +69 -67
  50. data/.rubocop.yml +0 -5
  51. data/.ruby-version +0 -1
  52. data/.travis.yml +0 -21
  53. data/Gemfile.lock +0 -97
  54. data/lib/browserconfig.rb +0 -54
  55. data/lib/hash.rb +0 -12
  56. data/lib/image.rb +0 -33
  57. data/lib/jekyll/favicon/config/defaults.yml +0 -54
  58. data/lib/jekyll/favicon/icon.rb +0 -73
  59. data/lib/jekyll/favicon/metadata.rb +0 -12
  60. data/lib/jekyll/favicon/templates/chrome.html.erb +0 -5
  61. data/lib/jekyll/favicon/templates/classic.html.erb +0 -8
  62. data/lib/jekyll/favicon/templates/ie.html.erb +0 -4
  63. data/lib/jekyll/favicon/templates/safari.html.erb +0 -8
  64. data/lib/string.rb +0 -14
  65. data/lib/webmanifest.rb +0 -30
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rexml/document"
4
+
5
+ module Jekyll
6
+ module Favicon
7
+ module Utils
8
+ # Favicon rexml for include
9
+ module Tag
10
+ def self.included(klass)
11
+ klass.extend(ClassMethods)
12
+ end
13
+
14
+ def self.mutate_find_or_create_element(parent, key)
15
+ parent.get_elements(key).first || parent.add_element(key)
16
+ end
17
+
18
+ def self.mutate_xml(parent, changes = {})
19
+ changes.each_with_object(parent) do |(key, value), memo|
20
+ mutate_iterator key, value, memo
21
+ end
22
+ end
23
+
24
+ def self.mutate_iterator(key, value, memo)
25
+ if key.start_with? "__" then memo.text = value
26
+ elsif key.start_with? "_" then memo.add_attribute key[1..], value
27
+ else Tag.mutate_xml Tag.mutate_find_or_create_element(memo, key), value
28
+ end
29
+ end
30
+
31
+ def self.build_xml(name, parent = nil, config = {})
32
+ element = REXML::Element.new name, parent
33
+ return Tag.populate_element element, config if config.is_a? Enumerable
34
+
35
+ element.text = config and return element
36
+ end
37
+
38
+ def self.populate_element(element, config)
39
+ config.each_with_object(element) do |(key, value), memo|
40
+ populate_iterator key, value, memo
41
+ end
42
+ end
43
+
44
+ def self.populate_iterator(key, value, memo)
45
+ if key.start_with? "__" then memo.text = value
46
+ elsif (child_key = key.match(/^_(.*)$/))
47
+ memo.add_attribute child_key[1], value
48
+ else build_xml key, memo, value
49
+ end
50
+ end
51
+
52
+ # Favicon rexml utils functions
53
+ module ClassMethods
54
+ def mutate_element(parent, changes = {})
55
+ Tag.mutate_xml parent, changes
56
+ end
57
+
58
+ def build_element(name, parent = nil, config = {})
59
+ Tag.build_xml name, parent, config
60
+ end
61
+
62
+ def build_tag(name, attributes = {})
63
+ config = attributes.transform_keys { |key| "_#{key}" }
64
+ Tag.build_xml name, nil, config
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Jekyll
2
4
  module Favicon
3
- VERSION = '0.2.6'.freeze
5
+ VERSION = "1.0.0-2"
4
6
  end
5
7
  end
metadata CHANGED
@@ -1,139 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-favicon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 1.0.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alvaro Faundez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-23 00:00:00.000000000 Z
11
+ date: 2021-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.16'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.16'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: minitest
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: '5.0'
19
+ version: '5.8'
34
20
  type: :development
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: '5.0'
26
+ version: '5.8'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: minitest-hooks
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '1.4'
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: 1.4.2
33
+ version: '1.5'
51
34
  type: :development
52
35
  prerelease: false
53
36
  version_requirements: !ruby/object:Gem::Requirement
54
37
  requirements:
55
38
  - - "~>"
56
39
  - !ruby/object:Gem::Version
57
- version: '1.4'
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: 1.4.2
40
+ version: '1.5'
61
41
  - !ruby/object:Gem::Dependency
62
- name: nokogiri
42
+ name: minitest-reporters
63
43
  requirement: !ruby/object:Gem::Requirement
64
44
  requirements:
65
45
  - - "~>"
66
46
  - !ruby/object:Gem::Version
67
- version: '1.8'
47
+ version: 1.4.3
68
48
  type: :development
69
49
  prerelease: false
70
50
  version_requirements: !ruby/object:Gem::Requirement
71
51
  requirements:
72
52
  - - "~>"
73
53
  - !ruby/object:Gem::Version
74
- version: '1.8'
54
+ version: 1.4.3
75
55
  - !ruby/object:Gem::Dependency
76
56
  name: rake
77
57
  requirement: !ruby/object:Gem::Requirement
78
58
  requirements:
79
59
  - - "~>"
80
60
  - !ruby/object:Gem::Version
81
- version: '10.0'
61
+ version: '12.3'
82
62
  type: :development
83
63
  prerelease: false
84
64
  version_requirements: !ruby/object:Gem::Requirement
85
65
  requirements:
86
66
  - - "~>"
87
67
  - !ruby/object:Gem::Version
88
- version: '10.0'
68
+ version: '12.3'
89
69
  - !ruby/object:Gem::Dependency
90
- name: rubocop
70
+ name: jekyll
91
71
  requirement: !ruby/object:Gem::Requirement
92
72
  requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: 0.54.0
96
73
  - - ">="
97
74
  - !ruby/object:Gem::Version
98
- version: 0.54.0
99
- type: :development
75
+ version: '3.0'
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '5.0'
79
+ type: :runtime
100
80
  prerelease: false
101
81
  version_requirements: !ruby/object:Gem::Requirement
102
82
  requirements:
103
- - - "~>"
104
- - !ruby/object:Gem::Version
105
- version: 0.54.0
106
83
  - - ">="
107
84
  - !ruby/object:Gem::Version
108
- version: 0.54.0
85
+ version: '3.0'
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '5.0'
109
89
  - !ruby/object:Gem::Dependency
110
- name: jekyll
90
+ name: mini_magick
111
91
  requirement: !ruby/object:Gem::Requirement
112
92
  requirements:
113
93
  - - "~>"
114
94
  - !ruby/object:Gem::Version
115
- version: '3.0'
95
+ version: '4.11'
116
96
  type: :runtime
117
97
  prerelease: false
118
98
  version_requirements: !ruby/object:Gem::Requirement
119
99
  requirements:
120
100
  - - "~>"
121
101
  - !ruby/object:Gem::Version
122
- version: '3.0'
102
+ version: '4.11'
123
103
  - !ruby/object:Gem::Dependency
124
- name: mini_magick
104
+ name: rexml
125
105
  requirement: !ruby/object:Gem::Requirement
126
106
  requirements:
127
107
  - - "~>"
128
108
  - !ruby/object:Gem::Version
129
- version: '4.5'
109
+ version: '3.2'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 3.2.5
130
113
  type: :runtime
131
114
  prerelease: false
132
115
  version_requirements: !ruby/object:Gem::Requirement
133
116
  requirements:
134
117
  - - "~>"
135
118
  - !ruby/object:Gem::Version
136
- version: '4.5'
119
+ version: '3.2'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 3.2.5
137
123
  description: Jekyll-favicon is a jekyll plugin that adds the tag favicon, generating
138
124
  html tags for favicon.
139
125
  email:
@@ -142,42 +128,58 @@ executables: []
142
128
  extensions: []
143
129
  extra_rdoc_files: []
144
130
  files:
131
+ - ".devcontainer/Dockerfile"
132
+ - ".devcontainer/devcontainer.json"
145
133
  - ".github/ISSUE_TEMPLATE/bug_report.md"
146
134
  - ".github/ISSUE_TEMPLATE/feature_request.md"
147
135
  - ".github/PULL_REQUEST_TEMPLATE.md"
136
+ - ".github/workflows/gem-push.yml"
137
+ - ".github/workflows/test.yml"
148
138
  - ".gitignore"
149
- - ".rubocop.yml"
150
- - ".ruby-version"
151
- - ".travis.yml"
139
+ - ".reek.yml"
140
+ - ".vscode/launch.json"
141
+ - ".vscode/settings.json"
142
+ - ".vscode/tasks.json"
152
143
  - CHANGELOG.md
153
144
  - CODE_OF_CONDUCT.md
154
145
  - CONTRIBUTING.md
155
146
  - Gemfile
156
- - Gemfile.lock
157
147
  - LICENSE.txt
158
148
  - README.md
159
149
  - Rakefile
160
150
  - bin/console
151
+ - bin/debug
161
152
  - bin/setup
153
+ - config/jekyll/favicon.yml
154
+ - config/jekyll/favicon/static_file.yml
155
+ - config/jekyll/favicon/static_file/convertible.yml
156
+ - config/jekyll/favicon/static_file/mutable.yml
157
+ - config/jekyll/favicon/static_file/referenceable.yml
158
+ - config/jekyll/favicon/static_file/sourceable.yml
159
+ - config/jekyll/favicon/static_file/taggable.yml
162
160
  - jekyll-favicon.gemspec
163
- - lib/browserconfig.rb
164
- - lib/hash.rb
165
- - lib/image.rb
166
161
  - lib/jekyll-favicon.rb
167
162
  - lib/jekyll/favicon.rb
168
- - lib/jekyll/favicon/config/defaults.yml
163
+ - lib/jekyll/favicon/configuration.rb
164
+ - lib/jekyll/favicon/configuration/defaults.rb
169
165
  - lib/jekyll/favicon/generator.rb
170
166
  - lib/jekyll/favicon/hooks.rb
171
- - lib/jekyll/favicon/icon.rb
172
- - lib/jekyll/favicon/metadata.rb
167
+ - lib/jekyll/favicon/static_data_file.rb
168
+ - lib/jekyll/favicon/static_file.rb
169
+ - lib/jekyll/favicon/static_file/convertible.rb
170
+ - lib/jekyll/favicon/static_file/mutable.rb
171
+ - lib/jekyll/favicon/static_file/referenceable.rb
172
+ - lib/jekyll/favicon/static_file/sourceable.rb
173
+ - lib/jekyll/favicon/static_file/taggable.rb
174
+ - lib/jekyll/favicon/static_graphic_file.rb
173
175
  - lib/jekyll/favicon/tag.rb
174
- - lib/jekyll/favicon/templates/chrome.html.erb
175
- - lib/jekyll/favicon/templates/classic.html.erb
176
- - lib/jekyll/favicon/templates/ie.html.erb
177
- - lib/jekyll/favicon/templates/safari.html.erb
176
+ - lib/jekyll/favicon/utils.rb
177
+ - lib/jekyll/favicon/utils/configuration/compact.rb
178
+ - lib/jekyll/favicon/utils/configuration/merge.rb
179
+ - lib/jekyll/favicon/utils/configuration/patch.rb
180
+ - lib/jekyll/favicon/utils/convert.rb
181
+ - lib/jekyll/favicon/utils/tag.rb
178
182
  - lib/jekyll/favicon/version.rb
179
- - lib/string.rb
180
- - lib/webmanifest.rb
181
183
  homepage: https://github.com/afaundez/jekyll-favicon
182
184
  licenses:
183
185
  - MIT
@@ -190,15 +192,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
192
  requirements:
191
193
  - - ">="
192
194
  - !ruby/object:Gem::Version
193
- version: 2.1.0
195
+ version: 2.5.0
194
196
  required_rubygems_version: !ruby/object:Gem::Requirement
195
197
  requirements:
196
- - - ">="
198
+ - - ">"
197
199
  - !ruby/object:Gem::Version
198
- version: '0'
200
+ version: 1.3.1
199
201
  requirements: []
200
202
  rubyforge_project:
201
- rubygems_version: 2.2.0
203
+ rubygems_version: 2.7.6.3
202
204
  signing_key:
203
205
  specification_version: 4
204
206
  summary: Jekyll plugin for favicon tag generation.
data/.rubocop.yml DELETED
@@ -1,5 +0,0 @@
1
- Metrics/BlockLength:
2
- Exclude:
3
- - Rakefile
4
- - '**/*.rake'
5
- - test/**/*.rb
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.1.0
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.6.0
5
- - 2.5.3
6
- - 2.4.5
7
- - 2.3.8
8
- - 2.2.10
9
- - 2.1.10
10
- - 2.1.0
11
- before_install:
12
- - if ! [[ `ruby -v | cut -d' ' -f2` > "2.3" ]]; then gem install bundler -v '< 2'; fi;
13
- addons:
14
- apt:
15
- config:
16
- retries: true
17
- packages:
18
- - imagemagick
19
- - libmagickcore-dev
20
- - libmagickwand-dev
21
- - graphicsmagick
data/Gemfile.lock DELETED
@@ -1,97 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- jekyll-favicon (0.2.6)
5
- jekyll (~> 3.0)
6
- mini_magick (~> 4.5)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- addressable (2.6.0)
12
- public_suffix (>= 2.0.2, < 4.0)
13
- ast (2.4.0)
14
- colorator (1.1.0)
15
- concurrent-ruby (1.1.5)
16
- em-websocket (0.5.1)
17
- eventmachine (>= 0.12.9)
18
- http_parser.rb (~> 0.6.0)
19
- eventmachine (1.2.7)
20
- ffi (1.10.0)
21
- forwardable-extended (2.6.0)
22
- http_parser.rb (0.6.0)
23
- i18n (0.9.5)
24
- concurrent-ruby (~> 1.0)
25
- jekyll (3.8.5)
26
- addressable (~> 2.4)
27
- colorator (~> 1.0)
28
- em-websocket (~> 0.5)
29
- i18n (~> 0.7)
30
- jekyll-sass-converter (~> 1.0)
31
- jekyll-watch (~> 2.0)
32
- kramdown (~> 1.14)
33
- liquid (~> 4.0)
34
- mercenary (~> 0.3.3)
35
- pathutil (~> 0.9)
36
- rouge (>= 1.7, < 4)
37
- safe_yaml (~> 1.0)
38
- jekyll-sass-converter (1.5.2)
39
- sass (~> 3.4)
40
- jekyll-watch (2.0.0)
41
- listen (~> 3.0)
42
- kramdown (1.17.0)
43
- liquid (4.0.3)
44
- listen (3.0.8)
45
- rb-fsevent (~> 0.9, >= 0.9.4)
46
- rb-inotify (~> 0.9, >= 0.9.7)
47
- mercenary (0.3.6)
48
- mini_magick (4.9.3)
49
- mini_portile2 (2.3.0)
50
- minitest (5.11.3)
51
- minitest-hooks (1.5.0)
52
- minitest (> 5.3)
53
- nokogiri (1.8.5)
54
- mini_portile2 (~> 2.3.0)
55
- parallel (1.12.1)
56
- parser (2.5.1.2)
57
- ast (~> 2.4.0)
58
- pathutil (0.16.2)
59
- forwardable-extended (~> 2.6)
60
- powerpack (0.1.2)
61
- public_suffix (3.0.3)
62
- rainbow (3.0.0)
63
- rake (10.5.0)
64
- rb-fsevent (0.10.3)
65
- rb-inotify (0.9.10)
66
- ffi (>= 0.5.0, < 2)
67
- rouge (3.3.0)
68
- rubocop (0.54.0)
69
- parallel (~> 1.10)
70
- parser (>= 2.5)
71
- powerpack (~> 0.1)
72
- rainbow (>= 2.2.2, < 4.0)
73
- ruby-progressbar (~> 1.7)
74
- unicode-display_width (~> 1.0, >= 1.0.1)
75
- ruby-progressbar (1.10.0)
76
- safe_yaml (1.0.5)
77
- sass (3.7.3)
78
- sass-listen (~> 4.0.0)
79
- sass-listen (4.0.0)
80
- rb-fsevent (~> 0.9, >= 0.9.4)
81
- rb-inotify (~> 0.9, >= 0.9.7)
82
- unicode-display_width (1.4.0)
83
-
84
- PLATFORMS
85
- ruby
86
-
87
- DEPENDENCIES
88
- bundler (~> 1.16)
89
- jekyll-favicon!
90
- minitest (~> 5.0)
91
- minitest-hooks (~> 1.4, >= 1.4.2)
92
- nokogiri (~> 1.8)
93
- rake (~> 10.0)
94
- rubocop (~> 0.54.0, >= 0.54.0)
95
-
96
- BUNDLED WITH
97
- 1.17.3