jekyll-gzip 2.1.0 → 2.1.1
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 +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/jekyll/gzip/compressor.rb +4 -1
- data/lib/jekyll/gzip/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9b6615eacd308b2725edbc534a6191034246fbad0207028a3fca4d047314820
|
4
|
+
data.tar.gz: 60c0f1df14238b1e7306a577ff27573457f9b100bd957f2a865dee279c816564
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4aa8011f4c7a3487deb1b26183a33aa596e470fecd557b57191ec29184e2cc4da4b29ff25fc0549a1503f0836086e170fb871f63fa861469fca1f8c5ddbe9ce
|
7
|
+
data.tar.gz: b88e330c3f0dbf73ca197913faa5a185387e70190436699901a61401cc478aca1e866302bccb483175bd724ffe0fc9cbef048b0d5886c7fb3d50a5969e138b2c
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## Ongoing [☰](https://github.com/philnash/jekyll-gzip/compare/v2.1.
|
3
|
+
## Ongoing [☰](https://github.com/philnash/jekyll-gzip/compare/v2.1.1...master)
|
4
4
|
|
5
5
|
...
|
6
6
|
|
7
|
+
## 2.1.1 (2019-03-30) [☰](https://github.com/philnash/jekyll-gzip/compare/v2.1.0...v2.1.1)
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
* Replacing files with gzipped version wasn't working, fixed thanks to [k0nserv](https://github.com/k0nserv) in #6.
|
12
|
+
|
7
13
|
## 2.1.0 (2019-03-30) [☰](https://github.com/philnash/jekyll-gzip/compare/v2.0.0...v2.1.0)
|
8
14
|
|
9
15
|
### Added
|
@@ -65,15 +65,18 @@ module Jekyll
|
|
65
65
|
# @param file_name [String] The file name of the file we want to compress
|
66
66
|
# @param extensions [Array<String>] The extensions of files that will be
|
67
67
|
# compressed.
|
68
|
+
# @param replace_file [Boolean] Whether the origina file should be
|
69
|
+
# replaced or written alongside the original with a `.gz` extension
|
68
70
|
#
|
69
71
|
# @return void
|
70
72
|
def self.compress_file(file_name, extensions: [], replace_file: false)
|
71
73
|
return unless extensions.include?(File.extname(file_name))
|
72
74
|
zipped = replace_file ? file_name : "#{file_name}.gz"
|
75
|
+
file_content = IO.binread(file_name)
|
73
76
|
Zlib::GzipWriter.open(zipped, Zlib::BEST_COMPRESSION) do |gz|
|
74
77
|
gz.mtime = File.mtime(file_name)
|
75
78
|
gz.orig_name = file_name
|
76
|
-
gz.write
|
79
|
+
gz.write file_content
|
77
80
|
end
|
78
81
|
end
|
79
82
|
|
data/lib/jekyll/gzip/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-gzip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
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-
|
11
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|