nanoc 4.11.12 → 4.11.13
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/NEWS.md +7 -1
- data/bin/nanoc +1 -1
- data/lib/nanoc.rb +2 -27
- data/lib/nanoc/base.rb +3 -6
- data/lib/nanoc/base/errors.rb +6 -104
- data/lib/nanoc/checking/check.rb +4 -4
- data/lib/nanoc/checking/checks/external_links.rb +1 -1
- data/lib/nanoc/checking/checks/stale.rb +1 -1
- data/lib/nanoc/checking/runner.rb +2 -2
- data/lib/nanoc/data_sources/filesystem/tools.rb +4 -4
- data/lib/nanoc/extra.rb +1 -1
- data/lib/nanoc/helpers/blogging.rb +8 -8
- data/lib/nanoc/helpers/capturing.rb +1 -1
- data/lib/nanoc/helpers/link_to.rb +1 -1
- data/lib/nanoc/orig_cli.rb +20 -0
- data/lib/nanoc/{cli → orig_cli}/commands/check.rb +3 -3
- data/lib/nanoc/{cli → orig_cli}/commands/deploy.rb +8 -8
- data/lib/nanoc/{cli → orig_cli}/commands/show-rules.rb +3 -3
- data/lib/nanoc/rule_dsl/action_provider.rb +5 -5
- data/lib/nanoc/rule_dsl/action_recorder.rb +4 -4
- data/lib/nanoc/rule_dsl/compilation_rule_context.rb +1 -1
- data/lib/nanoc/rule_dsl/compiler_dsl.rb +1 -1
- data/lib/nanoc/rule_dsl/rule_context.rb +6 -6
- data/lib/nanoc/version.rb +1 -1
- metadata +13 -152
- data/lib/nanoc/base/error.rb +0 -7
- data/lib/nanoc/base/feature.rb +0 -104
- data/lib/nanoc/base/repos.rb +0 -4
- data/lib/nanoc/base/repos/config_loader.rb +0 -95
- data/lib/nanoc/base/repos/site_loader.rb +0 -102
- data/lib/nanoc/base/services.rb +0 -23
- data/lib/nanoc/base/services/compiler.rb +0 -214
- data/lib/nanoc/base/services/compiler/phases.rb +0 -19
- data/lib/nanoc/base/services/compiler/phases/abstract.rb +0 -50
- data/lib/nanoc/base/services/compiler/phases/cache.rb +0 -45
- data/lib/nanoc/base/services/compiler/phases/mark_done.rb +0 -25
- data/lib/nanoc/base/services/compiler/phases/notify.rb +0 -21
- data/lib/nanoc/base/services/compiler/phases/recalculate.rb +0 -51
- data/lib/nanoc/base/services/compiler/phases/resume.rb +0 -54
- data/lib/nanoc/base/services/compiler/phases/write.rb +0 -86
- data/lib/nanoc/base/services/compiler/stages.rb +0 -23
- data/lib/nanoc/base/services/compiler/stages/build_reps.rb +0 -38
- data/lib/nanoc/base/services/compiler/stages/calculate_checksums.rb +0 -44
- data/lib/nanoc/base/services/compiler/stages/cleanup.rb +0 -45
- data/lib/nanoc/base/services/compiler/stages/compile_reps.rb +0 -98
- data/lib/nanoc/base/services/compiler/stages/determine_outdatedness.rb +0 -51
- data/lib/nanoc/base/services/compiler/stages/forget_outdated_dependencies.rb +0 -22
- data/lib/nanoc/base/services/compiler/stages/load_stores.rb +0 -37
- data/lib/nanoc/base/services/compiler/stages/postprocess.rb +0 -23
- data/lib/nanoc/base/services/compiler/stages/preprocess.rb +0 -34
- data/lib/nanoc/base/services/compiler/stages/prune.rb +0 -32
- data/lib/nanoc/base/services/compiler/stages/store_post_compilation_state.rb +0 -22
- data/lib/nanoc/base/services/compiler/stages/store_pre_compilation_state.rb +0 -34
- data/lib/nanoc/base/services/compiler_loader.rb +0 -48
- data/lib/nanoc/base/services/executor.rb +0 -134
- data/lib/nanoc/base/services/filter.rb +0 -267
- data/lib/nanoc/base/services/item_rep_builder.rb +0 -54
- data/lib/nanoc/base/services/item_rep_selector.rb +0 -69
- data/lib/nanoc/base/services/item_rep_writer.rb +0 -86
- data/lib/nanoc/base/services/outdatedness_checker.rb +0 -222
- data/lib/nanoc/base/services/outdatedness_rules.rb +0 -18
- data/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb +0 -41
- data/lib/nanoc/base/services/outdatedness_rules/code_snippets_modified.rb +0 -31
- data/lib/nanoc/base/services/outdatedness_rules/content_modified.rb +0 -21
- data/lib/nanoc/base/services/outdatedness_rules/item_collection_extended.rb +0 -20
- data/lib/nanoc/base/services/outdatedness_rules/layout_collection_extended.rb +0 -20
- data/lib/nanoc/base/services/outdatedness_rules/not_written.rb +0 -17
- data/lib/nanoc/base/services/outdatedness_rules/rules_modified.rb +0 -45
- data/lib/nanoc/base/services/outdatedness_rules/uses_always_outdated_filter.rb +0 -26
- data/lib/nanoc/base/services/pruner.rb +0 -123
- data/lib/nanoc/base/views.rb +0 -40
- data/lib/nanoc/base/views/basic_item_rep_collection_view.rb +0 -86
- data/lib/nanoc/base/views/basic_item_rep_view.rb +0 -81
- data/lib/nanoc/base/views/basic_item_view.rb +0 -52
- data/lib/nanoc/base/views/compilation_item_rep_collection_view.rb +0 -10
- data/lib/nanoc/base/views/compilation_item_rep_view.rb +0 -49
- data/lib/nanoc/base/views/compilation_item_view.rb +0 -45
- data/lib/nanoc/base/views/config_view.rb +0 -68
- data/lib/nanoc/base/views/identifiable_collection_view.rb +0 -109
- data/lib/nanoc/base/views/item_collection_with_reps_view.rb +0 -10
- data/lib/nanoc/base/views/item_collection_without_reps_view.rb +0 -10
- data/lib/nanoc/base/views/layout_collection_view.rb +0 -10
- data/lib/nanoc/base/views/layout_view.rb +0 -7
- data/lib/nanoc/base/views/mixins/document_view_mixin.rb +0 -88
- data/lib/nanoc/base/views/mixins/mutable_document_view_mixin.rb +0 -58
- data/lib/nanoc/base/views/mutable_config_view.rb +0 -14
- data/lib/nanoc/base/views/mutable_identifiable_collection_view.rb +0 -17
- data/lib/nanoc/base/views/mutable_item_collection_view.rb +0 -32
- data/lib/nanoc/base/views/mutable_item_view.rb +0 -7
- data/lib/nanoc/base/views/mutable_layout_collection_view.rb +0 -24
- data/lib/nanoc/base/views/mutable_layout_view.rb +0 -7
- data/lib/nanoc/base/views/post_compile_item_collection_view.rb +0 -10
- data/lib/nanoc/base/views/post_compile_item_rep_collection_view.rb +0 -10
- data/lib/nanoc/base/views/post_compile_item_rep_view.rb +0 -31
- data/lib/nanoc/base/views/post_compile_item_view.rb +0 -18
- data/lib/nanoc/base/views/view.rb +0 -41
- data/lib/nanoc/cli.rb +0 -241
- data/lib/nanoc/cli/ansi_string_colorizer.rb +0 -28
- data/lib/nanoc/cli/cleaning_stream.rb +0 -160
- data/lib/nanoc/cli/command_runner.rb +0 -72
- data/lib/nanoc/cli/commands/compile.rb +0 -57
- data/lib/nanoc/cli/commands/compile_listeners/abstract.rb +0 -58
- data/lib/nanoc/cli/commands/compile_listeners/aggregate.rb +0 -50
- data/lib/nanoc/cli/commands/compile_listeners/debug_printer.rb +0 -100
- data/lib/nanoc/cli/commands/compile_listeners/diff_generator.rb +0 -101
- data/lib/nanoc/cli/commands/compile_listeners/file_action_printer.rb +0 -76
- data/lib/nanoc/cli/commands/compile_listeners/timing_recorder.rb +0 -170
- data/lib/nanoc/cli/commands/create-site.rb +0 -257
- data/lib/nanoc/cli/commands/nanoc.rb +0 -42
- data/lib/nanoc/cli/commands/prune.rb +0 -49
- data/lib/nanoc/cli/commands/shell.rb +0 -57
- data/lib/nanoc/cli/commands/show-data.rb +0 -185
- data/lib/nanoc/cli/commands/show-plugins.rb +0 -89
- data/lib/nanoc/cli/commands/view.rb +0 -68
- data/lib/nanoc/cli/error_handler.rb +0 -365
- data/lib/nanoc/cli/logger.rb +0 -75
- data/lib/nanoc/cli/stack_trace_writer.rb +0 -50
- data/lib/nanoc/cli/stream_cleaners.rb +0 -10
- data/lib/nanoc/cli/stream_cleaners/abstract.rb +0 -21
- data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +0 -13
- data/lib/nanoc/cli/stream_cleaners/utf8.rb +0 -17
- data/lib/nanoc/cli/transform.rb +0 -16
- data/lib/nanoc/spec.rb +0 -240
data/lib/nanoc/base/repos.rb
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Nanoc
|
|
4
|
-
module Int
|
|
5
|
-
# @api private
|
|
6
|
-
class ConfigLoader
|
|
7
|
-
class NoConfigFileFoundError < ::Nanoc::Error
|
|
8
|
-
def initialize
|
|
9
|
-
super('No configuration file found')
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
class NoParentConfigFileFoundError < ::Nanoc::Error
|
|
14
|
-
def initialize(filename)
|
|
15
|
-
super("There is no parent configuration file at #{filename}")
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
class CyclicalConfigFileError < ::Nanoc::Error
|
|
20
|
-
def initialize(filename)
|
|
21
|
-
super("The parent configuration file at #{filename} includes one of its descendants")
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# @return [Boolean]
|
|
26
|
-
def self.cwd_is_nanoc_site?
|
|
27
|
-
!config_filename_for_cwd.nil?
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# @return [String]
|
|
31
|
-
def self.config_filename_for_cwd
|
|
32
|
-
filenames =
|
|
33
|
-
if Nanoc::Feature.enabled?(Nanoc::Feature::TOML)
|
|
34
|
-
%w[nanoc.yaml config.yaml nanoc.toml]
|
|
35
|
-
else
|
|
36
|
-
%w[nanoc.yaml config.yaml]
|
|
37
|
-
end
|
|
38
|
-
candidate = filenames.find { |f| File.file?(f) }
|
|
39
|
-
candidate && File.expand_path(candidate)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def new_from_cwd
|
|
43
|
-
# Determine path
|
|
44
|
-
filename = self.class.config_filename_for_cwd
|
|
45
|
-
raise NoConfigFileFoundError if filename.nil?
|
|
46
|
-
|
|
47
|
-
# Read
|
|
48
|
-
config =
|
|
49
|
-
apply_parent_config(
|
|
50
|
-
Nanoc::Core::Configuration.new(
|
|
51
|
-
hash: load_file(filename),
|
|
52
|
-
dir: File.dirname(filename),
|
|
53
|
-
),
|
|
54
|
-
[filename],
|
|
55
|
-
).with_defaults
|
|
56
|
-
|
|
57
|
-
# Load environment
|
|
58
|
-
config.with_environment
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def load_file(filename)
|
|
62
|
-
case File.extname(filename)
|
|
63
|
-
when '.yaml'
|
|
64
|
-
YAML.load_file(filename)
|
|
65
|
-
when '.toml'
|
|
66
|
-
Tomlrb.load_file(filename)
|
|
67
|
-
else
|
|
68
|
-
raise Nanoc::Int::Errors::InternalInconsistency, 'Unhandled config file extension'
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
# @api private
|
|
73
|
-
def apply_parent_config(config, processed_paths = [])
|
|
74
|
-
parent_path = config[:parent_config_file]
|
|
75
|
-
return config if parent_path.nil?
|
|
76
|
-
|
|
77
|
-
# Get absolute path
|
|
78
|
-
parent_path = File.absolute_path(parent_path, File.dirname(processed_paths.last))
|
|
79
|
-
unless File.file?(parent_path)
|
|
80
|
-
raise NoParentConfigFileFoundError.new(parent_path)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
# Check recursion
|
|
84
|
-
if processed_paths.include?(parent_path)
|
|
85
|
-
raise CyclicalConfigFileError.new(parent_path)
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
# Load
|
|
89
|
-
parent_config = Nanoc::Core::Configuration.new(hash: load_file(parent_path), dir: config.dir)
|
|
90
|
-
full_parent_config = apply_parent_config(parent_config, processed_paths + [parent_path])
|
|
91
|
-
full_parent_config.merge(config.without(:parent_config_file))
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Nanoc
|
|
4
|
-
module Int
|
|
5
|
-
class SiteLoader
|
|
6
|
-
def new_from_cwd
|
|
7
|
-
site_from_config(Nanoc::Int::ConfigLoader.new.new_from_cwd)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# @return [Boolean]
|
|
11
|
-
def self.cwd_is_nanoc_site?
|
|
12
|
-
Nanoc::Int::ConfigLoader.cwd_is_nanoc_site?
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def gen_data_source_for_config(config)
|
|
16
|
-
data_sources_to_aggregate =
|
|
17
|
-
with_data_sources(config) do |data_sources|
|
|
18
|
-
data_sources.map do |ds|
|
|
19
|
-
Nanoc::Core::PrefixedDataSource.new(ds, ds.items_root, ds.layouts_root)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
Nanoc::Core::AggregateDataSource.new(data_sources_to_aggregate, config)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
def site_from_config(config)
|
|
29
|
-
code_snippets = code_snippets_from_config(config)
|
|
30
|
-
code_snippets.each(&:load)
|
|
31
|
-
|
|
32
|
-
data_source = gen_data_source_for_config(config)
|
|
33
|
-
|
|
34
|
-
Nanoc::Core::Site.new(
|
|
35
|
-
config: config,
|
|
36
|
-
code_snippets: code_snippets,
|
|
37
|
-
data_source: data_source,
|
|
38
|
-
)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def with_data_sources(config, &_block)
|
|
42
|
-
data_sources = create_data_sources(config)
|
|
43
|
-
|
|
44
|
-
begin
|
|
45
|
-
data_sources.each(&:use)
|
|
46
|
-
yield(data_sources)
|
|
47
|
-
ensure
|
|
48
|
-
data_sources.each(&:unuse)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def create_data_sources(config)
|
|
53
|
-
config[:data_sources].map do |data_source_hash|
|
|
54
|
-
# Get data source class
|
|
55
|
-
data_source_class = Nanoc::DataSource.named(data_source_hash[:type].to_sym)
|
|
56
|
-
if data_source_class.nil?
|
|
57
|
-
raise Nanoc::Int::Errors::UnknownDataSource.new(data_source_hash[:type])
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
# Create data source
|
|
61
|
-
data_source_class.new(
|
|
62
|
-
config,
|
|
63
|
-
data_source_hash[:items_root],
|
|
64
|
-
data_source_hash[:layouts_root],
|
|
65
|
-
data_source_hash.merge(data_source_hash[:config] || {}),
|
|
66
|
-
)
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def code_snippets_from_config(config)
|
|
71
|
-
config[:lib_dirs].flat_map do |lib|
|
|
72
|
-
Dir["#{lib}/**/*.rb"].sort.map do |filename|
|
|
73
|
-
Nanoc::Core::CodeSnippet.new(
|
|
74
|
-
read_code_snippet_contents(filename),
|
|
75
|
-
filename,
|
|
76
|
-
)
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
ENCODING_REGEX = /\A#\s+(-\*-\s+)?(en)?coding: (?<encoding>[^\s]+)(\s+-\*-\s*)?\n{0,2}/.freeze
|
|
82
|
-
|
|
83
|
-
def encoding_from_magic_comment(raw)
|
|
84
|
-
match = ENCODING_REGEX.match(raw)
|
|
85
|
-
match ? match['encoding'] : nil
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def read_code_snippet_contents(filename)
|
|
89
|
-
raw = File.read(filename, encoding: 'ASCII-8BIT')
|
|
90
|
-
|
|
91
|
-
enc = encoding_from_magic_comment(raw)
|
|
92
|
-
if enc
|
|
93
|
-
raw = raw.force_encoding(enc).encode('UTF-8').sub(ENCODING_REGEX, '')
|
|
94
|
-
else
|
|
95
|
-
raw.force_encoding('UTF-8')
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
raw
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|
data/lib/nanoc/base/services.rb
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative 'services/compiler'
|
|
4
|
-
require_relative 'services/compiler_loader'
|
|
5
|
-
require_relative 'services/executor'
|
|
6
|
-
require_relative 'services/filter'
|
|
7
|
-
require_relative 'services/item_rep_builder'
|
|
8
|
-
require_relative 'services/item_rep_selector'
|
|
9
|
-
require_relative 'services/item_rep_writer'
|
|
10
|
-
require_relative 'services/pruner'
|
|
11
|
-
require_relative 'services/outdatedness_rules'
|
|
12
|
-
|
|
13
|
-
require_relative 'services/compiler/phases'
|
|
14
|
-
require_relative 'services/compiler/stages'
|
|
15
|
-
|
|
16
|
-
require_relative 'services/outdatedness_checker'
|
|
17
|
-
|
|
18
|
-
# TODO: Move this into the entity, once the load order is improved (i.e. the
|
|
19
|
-
# checksummer is loaded after CodeSnippet).
|
|
20
|
-
Nanoc::Core::Checksummer.define_behavior(
|
|
21
|
-
Nanoc::Core::CodeSnippet,
|
|
22
|
-
Nanoc::Core::Checksummer::DataUpdateBehavior,
|
|
23
|
-
)
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Nanoc
|
|
4
|
-
module Int
|
|
5
|
-
class Compiler
|
|
6
|
-
include Nanoc::Core::ContractsSupport
|
|
7
|
-
|
|
8
|
-
def initialize(site, compiled_content_cache:, checksum_store:, action_sequence_store:, action_provider:, dependency_store:, outdatedness_store:)
|
|
9
|
-
@site = site
|
|
10
|
-
|
|
11
|
-
# Needed because configuration is mutable :(
|
|
12
|
-
@output_dirs = @site.config.output_dirs
|
|
13
|
-
|
|
14
|
-
@compiled_content_cache = compiled_content_cache
|
|
15
|
-
@checksum_store = checksum_store
|
|
16
|
-
@action_sequence_store = action_sequence_store
|
|
17
|
-
@dependency_store = dependency_store
|
|
18
|
-
@action_provider = action_provider
|
|
19
|
-
@outdatedness_store = outdatedness_store
|
|
20
|
-
|
|
21
|
-
@compiled_content_store = Nanoc::Core::CompiledContentStore.new
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
contract Nanoc::Core::Site => C::Any
|
|
25
|
-
def self.compile(site)
|
|
26
|
-
new_for(site).run_until_end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
contract Nanoc::Core::Site => Nanoc::Int::Compiler
|
|
30
|
-
def self.new_for(site)
|
|
31
|
-
Nanoc::Int::CompilerLoader.new.load(site)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def run_until_preprocessed
|
|
35
|
-
@_res_preprocessed ||= begin
|
|
36
|
-
preprocess_stage.call
|
|
37
|
-
{}
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def run_until_reps_built
|
|
42
|
-
@_res_reps_built ||= begin
|
|
43
|
-
prev = run_until_preprocessed
|
|
44
|
-
|
|
45
|
-
res = build_reps_stage.call
|
|
46
|
-
|
|
47
|
-
prev.merge(
|
|
48
|
-
reps: res.fetch(:reps),
|
|
49
|
-
action_sequences: res.fetch(:action_sequences),
|
|
50
|
-
)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def run_until_precompiled
|
|
55
|
-
@_res_precompiled ||= begin
|
|
56
|
-
prev = run_until_reps_built
|
|
57
|
-
action_sequences = prev.fetch(:action_sequences)
|
|
58
|
-
reps = prev.fetch(:reps)
|
|
59
|
-
|
|
60
|
-
load_stores_stage.call
|
|
61
|
-
checksums = calculate_checksums_stage.call
|
|
62
|
-
outdatedness_checker = create_outdatedness_checker(
|
|
63
|
-
checksums: checksums,
|
|
64
|
-
action_sequences: action_sequences,
|
|
65
|
-
reps: reps,
|
|
66
|
-
)
|
|
67
|
-
outdated_items = determine_outdatedness_stage(outdatedness_checker, reps).call
|
|
68
|
-
|
|
69
|
-
prev.merge(
|
|
70
|
-
checksums: checksums,
|
|
71
|
-
dependency_store: @dependency_store,
|
|
72
|
-
outdatedness_checker: outdatedness_checker,
|
|
73
|
-
outdated_items: outdated_items,
|
|
74
|
-
)
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def run_until_end
|
|
79
|
-
res = run_until_precompiled
|
|
80
|
-
action_sequences = res.fetch(:action_sequences)
|
|
81
|
-
reps = res.fetch(:reps)
|
|
82
|
-
checksums = res.fetch(:checksums)
|
|
83
|
-
outdated_items = res.fetch(:outdated_items)
|
|
84
|
-
|
|
85
|
-
forget_outdated_dependencies_stage.call(outdated_items)
|
|
86
|
-
store_pre_compilation_state_stage(action_sequences, reps).call(checksums)
|
|
87
|
-
prune_stage(reps).call
|
|
88
|
-
compile_reps_stage(action_sequences, reps).call
|
|
89
|
-
store_post_compilation_state_stage.call
|
|
90
|
-
postprocess_stage.call(self)
|
|
91
|
-
ensure
|
|
92
|
-
cleanup_stage.call
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def compilation_context(reps:)
|
|
96
|
-
Nanoc::Core::CompilationContext.new(
|
|
97
|
-
action_provider: @action_provider,
|
|
98
|
-
reps: reps,
|
|
99
|
-
site: @site,
|
|
100
|
-
compiled_content_cache: @compiled_content_cache,
|
|
101
|
-
compiled_content_store: @compiled_content_store,
|
|
102
|
-
)
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
private
|
|
106
|
-
|
|
107
|
-
def create_outdatedness_checker(checksums:, action_sequences:, reps:)
|
|
108
|
-
Nanoc::Int::OutdatednessChecker.new(
|
|
109
|
-
site: @site,
|
|
110
|
-
checksum_store: @checksum_store,
|
|
111
|
-
dependency_store: @dependency_store,
|
|
112
|
-
action_sequence_store: @action_sequence_store,
|
|
113
|
-
action_sequences: action_sequences,
|
|
114
|
-
checksums: checksums,
|
|
115
|
-
reps: reps,
|
|
116
|
-
)
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
def preprocess_stage
|
|
120
|
-
@_preprocess_stage ||= Stages::Preprocess.new(
|
|
121
|
-
action_provider: @action_provider,
|
|
122
|
-
site: @site,
|
|
123
|
-
dependency_store: @dependency_store,
|
|
124
|
-
checksum_store: @checksum_store,
|
|
125
|
-
)
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
def build_reps_stage
|
|
129
|
-
@_build_reps_stage ||= Stages::BuildReps.new(
|
|
130
|
-
site: @site,
|
|
131
|
-
action_provider: @action_provider,
|
|
132
|
-
)
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
def prune_stage(reps)
|
|
136
|
-
@_prune_stage ||= Stages::Prune.new(
|
|
137
|
-
config: @site.config,
|
|
138
|
-
reps: reps,
|
|
139
|
-
)
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
def load_stores_stage
|
|
143
|
-
@_load_stores_stage ||= Stages::LoadStores.new(
|
|
144
|
-
checksum_store: @checksum_store,
|
|
145
|
-
compiled_content_cache: @compiled_content_cache,
|
|
146
|
-
dependency_store: @dependency_store,
|
|
147
|
-
action_sequence_store: @action_sequence_store,
|
|
148
|
-
outdatedness_store: @outdatedness_store,
|
|
149
|
-
)
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
def calculate_checksums_stage
|
|
153
|
-
@_calculate_checksums_stage ||= Stages::CalculateChecksums.new(
|
|
154
|
-
items: @site.items,
|
|
155
|
-
layouts: @site.layouts,
|
|
156
|
-
code_snippets: @site.code_snippets,
|
|
157
|
-
config: @site.config,
|
|
158
|
-
)
|
|
159
|
-
end
|
|
160
|
-
|
|
161
|
-
def determine_outdatedness_stage(outdatedness_checker, reps)
|
|
162
|
-
@_determine_outdatedness_stage ||= Stages::DetermineOutdatedness.new(
|
|
163
|
-
reps: reps,
|
|
164
|
-
outdatedness_checker: outdatedness_checker,
|
|
165
|
-
outdatedness_store: @outdatedness_store,
|
|
166
|
-
)
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
def store_pre_compilation_state_stage(action_sequences, reps)
|
|
170
|
-
@_store_pre_compilation_state_stage ||= Stages::StorePreCompilationState.new(
|
|
171
|
-
reps: reps,
|
|
172
|
-
layouts: @site.layouts,
|
|
173
|
-
checksum_store: @checksum_store,
|
|
174
|
-
action_sequence_store: @action_sequence_store,
|
|
175
|
-
action_sequences: action_sequences,
|
|
176
|
-
)
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
def compile_reps_stage(action_sequences, reps)
|
|
180
|
-
@_compile_reps_stage ||= Stages::CompileReps.new(
|
|
181
|
-
reps: reps,
|
|
182
|
-
outdatedness_store: @outdatedness_store,
|
|
183
|
-
dependency_store: @dependency_store,
|
|
184
|
-
action_sequences: action_sequences,
|
|
185
|
-
compilation_context: compilation_context(reps: reps),
|
|
186
|
-
compiled_content_cache: @compiled_content_cache,
|
|
187
|
-
)
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
def store_post_compilation_state_stage
|
|
191
|
-
@_store_post_compilation_state_stage ||= Stages::StorePostCompilationState.new(
|
|
192
|
-
dependency_store: @dependency_store,
|
|
193
|
-
)
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
def postprocess_stage
|
|
197
|
-
@_postprocess_stage ||= Stages::Postprocess.new(
|
|
198
|
-
action_provider: @action_provider,
|
|
199
|
-
site: @site,
|
|
200
|
-
)
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
def cleanup_stage
|
|
204
|
-
@_cleanup_stage ||= Stages::Cleanup.new(@output_dirs)
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
def forget_outdated_dependencies_stage
|
|
208
|
-
@_forget_outdated_dependencies_stage ||= Stages::ForgetOutdatedDependencies.new(
|
|
209
|
-
dependency_store: @dependency_store,
|
|
210
|
-
)
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
|
-
end
|
|
214
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Nanoc
|
|
4
|
-
module Int
|
|
5
|
-
class Compiler
|
|
6
|
-
module Phases
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
require_relative 'phases/abstract'
|
|
13
|
-
|
|
14
|
-
require_relative 'phases/recalculate'
|
|
15
|
-
require_relative 'phases/cache'
|
|
16
|
-
require_relative 'phases/resume'
|
|
17
|
-
require_relative 'phases/write'
|
|
18
|
-
require_relative 'phases/mark_done'
|
|
19
|
-
require_relative 'phases/notify'
|