jekyll-favicon 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: 348c5ecbd6ff6959ef000b7ed5e303247c54ab62
4
- data.tar.gz: 3115c60efdc82f1d9963f7abdff6b250a1deaa79
3
+ metadata.gz: 590c0b3dfe2a0579884c97e48080e958346a04f5
4
+ data.tar.gz: e9e13583226995f28b563ee29eabf400be6c22a8
5
5
  SHA512:
6
- metadata.gz: 0e81924b776ed34b9d7b0772dd9052fb9ddfb1e53fae3865860a07661e031a3d86a229d6d08e2d68d760e576a5620d38f560c0255b1286b09c34feb99d1658a6
7
- data.tar.gz: bd14abae772e7a03abaa2223a6cc93bcac8bdc5f102b27848ead37adff996c0bff2b0ddbf6a06a4f1616d9e89839d28fa6c5cdf5878a1cc9e9753bf60ec346e5
6
+ metadata.gz: 96c9a2c68d1ce1694aac86706f5f71f1d79cb8a25f6a88f6068b25db4db8154fed07878b59582c7daef905467d5e78082bd86265e3d5fd3c887ad1af7af185f7
7
+ data.tar.gz: 2e7cba7d7c95a6d3cd968687488c9a9871fde455ff5e8165134b55752a3789d1febb18d76b8602664a2c08eac7bb3adc052439ea20d981131959e78f03798719
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-favicon (0.2.1)
4
+ jekyll-favicon (0.2.2)
5
5
  jekyll (~> 3.0)
6
6
  mini_magick (~> 4.5)
7
7
 
data/README.md CHANGED
@@ -9,14 +9,29 @@ This [Jekyll](https://jekyllrb.com) plugin adds:
9
9
  - a [browser configuration schema](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426%28v=vs.85%29)
10
10
  - a tag to generate all the corresponding links and metadata needed in the head tag
11
11
 
12
- Note: this project depends on [minimagick/minimagick](https://github.com/minimagick/minimagick/), which depends on [ImageMagick](https://imagemagick.org/) or [GraphicsMagick](http://www.graphicsmagick.org/).
12
+
13
+
14
+ ## Prerequisites
15
+
16
+ Before using this plugin your system must have installed [ImageMagick](http://www.imagemagick.org) (or [GraphicsMagick](http://www.graphicsmagick.org/)).
17
+
18
+ Check if it is already installed by running:
19
+
20
+ ```sh
21
+ $ convert --version
22
+ Version: ImageMagick 7.0.7-27 Q16 x86_64 2018-03-18 http://www.imagemagick.org
23
+ Copyright: © 1999-2018 ImageMagick Studio LLC
24
+ License: http://www.imagemagick.org/script/license.php
25
+ Features: Cipher DPC HDRI Modules
26
+ Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
27
+ ```
13
28
 
14
29
  ## Installation
15
30
 
16
31
  Add this line to your application's Gemfile:
17
32
 
18
33
  ```ruby
19
- gem 'jekyll-favicon', '~> 0.2.1', group: :jekyll_plugins
34
+ gem 'jekyll-favicon', '~> 0.2.2', group: :jekyll_plugins
20
35
  ```
21
36
 
22
37
  ## Usage
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
+ spec.required_ruby_version = '>= 2.1.0'
26
+
25
27
  spec.add_development_dependency 'bundler', '~> 1.16'
26
28
  spec.add_development_dependency 'minitest', '~> 5.0'
27
29
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -4,10 +4,13 @@ module Jekyll
4
4
  class Generator < Jekyll::Generator
5
5
  priority :high
6
6
 
7
+ attr_accessor :template
8
+
7
9
  def generate(site)
8
10
  @site = site
9
11
  if File.exist? favicon_source
10
- generate_files Favicon.config['sizes'], Favicon.config['path']
12
+ @template = favicon_tempfile
13
+ generate_files Favicon.config['path']
11
14
  else
12
15
  Jekyll.logger.warn 'Jekyll::Favicon: Missing' \
13
16
  " #{Favicon.config['source']}, not generating" \
@@ -15,12 +18,17 @@ module Jekyll
15
18
  end
16
19
  end
17
20
 
21
+ def clean
22
+ return unless @tempfile
23
+ @template.close
24
+ @template.unlink
25
+ end
26
+
18
27
  private
19
28
 
20
- def generate_files(sizes, prefix)
21
- favicon_template = favicon_tempfile
22
- generate_ico_from favicon_template.path
23
- generate_png_from favicon_template.path, prefix, sizes
29
+ def generate_files(prefix)
30
+ generate_ico_from @template.path
31
+ generate_png_from @template.path, prefix
24
32
  if File.extname(favicon_source) == '.svg'
25
33
  generate_svg_from favicon_source, prefix,
26
34
  'safari-pinned-tab.svg'
@@ -34,7 +42,7 @@ module Jekyll
34
42
  @site.static_files << ico_favicon
35
43
  end
36
44
 
37
- def generate_png_from(source, prefix, sizes)
45
+ def generate_png_from(source, prefix)
38
46
  ['classic', 'ie', 'chrome', 'apple-touch-icon'].each do |template|
39
47
  Favicon.config[template]['sizes'].each do |size|
40
48
  png_favicon = Icon.new(@site, prefix, "favicon-#{size}.png", source)
@@ -2,3 +2,10 @@ Jekyll::Hooks.register :site, :after_init do |site|
2
2
  Jekyll::Favicon.merge site.config['favicon']
3
3
  site.config['exclude'] << Jekyll::Favicon.config['source']
4
4
  end
5
+
6
+ Jekyll::Hooks.register :site, :post_write do |site|
7
+ favicon_generators = site.generators.select do |generator|
8
+ generator.is_a? Jekyll::Favicon::Generator
9
+ end
10
+ favicon_generators.each(&:clean)
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Favicon
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-favicon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.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: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - ">="
150
150
  - !ruby/object:Gem::Version
151
- version: '0'
151
+ version: 2.1.0
152
152
  required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  requirements:
154
154
  - - ">="
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.2.5
159
+ rubygems_version: 2.2.0
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Jekyll plugin for favicon tag generation.