nanoc 4.12.0 → 4.12.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +32 -0
- data/lib/nanoc/data_sources/filesystem/parser.rb +2 -1
- data/lib/nanoc/data_sources/filesystem/tools.rb +9 -0
- data/lib/nanoc/data_sources/filesystem.rb +12 -6
- data/lib/nanoc/filters/colorize_syntax.rb +1 -1
- data/lib/nanoc/filters/erb.rb +1 -1
- data/lib/nanoc/filters/relativize_paths.rb +5 -3
- data/lib/nanoc/rule_dsl/action_sequence_calculator.rb +0 -2
- data/lib/nanoc/version.rb +1 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 437153302bf3976f9e3187df89dec7ef4da2f63a4bafe681adefbe348a06d31d
|
4
|
+
data.tar.gz: 40b66e18acae6aeb83de12c47f9672aac6c2135e536b74f0a06c8fa73acf95f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1210addd31a8f1e795d67bc8371e97f594cb6950374514f1e7a641635816c1923468588e2d63b26f86c12c537bc4b3b4ecee01694acc99f403b787c606518d8a
|
7
|
+
data.tar.gz: 3e1ab8785fffb97d55274196e509aaf1dceda6e080b852e639316eb0fc5e9f86dcbf243bda070dc478452e46fd4a6c70af9e42d36c095cc0570a61a07d5eeec6
|
data/NEWS.md
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
# Nanoc news
|
2
2
|
|
3
|
+
## 4.12.4 (2022-01-15)
|
4
|
+
|
5
|
+
Fixes:
|
6
|
+
|
7
|
+
- Fixed “can’t be called from trap context” exception (#1559, #1564)
|
8
|
+
|
9
|
+
Enhancements:
|
10
|
+
|
11
|
+
- Added `Date` to the list of permitted classes for YAML (#1560) [Damien Mathieu]
|
12
|
+
- Made Nanoc log the filename when it is not absolute (#1557) [Johnny Willemsen]
|
13
|
+
|
14
|
+
## 4.12.3 (2021-10-09)
|
15
|
+
|
16
|
+
Fixes:
|
17
|
+
|
18
|
+
- Switched ERB to use keyword arguments (#1547, #1550) [Daniel Aleksandersen]
|
19
|
+
- Removed use_helper re-definition warning (#1548, #1553) [Daniel Aleksandersen]
|
20
|
+
- Fixed issue which could cause items not to be recalculated when removing items in the preprocess block (#1554, #1555)
|
21
|
+
- Dropped Nokogumbo in favor of Nokogiri (#1546, #1549) [Daniel Aleksandersen]
|
22
|
+
|
23
|
+
## 4.12.2 (2021-05-28)
|
24
|
+
|
25
|
+
Enhancements:
|
26
|
+
|
27
|
+
- Add support for `video/@poster` to relativize_paths (#1544) [Masayuki Higashino]
|
28
|
+
|
29
|
+
## 4.12.1 (2021-04-05)
|
30
|
+
|
31
|
+
Enhancements:
|
32
|
+
|
33
|
+
- Made Nanoc expand paths containing `~` (home directory) in the filesystem data source configuration (!4, !5, !6)
|
34
|
+
|
3
35
|
## 4.12.0 (2021-02-20)
|
4
36
|
|
5
37
|
Features:
|
@@ -4,6 +4,7 @@
|
|
4
4
|
class Nanoc::DataSources::Filesystem
|
5
5
|
class Parser
|
6
6
|
SEPARATOR = /(-{5}|-{3})/.source
|
7
|
+
PERMITTED_YAML_CLASSES = [Symbol, Date].freeze
|
7
8
|
|
8
9
|
class ParseResult
|
9
10
|
attr_reader :content
|
@@ -60,7 +61,7 @@ class Nanoc::DataSources::Filesystem
|
|
60
61
|
# @return [Hash]
|
61
62
|
def parse_metadata(data, filename)
|
62
63
|
begin
|
63
|
-
meta = YAML.load(data) || {}
|
64
|
+
meta = YAML.load(data, permitted_classes: PERMITTED_YAML_CLASSES) || {}
|
64
65
|
rescue => e
|
65
66
|
raise Errors::UnparseableMetadata.new(filename, e)
|
66
67
|
end
|
@@ -81,6 +81,15 @@ class Nanoc::DataSources::Filesystem < Nanoc::DataSource
|
|
81
81
|
end.compact.flatten
|
82
82
|
end
|
83
83
|
|
84
|
+
# Expands the path (including resolving ~ for home directory) and returns
|
85
|
+
# a relative path to the expanded path.
|
86
|
+
def expand_and_relativize_path(path)
|
87
|
+
from = Pathname.new(Dir.getwd)
|
88
|
+
to = Pathname.new(File.expand_path(path))
|
89
|
+
|
90
|
+
to.relative_path_from(from).to_s
|
91
|
+
end
|
92
|
+
|
84
93
|
# Returns all files and directories in the given directory and
|
85
94
|
# directories below it.
|
86
95
|
#
|
@@ -92,14 +92,16 @@ module Nanoc::DataSources
|
|
92
92
|
require 'listen'
|
93
93
|
|
94
94
|
Nanoc::Core::ChangesStream.new do |cl|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
95
|
+
if dir
|
96
|
+
listener =
|
97
|
+
Listen.to(File.expand_path(dir)) do |_modifieds, _addeds, _deleteds|
|
98
|
+
cl.unknown
|
99
|
+
end
|
99
100
|
|
100
|
-
|
101
|
+
listener.start
|
101
102
|
|
102
|
-
|
103
|
+
cl.to_stop { listener.stop }
|
104
|
+
end
|
103
105
|
|
104
106
|
sleep
|
105
107
|
end
|
@@ -182,6 +184,8 @@ module Nanoc::DataSources
|
|
182
184
|
|
183
185
|
return [] if dir_name.nil?
|
184
186
|
|
187
|
+
dir_name = Tools.expand_and_relativize_path(dir_name)
|
188
|
+
|
185
189
|
each_content_meta_pair_in(dir_name) do |content_filename, meta_filename|
|
186
190
|
proto_doc = read_proto_document(content_filename, meta_filename, klass)
|
187
191
|
|
@@ -295,6 +299,8 @@ module Nanoc::DataSources
|
|
295
299
|
# 'content/qux' => [ nil, ['html'] ]
|
296
300
|
# }
|
297
301
|
def all_split_files_in(dir_name)
|
302
|
+
dir_name = Tools.expand_and_relativize_path(dir_name)
|
303
|
+
|
298
304
|
by_basename =
|
299
305
|
all_files_in(dir_name)
|
300
306
|
.reject { |fn| fn =~ /(~|\.orig|\.rej|\.bak)$/ }
|
data/lib/nanoc/filters/erb.rb
CHANGED
@@ -8,13 +8,14 @@ module Nanoc::Filters
|
|
8
8
|
require 'nanoc/helpers/link_to'
|
9
9
|
include Nanoc::Helpers::LinkTo
|
10
10
|
|
11
|
-
|
11
|
+
prepend MemoWise
|
12
12
|
|
13
13
|
SELECTORS =
|
14
14
|
[
|
15
15
|
'*/@href',
|
16
16
|
'*/@src',
|
17
17
|
'object/@data',
|
18
|
+
'video/@poster',
|
18
19
|
'param[@name="movie"]/@value',
|
19
20
|
'form/@action',
|
20
21
|
'comment()',
|
@@ -78,7 +79,7 @@ module Nanoc::Filters
|
|
78
79
|
end
|
79
80
|
end
|
80
81
|
|
81
|
-
|
82
|
+
def excludes(params)
|
82
83
|
raw = [params.fetch(:exclude, [])].flatten
|
83
84
|
raw.map do |exclusion|
|
84
85
|
case exclusion
|
@@ -89,6 +90,7 @@ module Nanoc::Filters
|
|
89
90
|
end
|
90
91
|
end
|
91
92
|
end
|
93
|
+
memo_wise :excludes
|
92
94
|
|
93
95
|
def exclude?(path, params)
|
94
96
|
# TODO: Use #match? on newer Ruby versions
|
@@ -113,7 +115,7 @@ module Nanoc::Filters
|
|
113
115
|
require 'nokogiri'
|
114
116
|
::Nokogiri::HTML
|
115
117
|
when :html5
|
116
|
-
require '
|
118
|
+
require 'nokogiri'
|
117
119
|
::Nokogiri::HTML5
|
118
120
|
when :xml
|
119
121
|
require 'nokogiri'
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.12.
|
61
|
+
version: 4.12.4
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.12.
|
68
|
+
version: 4.12.4
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: nanoc-core
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 4.12.
|
75
|
+
version: 4.12.4
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 4.12.
|
82
|
+
version: 4.12.4
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: nanoc-deploying
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,7 +227,8 @@ files:
|
|
227
227
|
homepage: https://nanoc.ws/
|
228
228
|
licenses:
|
229
229
|
- MIT
|
230
|
-
metadata:
|
230
|
+
metadata:
|
231
|
+
rubygems_mfa_required: 'true'
|
231
232
|
post_install_message:
|
232
233
|
rdoc_options: []
|
233
234
|
require_paths:
|
@@ -236,14 +237,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
236
237
|
requirements:
|
237
238
|
- - ">="
|
238
239
|
- !ruby/object:Gem::Version
|
239
|
-
version: '2.
|
240
|
+
version: '2.6'
|
240
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
241
242
|
requirements:
|
242
243
|
- - ">="
|
243
244
|
- !ruby/object:Gem::Version
|
244
245
|
version: '0'
|
245
246
|
requirements: []
|
246
|
-
rubygems_version: 3.
|
247
|
+
rubygems_version: 3.3.4
|
247
248
|
signing_key:
|
248
249
|
specification_version: 4
|
249
250
|
summary: A static-site generator with a focus on flexibility.
|