jekyll-zopfli 2.2.0 → 2.3.0

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: 8a3e19c34b5452f22e82d54ac0e4ad22bfb82f76854c52aedf2ed76183b944c4
4
- data.tar.gz: 15a9c097e2bcee2614769aab1555f6e993487f1c06bb62a24c92ddfde6deef87
3
+ metadata.gz: ede348b4764fd1471a53a10ecd1d58f21659d79762b760b58effd80aa5a26ab3
4
+ data.tar.gz: b7a82496a951c065a587803a44968b871723064971ec6ac8b7298c7b4a81fb9c
5
5
  SHA512:
6
- metadata.gz: e1e1b58f0dfe11c3c8e9667a697ef7eeeb66c2a6654113a31bed370e23eb70c7d52c614eb370db6de7094f891d27165b630510d645f7b7b5b4fa9f4d4f181954
7
- data.tar.gz: 5a1f94276e104b8c5041f78af7614f02e738310fe195e66852a13779744ae84cf5d08e8ed9fc9a0962d131b8eb3e970cf653f897995aa57bfbc50bf721564576
6
+ metadata.gz: 42ab91d962c4ce463d5a269df96945cc5a2e82be848c872fb9fb57d061e4b72633d462b607a239e78e91ccbbdd91894f69ca5df5764f88ecd5a28b2b3695c454
7
+ data.tar.gz: e3c70b64606a4095f4b0c5e11098b76f0b37019de30ae8ecf0a99cd2ac011722a4bf7155cd29ef1e0832d325d5e233d418d40269df72ba7e1ccda293e0367ba5
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  ...
6
6
 
7
+ ## 2.3.0 (2019-10-23) [☰](https://github.com/philnash/jekyll-zopfli/compare/v2.2.0...v2.3.0)
8
+
9
+ ### Changed
10
+
11
+ - Fixed tests and actually replaces files when it is supposed to. Thanks @pat!
12
+
7
13
  ## 2.2.0 (2019-08-26) [☰](https://github.com/philnash/jekyll-zopfli/compare/v2.1.0...v2.2.0)
8
14
 
9
15
  ### Changed
@@ -25,7 +25,7 @@ module Jekyll
25
25
  # @return void
26
26
  def self.compress_site(site)
27
27
  site.each_site_file do |file|
28
- compress_file(file.destination(site.dest), extensions: zippable_extensions(site))
28
+ compress_file(file.destination(site.dest), extensions: zippable_extensions(site), replace_file: replace_files(site))
29
29
  end
30
30
  end
31
31
 
@@ -44,8 +44,8 @@ module Jekyll
44
44
  # @return void
45
45
  def self.compress_directory(dir, site)
46
46
  extensions = zippable_extensions(site).join(',')
47
- files = Dir.glob(dir + "**/*{#{extensions}}")
48
- files.each { |file| compress_file(file, extensions: zippable_extensions(site)) }
47
+ files = Dir.glob(dir + "/**/*{#{extensions}}")
48
+ files.each { |file| compress_file(file, extensions: zippable_extensions(site), replace_file: replace_files(site)) }
49
49
  end
50
50
 
51
51
  ##
@@ -60,7 +60,7 @@ module Jekyll
60
60
  # @param file_name [String] The file name of the file we want to compress
61
61
  # @param extensions [Array<String>] The extensions of files that will be
62
62
  # compressed.
63
- # @param replace_file [Boolean] Whether the origina file should be
63
+ # @param replace_file [Boolean] Whether the original file should be
64
64
  # replaced or written alongside the original with a `.gz` extension
65
65
  #
66
66
  # @return void
@@ -79,6 +79,11 @@ module Jekyll
79
79
  def self.zippable_extensions(site)
80
80
  site.config['zopfli'] && site.config['zopfli']['extensions'] || Jekyll::Zopfli::DEFAULT_CONFIG['extensions']
81
81
  end
82
+
83
+ def self.replace_files(site)
84
+ replace_files = site.config.dig('zopfli', 'replace_files')
85
+ replace_files.nil? ? Jekyll::Zopfli::DEFAULT_CONFIG['replace_files'] : replace_files
86
+ end
82
87
  end
83
88
  end
84
- end
89
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Zopfli
5
- VERSION = "2.2.0"
5
+ VERSION = "2.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-zopfli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Nash
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-26 00:00:00.000000000 Z
11
+ date: 2019-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll