nanoc 4.12.6 → 4.12.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +22 -0
- data/lib/nanoc/data_sources/filesystem/parser.rb +1 -1
- data/lib/nanoc/data_sources/filesystem.rb +6 -6
- data/lib/nanoc/filters/{uglify_js.rb → terser.rb} +7 -6
- data/lib/nanoc/filters.rb +1 -1
- data/lib/nanoc/helpers/html_escape.rb +1 -0
- data/lib/nanoc/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fe1df1ff334d90e0fb7a59e16d179a18763922ecf80b612eae9ed20311baadc
|
4
|
+
data.tar.gz: 3e98e4a3e1fb53f7219f981ac4bc0eb93581eaaed05f1ea590c03a14e9e5bbba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48f946173bd0b66ed68b8be4c7666f116ce2aa9c4423dd92eb359ac754e257ac49c4fe6e7aef0b6a860371bd497c18e8261185f5a2996732c2b821dfa8612005
|
7
|
+
data.tar.gz: 045b31dc55983ffdd38a84cfcf2bb217cb9dccfc24814d99f824e341319c6569c1dd6f861f13414209d10882f69388449383dc7818eeff7868690613a2c09da9
|
data/NEWS.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Nanoc news
|
2
2
|
|
3
|
+
## 4.12.8 (2022-10-03)
|
4
|
+
|
5
|
+
Fixes:
|
6
|
+
|
7
|
+
- Fixed incorrect documentation regarding the IP addresses that the `live` and `view` commands listen on (#1584, #1585)
|
8
|
+
|
9
|
+
Enhancements:
|
10
|
+
|
11
|
+
- Wrapped URLs printed to stdout in angular brackets (like `<http://…>`) so terminals can detect them properly (#1589) [Daniel Aleksandersen]
|
12
|
+
- Made various performance improvements (#1596, #1597, #1598)
|
13
|
+
|
14
|
+
## 4.12.7 (2022-06-06)
|
15
|
+
|
16
|
+
Fixes:
|
17
|
+
|
18
|
+
- Dropped support for incompatible Psych versions (#1577, #1583)
|
19
|
+
|
20
|
+
Enhancements:
|
21
|
+
|
22
|
+
- Replaced UglifyJS (unmaintained) with Terser (#1578, #1579)
|
23
|
+
- Dropped support for Ruby 2.6 (EOL) (#1580)
|
24
|
+
|
3
25
|
## 4.12.6 (2022-05-28)
|
4
26
|
|
5
27
|
Fixes:
|
@@ -48,6 +48,8 @@ module Nanoc::DataSources
|
|
48
48
|
#
|
49
49
|
# @api private
|
50
50
|
class Filesystem < Nanoc::DataSource
|
51
|
+
PERMITTED_YAML_CLASSES = Nanoc::Core::ConfigLoader::PERMITTED_YAML_CLASSES
|
52
|
+
|
51
53
|
class AmbiguousMetadataAssociationError < ::Nanoc::Core::Error
|
52
54
|
def initialize(content_filenames, meta_filename)
|
53
55
|
super("There are multiple content files (#{content_filenames.sort.join(', ')}) that could match the file containing metadata (#{meta_filename}).")
|
@@ -116,7 +118,7 @@ module Nanoc::DataSources
|
|
116
118
|
attr_reader :is_binary
|
117
119
|
alias binary? is_binary
|
118
120
|
|
119
|
-
def initialize(is_binary:, content: nil, filename: nil,
|
121
|
+
def initialize(is_binary:, attributes:, content: nil, filename: nil, content_checksum_data: nil, attributes_checksum_data: nil)
|
120
122
|
if content.nil? && filename.nil?
|
121
123
|
raise ArgumentError, '#initialize needs at least content or filename'
|
122
124
|
end
|
@@ -150,7 +152,7 @@ module Nanoc::DataSources
|
|
150
152
|
is_binary = content_filename && !@site_config[:text_extensions].include?(File.extname(content_filename)[1..-1])
|
151
153
|
|
152
154
|
if is_binary && klass == Nanoc::Core::Item
|
153
|
-
meta = (meta_filename && YAML.
|
155
|
+
meta = (meta_filename && YAML.safe_load_file(meta_filename, permitted_classes: PERMITTED_YAML_CLASSES)) || {}
|
154
156
|
|
155
157
|
ProtoDocument.new(is_binary: true, filename: content_filename, attributes: meta)
|
156
158
|
elsif is_binary && klass == Nanoc::Core::Layout
|
@@ -318,10 +320,8 @@ module Nanoc::DataSources
|
|
318
320
|
raise Errors::MultipleMetaFiles.new(meta_filenames, basename)
|
319
321
|
end
|
320
322
|
|
321
|
-
|
322
|
-
|
323
|
-
raise Errors::MultipleContentFiles.new(meta_filenames, basename)
|
324
|
-
end
|
323
|
+
if (config[:identifier_type] != 'full') && ![0, 1].include?(content_filenames.size)
|
324
|
+
raise Errors::MultipleContentFiles.new(meta_filenames, basename)
|
325
325
|
end
|
326
326
|
|
327
327
|
all[basename] = []
|
@@ -2,22 +2,23 @@
|
|
2
2
|
|
3
3
|
module Nanoc::Filters
|
4
4
|
# @api private
|
5
|
-
class
|
5
|
+
class Terser < Nanoc::Filter
|
6
|
+
identifier :terser
|
6
7
|
identifier :uglify_js
|
7
8
|
|
8
|
-
requires '
|
9
|
+
requires 'terser'
|
9
10
|
|
10
|
-
# Runs the content through [
|
11
|
-
# This method optionally takes options to pass directly to
|
11
|
+
# Runs the content through [terser](https://github.com/ahorek/terser-ruby).
|
12
|
+
# This method optionally takes options to pass directly to Terser.
|
12
13
|
#
|
13
14
|
# @param [String] content The content to filter
|
14
15
|
#
|
15
|
-
# @option params [Array] :options ([]) A list of options to pass on to
|
16
|
+
# @option params [Array] :options ([]) A list of options to pass on to Terser
|
16
17
|
#
|
17
18
|
# @return [String] The filtered content
|
18
19
|
def run(content, params = {})
|
19
20
|
# Add filename to load path
|
20
|
-
|
21
|
+
::Terser.new(params).compile(content)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
data/lib/nanoc/filters.rb
CHANGED
@@ -30,6 +30,6 @@ require_relative 'filters/rubypants'
|
|
30
30
|
require_relative 'filters/sass'
|
31
31
|
require_relative 'filters/slim'
|
32
32
|
require_relative 'filters/typogruby'
|
33
|
-
require_relative 'filters/
|
33
|
+
require_relative 'filters/terser'
|
34
34
|
require_relative 'filters/xsl'
|
35
35
|
require_relative 'filters/yui_compressor'
|
@@ -29,6 +29,7 @@ module Nanoc::Helpers
|
|
29
29
|
.gsub('<', '<')
|
30
30
|
.gsub('>', '>')
|
31
31
|
.gsub('"', '"')
|
32
|
+
.gsub("'", ''')
|
32
33
|
else
|
33
34
|
raise 'The #html_escape or #h function needs either a ' \
|
34
35
|
'string or a block to HTML-escape, but neither a string nor a block was given'
|
data/lib/nanoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.12.
|
4
|
+
version: 4.12.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -64,28 +64,28 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - '='
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 4.12.
|
67
|
+
version: 4.12.8
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - '='
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 4.12.
|
74
|
+
version: 4.12.8
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: nanoc-core
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - '='
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 4.12.
|
81
|
+
version: 4.12.8
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - '='
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 4.12.
|
88
|
+
version: 4.12.8
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: nanoc-deploying
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,8 +197,8 @@ files:
|
|
197
197
|
- lib/nanoc/filters/sass/functions.rb
|
198
198
|
- lib/nanoc/filters/sass/importer.rb
|
199
199
|
- lib/nanoc/filters/slim.rb
|
200
|
+
- lib/nanoc/filters/terser.rb
|
200
201
|
- lib/nanoc/filters/typogruby.rb
|
201
|
-
- lib/nanoc/filters/uglify_js.rb
|
202
202
|
- lib/nanoc/filters/xsl.rb
|
203
203
|
- lib/nanoc/filters/yui_compressor.rb
|
204
204
|
- lib/nanoc/helpers.rb
|
@@ -243,14 +243,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
243
|
requirements:
|
244
244
|
- - ">="
|
245
245
|
- !ruby/object:Gem::Version
|
246
|
-
version: '2.
|
246
|
+
version: '2.7'
|
247
247
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
248
248
|
requirements:
|
249
249
|
- - ">="
|
250
250
|
- !ruby/object:Gem::Version
|
251
251
|
version: '0'
|
252
252
|
requirements: []
|
253
|
-
rubygems_version: 3.3.
|
253
|
+
rubygems_version: 3.3.22
|
254
254
|
signing_key:
|
255
255
|
specification_version: 4
|
256
256
|
summary: A static-site generator with a focus on flexibility.
|