nanoc 4.7.5 → 4.7.6
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/Gemfile +4 -3
- data/Gemfile.lock +18 -13
- data/NEWS.md +7 -1
- data/Rakefile +2 -2
- data/lib/nanoc/base/entities/action_sequence.rb +3 -12
- data/lib/nanoc/base/entities/configuration.rb +3 -3
- data/lib/nanoc/base/entities/identifiable_collection.rb +2 -4
- data/lib/nanoc/base/memoization.rb +1 -0
- data/lib/nanoc/base/repos/config_loader.rb +1 -1
- data/lib/nanoc/base/services/compilation_context.rb +3 -3
- data/lib/nanoc/base/services/compiler.rb +2 -3
- data/lib/nanoc/base/services/compiler/stages/cleanup.rb +1 -1
- data/lib/nanoc/base/services/filter.rb +4 -12
- data/lib/nanoc/base/services/item_rep_router.rb +3 -3
- data/lib/nanoc/base/services/outdatedness_checker.rb +1 -2
- data/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb +1 -2
- data/lib/nanoc/base/services/outdatedness_rules/code_snippets_modified.rb +1 -2
- data/lib/nanoc/base/services/outdatedness_rules/configuration_modified.rb +1 -2
- data/lib/nanoc/base/services/outdatedness_rules/paths_modified.rb +5 -5
- data/lib/nanoc/base/services/outdatedness_rules/rules_modified.rb +3 -3
- data/lib/nanoc/base/services/outdatedness_rules/uses_always_outdated_filter.rb +4 -4
- data/lib/nanoc/checking/checks/external_links.rb +0 -2
- data/lib/nanoc/cli.rb +1 -1
- data/lib/nanoc/cli/commands/compile_listeners/timing_recorder.rb +7 -5
- data/lib/nanoc/cli/commands/create-site.rb +1 -1
- data/lib/nanoc/cli/commands/nanoc.rb +1 -4
- data/lib/nanoc/cli/commands/show-plugins.rb +1 -1
- data/lib/nanoc/cli/error_handler.rb +2 -1
- data/lib/nanoc/deploying/deployers/git.rb +7 -7
- data/lib/nanoc/extra/link_collector.rb +2 -2
- data/lib/nanoc/filters/asciidoc.rb +1 -1
- data/lib/nanoc/filters/colorize_syntax.rb +46 -19
- data/lib/nanoc/filters/relativize_paths.rb +33 -9
- data/lib/nanoc/rule_dsl/action_sequence_calculator.rb +15 -7
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.gemspec +1 -1
- data/spec/nanoc/base/checksummer_spec.rb +2 -2
- data/spec/nanoc/base/entities/action_sequence_spec.rb +0 -36
- data/spec/nanoc/base/entities/identifier_spec.rb +1 -1
- data/spec/nanoc/base/entities/outdatedness_status_spec.rb +1 -1
- data/spec/nanoc/base/entities/processing_actions/snapshot_spec.rb +1 -1
- data/spec/nanoc/base/entities/props_spec.rb +13 -13
- data/spec/nanoc/base/memoization_spec.rb +31 -0
- data/spec/nanoc/base/services/executor_spec.rb +2 -2
- data/spec/nanoc/base/services/item_rep_selector_spec.rb +12 -12
- data/spec/nanoc/base/services/outdatedness_checker_spec.rb +23 -23
- data/spec/nanoc/base/views/post_compile_item_view_spec.rb +1 -1
- data/spec/nanoc/cli/commands/deploy_spec.rb +8 -8
- data/spec/nanoc/filters/less_spec.rb +11 -11
- data/spec/nanoc/helpers/capturing_spec.rb +2 -2
- data/spec/nanoc/helpers/tagging_spec.rb +5 -5
- data/spec/nanoc/integration/outdatedness_integration_spec.rb +29 -29
- data/spec/nanoc/integration/partial_recompilation_spec.rb +8 -8
- data/spec/nanoc/regressions/gh_1015_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1022_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1031_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1035_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1037a_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_1037b_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1040_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1045_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1047_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1064_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1067_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1082a_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1082b_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1082c_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1082d_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1093_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1094_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1097_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1100_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1102_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_1107_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1130_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_1134_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_1145_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_804_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_809_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_841_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_867_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_882_spec.rb +3 -3
- data/spec/nanoc/regressions/gh_885_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_891_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_913_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_924_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_928_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_937_spec.rb +2 -2
- data/spec/nanoc/regressions/gh_942_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_947_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_948_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_951_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_954_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_970a_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_970b_spec.rb +7 -7
- data/spec/nanoc/regressions/gh_974_spec.rb +1 -1
- data/spec/nanoc/regressions/gh_981_spec.rb +3 -3
- data/spec/nanoc/rule_dsl/action_sequence_calculator_spec.rb +43 -4
- data/test/base/core_ext/array_spec.rb +2 -2
- data/test/base/test_compiler.rb +6 -6
- data/test/base/test_filter.rb +0 -8
- data/test/base/test_site.rb +1 -1
- data/test/checking/test_runner.rb +2 -2
- data/test/cli/commands/test_check.rb +2 -2
- data/test/cli/commands/test_compile.rb +6 -6
- data/test/cli/commands/test_create_site.rb +12 -12
- data/test/cli/commands/test_help.rb +2 -2
- data/test/cli/commands/test_info.rb +1 -1
- data/test/cli/commands/test_prune.rb +6 -6
- data/test/cli/test_cleaning_stream.rb +1 -1
- data/test/cli/test_cli.rb +9 -9
- data/test/data_sources/test_filesystem.rb +8 -8
- data/test/extra/core_ext/test_pathname.rb +1 -1
- data/test/extra/test_link_collector.rb +3 -3
- data/test/extra/test_piper.rb +3 -3
- data/test/filters/colorize_syntax/test_common.rb +25 -1
- data/test/filters/test_relativize_paths.rb +38 -0
- data/test/helper.rb +1 -1
- data/test/helpers/test_capturing.rb +8 -8
- data/test/rule_dsl/test_action_provider.rb +2 -2
- data/test/rule_dsl/test_rule.rb +1 -1
- data/test/test_gem.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a40c3389c6ef42f0924566370507dfc3a2e361f8
|
|
4
|
+
data.tar.gz: '09906841a6aa6ba7dc5d4bdc06e5914a4678d274'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91221955a35dfd5786f068f6fca88f6c3d2ee06cc9ece04e85aedd769c5d66147aec8d37c663c1dcc2e208ce32c38d0939a78d1539dd963f3380fe427d76d854
|
|
7
|
+
data.tar.gz: 4ef5eac2bd6d99bbeb5c1276fa13dd498f7cf8e70cce12132945ff682cf90a02a8d11c459bb88300934fd1686f61c6c069a371c196ca51f605516c7454017c89
|
data/Gemfile
CHANGED
|
@@ -48,12 +48,13 @@ group :plugins do
|
|
|
48
48
|
gem 'mime-types'
|
|
49
49
|
gem 'mustache', '~> 1.0'
|
|
50
50
|
gem 'nokogiri', '~> 1.6'
|
|
51
|
+
gem 'nokogumbo', '~> 1.4'
|
|
51
52
|
gem 'pandoc-ruby'
|
|
52
|
-
gem 'pygments.rb', '~> 1.1', '>= 1.1.1', platforms: %i
|
|
53
|
+
gem 'pygments.rb', '~> 1.1', '>= 1.1.1', platforms: %i[ruby mswin]
|
|
53
54
|
gem 'rack'
|
|
54
55
|
gem 'rainpress'
|
|
55
|
-
gem 'rdiscount', '~> 2.2', platforms: %i
|
|
56
|
-
gem 'redcarpet', platforms: %i
|
|
56
|
+
gem 'rdiscount', '~> 2.2', platforms: %i[ruby mswin]
|
|
57
|
+
gem 'redcarpet', platforms: %i[ruby mswin]
|
|
57
58
|
gem 'RedCloth', platforms: :ruby
|
|
58
59
|
gem 'rouge'
|
|
59
60
|
gem 'rubypants'
|
data/Gemfile.lock
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
GIT
|
|
2
2
|
remote: https://github.com/bbatsov/rubocop.git
|
|
3
|
-
revision:
|
|
3
|
+
revision: cf07b9a493feed28577032c307ddab3cb7b8c2fc
|
|
4
4
|
specs:
|
|
5
|
-
rubocop (0.48.
|
|
5
|
+
rubocop (0.48.1)
|
|
6
|
+
parallel (~> 1.10)
|
|
6
7
|
parser (>= 2.3.3.1, < 3.0)
|
|
7
8
|
powerpack (~> 0.1)
|
|
8
9
|
rainbow (>= 1.99.1, < 3.0)
|
|
@@ -12,8 +13,8 @@ GIT
|
|
|
12
13
|
PATH
|
|
13
14
|
remote: .
|
|
14
15
|
specs:
|
|
15
|
-
nanoc (4.7.
|
|
16
|
-
cri (~> 2.
|
|
16
|
+
nanoc (4.7.6)
|
|
17
|
+
cri (~> 2.8)
|
|
17
18
|
ddplugin (~> 1.0)
|
|
18
19
|
hamster (~> 3.0)
|
|
19
20
|
ref (~> 2.0)
|
|
@@ -68,7 +69,7 @@ GEM
|
|
|
68
69
|
tins (~> 1.6)
|
|
69
70
|
crack (0.4.3)
|
|
70
71
|
safe_yaml (~> 1.0.0)
|
|
71
|
-
cri (2.
|
|
72
|
+
cri (2.8.0)
|
|
72
73
|
colored (~> 1.2)
|
|
73
74
|
ddplugin (1.0.1)
|
|
74
75
|
diff-lcs (1.3)
|
|
@@ -196,7 +197,7 @@ GEM
|
|
|
196
197
|
fog-voxel (0.1.0)
|
|
197
198
|
fog-core
|
|
198
199
|
fog-xml
|
|
199
|
-
fog-vsphere (1.9.
|
|
200
|
+
fog-vsphere (1.9.1)
|
|
200
201
|
fog-core
|
|
201
202
|
rbvmomi (~> 1.9)
|
|
202
203
|
fog-xenserver (0.3.0)
|
|
@@ -232,7 +233,7 @@ GEM
|
|
|
232
233
|
hashdiff (0.3.2)
|
|
233
234
|
inflecto (0.0.2)
|
|
234
235
|
ipaddress (0.8.3)
|
|
235
|
-
json (2.0.
|
|
236
|
+
json (2.0.4)
|
|
236
237
|
kramdown (1.13.2)
|
|
237
238
|
less (2.6.0)
|
|
238
239
|
commonjs (~> 0.2.7)
|
|
@@ -262,10 +263,13 @@ GEM
|
|
|
262
263
|
nenv (0.3.0)
|
|
263
264
|
nokogiri (1.7.1)
|
|
264
265
|
mini_portile2 (~> 2.1.0)
|
|
266
|
+
nokogumbo (1.4.10)
|
|
267
|
+
nokogiri
|
|
265
268
|
notiffany (0.1.1)
|
|
266
269
|
nenv (~> 0.1)
|
|
267
270
|
shellany (~> 0.0)
|
|
268
271
|
pandoc-ruby (2.0.1)
|
|
272
|
+
parallel (1.11.1)
|
|
269
273
|
parser (2.4.0.0)
|
|
270
274
|
ast (~> 2.2)
|
|
271
275
|
powerpack (0.1.1)
|
|
@@ -274,7 +278,7 @@ GEM
|
|
|
274
278
|
method_source (~> 0.8.1)
|
|
275
279
|
slop (~> 3.4)
|
|
276
280
|
public_suffix (2.0.5)
|
|
277
|
-
pygments.rb (1.1.
|
|
281
|
+
pygments.rb (1.1.2)
|
|
278
282
|
multi_json (>= 1.0.0)
|
|
279
283
|
rack (2.0.1)
|
|
280
284
|
rainbow (2.2.1)
|
|
@@ -283,7 +287,7 @@ GEM
|
|
|
283
287
|
rb-fsevent (0.9.8)
|
|
284
288
|
rb-inotify (0.9.8)
|
|
285
289
|
ffi (>= 0.5.0)
|
|
286
|
-
rbvmomi (1.
|
|
290
|
+
rbvmomi (1.11.0)
|
|
287
291
|
builder (~> 3.0)
|
|
288
292
|
json (>= 1.8)
|
|
289
293
|
nokogiri (~> 1.5)
|
|
@@ -325,7 +329,7 @@ GEM
|
|
|
325
329
|
tilt (>= 1.3.3, < 2.1)
|
|
326
330
|
slop (3.6.0)
|
|
327
331
|
temple (0.7.7)
|
|
328
|
-
term-ansicolor (1.
|
|
332
|
+
term-ansicolor (1.6.0)
|
|
329
333
|
tins (~> 1.0)
|
|
330
334
|
therubyracer (0.12.3)
|
|
331
335
|
libv8 (~> 3.16.14.15)
|
|
@@ -337,15 +341,15 @@ GEM
|
|
|
337
341
|
trollop (2.1.2)
|
|
338
342
|
typogruby (1.0.18)
|
|
339
343
|
rubypants
|
|
340
|
-
uglifier (3.
|
|
344
|
+
uglifier (3.2.0)
|
|
341
345
|
execjs (>= 0.3.0, < 3)
|
|
342
|
-
unicode-display_width (1.1
|
|
346
|
+
unicode-display_width (1.2.1)
|
|
343
347
|
url (0.3.2)
|
|
344
348
|
vcr (3.0.3)
|
|
345
349
|
w3c_validators (1.3.2)
|
|
346
350
|
json (>= 1.8)
|
|
347
351
|
nokogiri (~> 1.6)
|
|
348
|
-
webmock (
|
|
352
|
+
webmock (3.0.1)
|
|
349
353
|
addressable (>= 2.3.6)
|
|
350
354
|
crack (>= 0.3.2)
|
|
351
355
|
hashdiff
|
|
@@ -392,6 +396,7 @@ DEPENDENCIES
|
|
|
392
396
|
mustache (~> 1.0)
|
|
393
397
|
nanoc!
|
|
394
398
|
nokogiri (~> 1.6)
|
|
399
|
+
nokogumbo (~> 1.4)
|
|
395
400
|
pandoc-ruby
|
|
396
401
|
pry
|
|
397
402
|
pygments.rb (~> 1.1, >= 1.1.1)
|
data/NEWS.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# Nanoc news
|
|
2
2
|
|
|
3
|
+
## 4.7.6 (2017-04-15)
|
|
4
|
+
|
|
5
|
+
Enhancements:
|
|
6
|
+
|
|
7
|
+
* Added support for `:html5` in `relativize_paths` and `colorize_syntax` filters (#1153)
|
|
8
|
+
|
|
3
9
|
## 4.7.5 (2017-04-01)
|
|
4
10
|
|
|
5
11
|
Fixes:
|
|
6
12
|
|
|
7
|
-
*
|
|
13
|
+
* Made `--verbose` be recognised when calling `nanoc` without subcommand (#1145, #1146)
|
|
8
14
|
|
|
9
15
|
Enhancements:
|
|
10
16
|
|
data/Rakefile
CHANGED
|
@@ -3,6 +3,9 @@ module Nanoc::Int
|
|
|
3
3
|
include Nanoc::Int::ContractsSupport
|
|
4
4
|
include Enumerable
|
|
5
5
|
|
|
6
|
+
attr_reader :item_rep
|
|
7
|
+
attr_reader :actions
|
|
8
|
+
|
|
6
9
|
def initialize(item_rep, actions: [])
|
|
7
10
|
@item_rep = item_rep
|
|
8
11
|
@actions = actions
|
|
@@ -71,18 +74,6 @@ module Nanoc::Int
|
|
|
71
74
|
)
|
|
72
75
|
end
|
|
73
76
|
|
|
74
|
-
def compact_snapshots
|
|
75
|
-
actions = []
|
|
76
|
-
@actions.each do |action|
|
|
77
|
-
if [actions.last, action].all? { |a| a.is_a?(Nanoc::Int::ProcessingActions::Snapshot) }
|
|
78
|
-
actions[-1] = actions.last.update(snapshot_names: action.snapshot_names, paths: action.paths)
|
|
79
|
-
else
|
|
80
|
-
actions << action
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
self.class.new(@item_rep, actions: actions)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
77
|
def snapshots_defs
|
|
87
78
|
is_binary = @item_rep.item.content.binary?
|
|
88
79
|
snapshot_defs = []
|
|
@@ -22,9 +22,9 @@ module Nanoc::Int
|
|
|
22
22
|
# that lacks some options, the default value will be taken from
|
|
23
23
|
# `DEFAULT_CONFIG`.
|
|
24
24
|
DEFAULT_CONFIG = {
|
|
25
|
-
text_extensions: %w
|
|
26
|
-
lib_dirs: %w
|
|
27
|
-
commands_dirs: %w
|
|
25
|
+
text_extensions: %w[adoc asciidoc atom css erb haml htm html js less markdown md php rb sass scss txt xhtml xml coffee hb handlebars mustache ms slim rdoc].sort,
|
|
26
|
+
lib_dirs: %w[lib],
|
|
27
|
+
commands_dirs: %w[commands],
|
|
28
28
|
output_dir: 'output',
|
|
29
29
|
data_sources: [{}],
|
|
30
30
|
index_filenames: ['index.html'],
|
|
@@ -81,10 +81,9 @@ module Nanoc::Int
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
contract C::Any => C::Maybe[C::RespondTo[:identifier]]
|
|
84
|
-
def get_memoized(arg)
|
|
84
|
+
memoized def get_memoized(arg)
|
|
85
85
|
get_unmemoized(arg)
|
|
86
86
|
end
|
|
87
|
-
memoize :get_memoized
|
|
88
87
|
|
|
89
88
|
contract C::Any => C::IterOf[C::RespondTo[:identifier]]
|
|
90
89
|
def find_all_unmemoized(arg)
|
|
@@ -93,10 +92,9 @@ module Nanoc::Int
|
|
|
93
92
|
end
|
|
94
93
|
|
|
95
94
|
contract C::Any => C::IterOf[C::RespondTo[:identifier]]
|
|
96
|
-
def find_all_memoized(arg)
|
|
95
|
+
memoized def find_all_memoized(arg)
|
|
97
96
|
find_all_unmemoized(arg)
|
|
98
97
|
end
|
|
99
|
-
memoize :find_all_memoized
|
|
100
98
|
|
|
101
99
|
def object_with_identifier(identifier)
|
|
102
100
|
if frozen?
|
|
@@ -26,7 +26,7 @@ module Nanoc::Int
|
|
|
26
26
|
|
|
27
27
|
# @return [String]
|
|
28
28
|
def self.config_filename_for_cwd
|
|
29
|
-
filenames = %w
|
|
29
|
+
filenames = %w[nanoc.yaml config.yaml]
|
|
30
30
|
candidate = filenames.find { |f| File.file?(f) }
|
|
31
31
|
candidate && File.expand_path(candidate)
|
|
32
32
|
end
|
|
@@ -13,11 +13,11 @@ module Nanoc::Int
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def filter_name_and_args_for_layout(layout)
|
|
16
|
-
|
|
17
|
-
if
|
|
16
|
+
seq = @action_provider.action_sequence_for(layout)
|
|
17
|
+
if seq.nil? || seq.size != 1 || !seq[0].is_a?(Nanoc::Int::ProcessingActions::Filter)
|
|
18
18
|
raise Nanoc::Int::Errors::UndefinedFilterForLayout.new(layout)
|
|
19
19
|
end
|
|
20
|
-
[
|
|
20
|
+
[seq[0].filter_name, seq[0].params]
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def create_view_context(dependency_tracker)
|
|
@@ -93,11 +93,10 @@ module Nanoc::Int
|
|
|
93
93
|
private
|
|
94
94
|
|
|
95
95
|
def run_stage(stage, *args)
|
|
96
|
-
|
|
97
|
-
Nanoc::Int::NotificationCenter.post(:stage_started, name)
|
|
96
|
+
Nanoc::Int::NotificationCenter.post(:stage_started, stage.class)
|
|
98
97
|
stage.run(*args)
|
|
99
98
|
ensure
|
|
100
|
-
Nanoc::Int::NotificationCenter.post(:stage_ended,
|
|
99
|
+
Nanoc::Int::NotificationCenter.post(:stage_ended, stage.class)
|
|
101
100
|
end
|
|
102
101
|
|
|
103
102
|
def preprocess_stage
|
|
@@ -26,7 +26,7 @@ module Nanoc::Int::Compiler::Stages
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def cleanup_old_stores
|
|
29
|
-
%w
|
|
29
|
+
%w[checksums compiled_content dependencies outdatedness action_sequence].each do |fn|
|
|
30
30
|
full_fn = File.join('tmp', fn)
|
|
31
31
|
if File.file?(full_fn)
|
|
32
32
|
FileUtils.rm_f(full_fn)
|
|
@@ -27,14 +27,6 @@ module Nanoc
|
|
|
27
27
|
# @api private
|
|
28
28
|
TMP_BINARY_ITEMS_DIR = 'binary_items'.freeze
|
|
29
29
|
|
|
30
|
-
# A hash containing variables that will be made available during
|
|
31
|
-
# filtering.
|
|
32
|
-
#
|
|
33
|
-
# @return [Hash]
|
|
34
|
-
#
|
|
35
|
-
# @api private
|
|
36
|
-
attr_reader :assigns
|
|
37
|
-
|
|
38
30
|
extend DDPlugin::Plugin
|
|
39
31
|
|
|
40
32
|
class << self
|
|
@@ -196,10 +188,10 @@ module Nanoc
|
|
|
196
188
|
#
|
|
197
189
|
# @api private
|
|
198
190
|
def filename
|
|
199
|
-
if
|
|
200
|
-
"layout #{
|
|
201
|
-
elsif
|
|
202
|
-
"item #{
|
|
191
|
+
if @layout
|
|
192
|
+
"layout #{@layout.identifier}"
|
|
193
|
+
elsif @item
|
|
194
|
+
"item #{@item.identifier} (rep #{@item_rep.name})"
|
|
203
195
|
else
|
|
204
196
|
'?'
|
|
205
197
|
end
|
|
@@ -36,9 +36,9 @@ module Nanoc::Int
|
|
|
36
36
|
route_rep(rep, paths, snapshot_names, {})
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
action_sequences[rep] =
|
|
41
|
-
|
|
39
|
+
seq = @action_provider.action_sequence_for(rep)
|
|
40
|
+
action_sequences[rep] = seq
|
|
41
|
+
seq.paths.each do |(snapshot_names, paths)|
|
|
42
42
|
route_rep(rep, paths, snapshot_names, assigned_paths)
|
|
43
43
|
end
|
|
44
44
|
|
|
@@ -37,7 +37,7 @@ module Nanoc::Int
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
contract C::Or[Nanoc::Int::Item, Nanoc::Int::ItemRep, Nanoc::Int::Layout] => C::Maybe[OutdatednessStatus]
|
|
40
|
-
def outdatedness_status_for(obj)
|
|
40
|
+
memoized def outdatedness_status_for(obj)
|
|
41
41
|
case obj
|
|
42
42
|
when Nanoc::Int::ItemRep
|
|
43
43
|
apply_rules(RULES_FOR_ITEM_REP, obj)
|
|
@@ -49,7 +49,6 @@ module Nanoc::Int
|
|
|
49
49
|
raise Nanoc::Int::Errors::InternalInconsistency, "do not know how to check outdatedness of #{obj.inspect}"
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
|
-
memoize :outdatedness_status_for
|
|
53
52
|
|
|
54
53
|
private
|
|
55
54
|
|
|
@@ -7,7 +7,7 @@ module Nanoc::Int::OutdatednessRules
|
|
|
7
7
|
affects_props :attributes, :compiled_content
|
|
8
8
|
|
|
9
9
|
contract C::Or[Nanoc::Int::ItemRep, Nanoc::Int::Item, Nanoc::Int::Layout], C::Named['Nanoc::Int::OutdatednessChecker'] => C::Maybe[Nanoc::Int::OutdatednessReasons::Generic]
|
|
10
|
-
def apply(obj, outdatedness_checker)
|
|
10
|
+
memoized def apply(obj, outdatedness_checker)
|
|
11
11
|
case obj
|
|
12
12
|
when Nanoc::Int::ItemRep
|
|
13
13
|
apply(obj.item, outdatedness_checker)
|
|
@@ -29,6 +29,5 @@ module Nanoc::Int::OutdatednessRules
|
|
|
29
29
|
raise ArgumentError
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
|
-
memoize :apply
|
|
33
32
|
end
|
|
34
33
|
end
|
|
@@ -14,13 +14,12 @@ module Nanoc::Int::OutdatednessRules
|
|
|
14
14
|
|
|
15
15
|
private
|
|
16
16
|
|
|
17
|
-
def any_snippets_modified?(outdatedness_checker)
|
|
17
|
+
memoized def any_snippets_modified?(outdatedness_checker)
|
|
18
18
|
outdatedness_checker.site.code_snippets.any? do |cs|
|
|
19
19
|
ch_old = outdatedness_checker.checksum_store[cs]
|
|
20
20
|
ch_new = Nanoc::Int::Checksummer.calc(cs)
|
|
21
21
|
ch_old != ch_new
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
|
-
memoize :any_snippets_modified?
|
|
25
24
|
end
|
|
26
25
|
end
|
|
@@ -12,12 +12,11 @@ module Nanoc::Int::OutdatednessRules
|
|
|
12
12
|
|
|
13
13
|
private
|
|
14
14
|
|
|
15
|
-
def config_modified?(outdatedness_checker)
|
|
15
|
+
memoized def config_modified?(outdatedness_checker)
|
|
16
16
|
obj = outdatedness_checker.site.config
|
|
17
17
|
ch_old = outdatedness_checker.checksum_store[obj]
|
|
18
18
|
ch_new = Nanoc::Int::Checksummer.calc(obj)
|
|
19
19
|
ch_old != ch_new
|
|
20
20
|
end
|
|
21
|
-
memoize :config_modified?
|
|
22
21
|
end
|
|
23
22
|
end
|
|
@@ -5,12 +5,12 @@ module Nanoc::Int::OutdatednessRules
|
|
|
5
5
|
def apply(obj, outdatedness_checker)
|
|
6
6
|
# FIXME: Prefer to not work on serialised version
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return true if
|
|
8
|
+
seq_old = outdatedness_checker.action_sequence_store[obj]
|
|
9
|
+
seq_new = outdatedness_checker.action_sequence_for(obj).serialize
|
|
10
|
+
return true if seq_old.nil?
|
|
11
11
|
|
|
12
|
-
paths_old =
|
|
13
|
-
paths_new =
|
|
12
|
+
paths_old = seq_old.select { |pa| pa[0] == :snapshot }
|
|
13
|
+
paths_new = seq_new.select { |pa| pa[0] == :snapshot }
|
|
14
14
|
|
|
15
15
|
if paths_old != paths_new
|
|
16
16
|
Nanoc::Int::OutdatednessReasons::PathsModified
|
|
@@ -3,9 +3,9 @@ module Nanoc::Int::OutdatednessRules
|
|
|
3
3
|
affects_props :compiled_content, :path
|
|
4
4
|
|
|
5
5
|
def apply(obj, outdatedness_checker)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
unless
|
|
6
|
+
seq_old = outdatedness_checker.action_sequence_store[obj]
|
|
7
|
+
seq_new = outdatedness_checker.action_sequence_for(obj).serialize
|
|
8
|
+
unless seq_old.eql?(seq_new)
|
|
9
9
|
Nanoc::Int::OutdatednessReasons::RulesModified
|
|
10
10
|
end
|
|
11
11
|
end
|