nanoc 4.11.12 → 4.11.13
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4bdf2044fdcb57121b2bf93bd5bd3ec37a02ed08fab916285325b4223c87757
|
4
|
+
data.tar.gz: 81bc09561a285bd25d058c522b3339ec64eeb7b027b10c3869c9c6dafc4a1cab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b7284bf4a11dfe0a813abc9f5e75970d718fa23827649aa1eddf3d9c81d93a313b09b7d6ea41cf05e24b6bc53e87592bace2ddcc44dc3083ea475cfb97f19df
|
7
|
+
data.tar.gz: f6d8976bb5e212b802e54cb6d6690a06e10dbda60f7ca640da0311af224434f8536b97b9d0fff4ffe23db596ef6399af3d0d22d610c4f536bb909c225ef1ced0
|
data/NEWS.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Nanoc news
|
2
2
|
|
3
|
+
## 4.11.13 (2019-11-02)
|
4
|
+
|
5
|
+
Fixes:
|
6
|
+
|
7
|
+
* Fixed an issue which could cause Nanoc to freeze when generating the output diff on Windows
|
8
|
+
|
3
9
|
## 4.11.12 (2019-09-21)
|
4
10
|
|
5
11
|
Fixes:
|
@@ -1466,7 +1472,7 @@ Extensions:
|
|
1466
1472
|
* Removed bin/nanoc3 (use nanoc3 gem if you want it)
|
1467
1473
|
* Fixed wrong “no such snapshot” errors
|
1468
1474
|
* Made deployer default to rsync for backwards compatibility
|
1469
|
-
* Fixed missing Nanoc::
|
1475
|
+
* Fixed missing Nanoc::OrigCLI in deployment tasks
|
1470
1476
|
* Fixed “unrecognised kind” deployer error
|
1471
1477
|
|
1472
1478
|
## 3.3.1 (2012-02-18)
|
data/bin/nanoc
CHANGED
@@ -9,7 +9,7 @@ begin
|
|
9
9
|
rescue LoadError
|
10
10
|
end
|
11
11
|
|
12
|
-
require 'nanoc/
|
12
|
+
require 'nanoc/orig_cli'
|
13
13
|
|
14
14
|
if File.file?('Gemfile') && !defined?(Bundler)
|
15
15
|
warn 'A Gemfile was detected, but Bundler is not loaded. This is probably not what you want. To run Nanoc with Bundler, use `bundle exec nanoc`.'
|
data/lib/nanoc.rb
CHANGED
@@ -8,38 +8,14 @@ require 'json'
|
|
8
8
|
require 'parallel'
|
9
9
|
|
10
10
|
module Nanoc
|
11
|
-
# @return [String] A string containing information about this Nanoc version
|
12
|
-
# and its environment (Ruby engine and version, Rubygems version if any).
|
13
|
-
#
|
14
|
-
# @api private
|
15
|
-
def self.version_information
|
16
|
-
"Nanoc #{Nanoc::VERSION} © 2007–2019 Denis Defreyne.\n" \
|
17
|
-
"Running #{RUBY_ENGINE} #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) on #{RUBY_PLATFORM} with RubyGems #{Gem::VERSION}.\n"
|
18
|
-
end
|
19
|
-
|
20
|
-
# @return [Boolean] True if the current platform is Windows, false otherwise.
|
21
|
-
#
|
22
|
-
# @api private
|
23
|
-
def self.on_windows?
|
24
|
-
@_on_windows ||= TTY::Platform.new.windows?
|
25
|
-
end
|
26
|
-
|
27
|
-
# Similar to `nil` except that it can only be compared against using
|
28
|
-
# `UNDEFINED.equal?(x)`. Used in places where `nil` already has meaning, and
|
29
|
-
# thus cannot be used to mean the presence of nothing.
|
30
|
-
UNDEFINED = Object.new
|
31
11
|
end
|
32
12
|
|
33
13
|
# Load general requirements
|
34
14
|
require 'base64'
|
35
15
|
require 'cgi'
|
36
|
-
require 'diff/lcs'
|
37
|
-
require 'diff/lcs/hunk'
|
38
16
|
require 'digest'
|
39
17
|
require 'English'
|
40
|
-
require 'fiber'
|
41
18
|
require 'fileutils'
|
42
|
-
require 'find'
|
43
19
|
require 'forwardable'
|
44
20
|
require 'logger'
|
45
21
|
require 'net/http'
|
@@ -52,12 +28,9 @@ require 'stringio'
|
|
52
28
|
require 'tempfile'
|
53
29
|
require 'time'
|
54
30
|
require 'timeout'
|
55
|
-
require 'tomlrb'
|
56
31
|
require 'tmpdir'
|
57
|
-
require 'tty-platform'
|
58
32
|
require 'tty-which'
|
59
33
|
require 'uri'
|
60
|
-
require 'yaml'
|
61
34
|
|
62
35
|
# Load extracted Nanoc dependencies
|
63
36
|
require 'nanoc-core'
|
@@ -65,6 +38,8 @@ require 'nanoc-core'
|
|
65
38
|
# Re-export from Nanoc::Core
|
66
39
|
Nanoc::Identifier = Nanoc::Core::Identifier
|
67
40
|
Nanoc::DataSource = Nanoc::Core::DataSource
|
41
|
+
Nanoc::Filter = Nanoc::Core::Filter
|
42
|
+
Nanoc::Error = Nanoc::Core::Error
|
68
43
|
|
69
44
|
# Load Nanoc
|
70
45
|
require 'nanoc/version'
|
data/lib/nanoc/base.rb
CHANGED
@@ -4,13 +4,10 @@
|
|
4
4
|
module Nanoc
|
5
5
|
module Int
|
6
6
|
end
|
7
|
+
|
8
|
+
module Base
|
9
|
+
end
|
7
10
|
end
|
8
11
|
|
9
|
-
require_relative 'base/error'
|
10
12
|
require_relative 'base/errors'
|
11
13
|
require_relative 'base/changes_stream'
|
12
|
-
|
13
|
-
require_relative 'base/feature'
|
14
|
-
require_relative 'base/repos'
|
15
|
-
require_relative 'base/services'
|
16
|
-
require_relative 'base/views'
|
data/lib/nanoc/base/errors.rb
CHANGED
@@ -6,51 +6,15 @@ module Nanoc
|
|
6
6
|
#
|
7
7
|
# @api private
|
8
8
|
module Errors
|
9
|
-
Generic = ::Nanoc::Error
|
9
|
+
Generic = ::Nanoc::Core::Error
|
10
10
|
|
11
|
-
UnmetDependency = ::Nanoc::Core::Errors::UnmetDependency
|
12
11
|
NoSuchSnapshot = ::Nanoc::Core::Errors::NoSuchSnapshot
|
13
12
|
CannotGetCompiledContentOfBinaryItem = ::Nanoc::Core::Errors::CannotGetCompiledContentOfBinaryItem
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
# Error that is raised when compilation of an item rep fails. The
|
21
|
-
# underlying error is available by calling `#unwrap`.
|
22
|
-
class CompilationError < Generic
|
23
|
-
attr_reader :item_rep
|
24
|
-
|
25
|
-
def initialize(wrapped, item_rep)
|
26
|
-
@wrapped = wrapped
|
27
|
-
@item_rep = item_rep
|
28
|
-
end
|
29
|
-
|
30
|
-
def unwrap
|
31
|
-
@wrapped
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# Error that is raised when a site is loaded that uses a data source with
|
36
|
-
# an unknown identifier.
|
37
|
-
class UnknownDataSource < Generic
|
38
|
-
# @param [String] data_source_name The data source name for which no
|
39
|
-
# data source could be found
|
40
|
-
def initialize(data_source_name)
|
41
|
-
super("The data source specified in the site’s configuration file, “#{data_source_name}”, does not exist.")
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
# Error that is raised during site compilation when an item uses a layout
|
46
|
-
# that is not present in the site.
|
47
|
-
class UnknownLayout < Generic
|
48
|
-
# @param [String] layout_identifier The layout identifier for which no
|
49
|
-
# layout could be found
|
50
|
-
def initialize(layout_identifier)
|
51
|
-
super("The site does not have a layout with identifier “#{layout_identifier}”.")
|
52
|
-
end
|
53
|
-
end
|
13
|
+
CannotGetParentOrChildrenOfNonLegacyItem = ::Nanoc::Core::Errors::CannotGetParentOrChildrenOfNonLegacyItem
|
14
|
+
CannotLayoutBinaryItem = ::Nanoc::Core::Errors::CannotLayoutBinaryItem
|
15
|
+
UnknownLayout = ::Nanoc::Core::Errors::UnknownLayout
|
16
|
+
CannotUseBinaryFilter = ::Nanoc::Core::Errors::CannotUseBinaryFilter
|
17
|
+
CannotUseTextualFilter = ::Nanoc::Core::Errors::CannotUseTextualFilter
|
54
18
|
|
55
19
|
# Error that is raised during site compilation when a layout is compiled
|
56
20
|
# for which the filter cannot be determined. This is similar to the
|
@@ -63,25 +27,6 @@ module Nanoc
|
|
63
27
|
end
|
64
28
|
end
|
65
29
|
|
66
|
-
# Error that is raised during site compilation when an item (directly or
|
67
|
-
# indirectly) includes its own item content, leading to endless recursion.
|
68
|
-
class DependencyCycle < Generic
|
69
|
-
def initialize(stack)
|
70
|
-
start_idx = stack.index(stack.last)
|
71
|
-
cycle = stack[start_idx..-2]
|
72
|
-
|
73
|
-
msg_bits = []
|
74
|
-
msg_bits << 'The site cannot be compiled because there is a dependency cycle:'
|
75
|
-
msg_bits << ''
|
76
|
-
cycle.each.with_index do |r, i|
|
77
|
-
msg_bits << " (#{i + 1}) item #{r.item.identifier}, rep #{r.name.inspect}, uses compiled content of"
|
78
|
-
end
|
79
|
-
msg_bits << msg_bits.pop + ' (1)'
|
80
|
-
|
81
|
-
super(msg_bits.map { |x| x + "\n" }.join(''))
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
30
|
# Error that is raised when no rules file can be found in the current
|
86
31
|
# working directory.
|
87
32
|
class NoRulesFileFound < Generic
|
@@ -110,54 +55,11 @@ module Nanoc
|
|
110
55
|
end
|
111
56
|
end
|
112
57
|
|
113
|
-
# Error that is raised when a binary item is attempted to be laid out.
|
114
|
-
class CannotLayoutBinaryItem < Generic
|
115
|
-
# @param [Nanoc::Core::ItemRep] rep The item representation that was attempted
|
116
|
-
# to be laid out
|
117
|
-
def initialize(rep)
|
118
|
-
super("The “#{rep.item.identifier}” item (rep “#{rep.name}”) cannot be laid out because it is a binary item. If you are getting this error for an item that should be textual instead of binary, make sure that its extension is included in the text_extensions array in the site configuration.")
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
# Error that is raised when a textual filter is attempted to be applied to
|
123
|
-
# a binary item representation.
|
124
|
-
class CannotUseTextualFilter < Generic
|
125
|
-
# @param [Nanoc::Core::ItemRep] rep The item representation that was
|
126
|
-
# attempted to be filtered
|
127
|
-
#
|
128
|
-
# @param [Class] filter_class The filter class that was used
|
129
|
-
def initialize(rep, filter_class)
|
130
|
-
super("The “#{filter_class.inspect}” filter cannot be used to filter the “#{rep.item.identifier}” item (rep “#{rep.name}”), because textual filters cannot be used on binary items.")
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
# Error that is raised when a binary filter is attempted to be applied to
|
135
|
-
# a textual item representation.
|
136
|
-
class CannotUseBinaryFilter < Generic
|
137
|
-
# @param [Nanoc::Core::ItemRep] rep The item representation that was
|
138
|
-
# attempted to be filtered
|
139
|
-
#
|
140
|
-
# @param [Class] filter_class The filter class that was used
|
141
|
-
def initialize(rep, filter_class)
|
142
|
-
super("The “#{filter_class.inspect}” filter cannot be used to filter the “#{rep.item.identifier}” item (rep “#{rep.name}”), because binary filters cannot be used on textual items. If you are getting this error for an item that should be textual instead of binary, make sure that its extension is included in the text_extensions array in the site configuration.")
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
# Error that is raised when attempting to call #parent or #children on an item with a legacy identifier.
|
147
|
-
class CannotGetParentOrChildrenOfNonLegacyItem < Generic
|
148
|
-
def initialize(identifier)
|
149
|
-
super("You cannot get the parent or children of an item that has a “full” identifier (#{identifier}). Getting the parent or children of an item is only possible for items that have a legacy identifier.")
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
58
|
class AmbiguousMetadataAssociation < Generic
|
154
59
|
def initialize(content_filenames, meta_filename)
|
155
60
|
super("There are multiple content files (#{content_filenames.sort.join(', ')}) that could match the file containing metadata (#{meta_filename}).")
|
156
61
|
end
|
157
62
|
end
|
158
|
-
|
159
|
-
class InternalInconsistency < Generic
|
160
|
-
end
|
161
63
|
end
|
162
64
|
end
|
163
65
|
end
|
data/lib/nanoc/checking/check.rb
CHANGED
@@ -32,7 +32,7 @@ module Nanoc::Checking
|
|
32
32
|
output_filenames = Dir[output_dir + '/**/*'].select { |f| File.file?(f) }
|
33
33
|
|
34
34
|
# FIXME: ugly
|
35
|
-
compiler = Nanoc::
|
35
|
+
compiler = Nanoc::Core::Compiler.new_for(site)
|
36
36
|
res = compiler.run_until_reps_built
|
37
37
|
reps = res.fetch(:reps)
|
38
38
|
view_context =
|
@@ -42,9 +42,9 @@ module Nanoc::Checking
|
|
42
42
|
)
|
43
43
|
|
44
44
|
context = {
|
45
|
-
items: Nanoc::PostCompileItemCollectionView.new(site.items, view_context),
|
46
|
-
layouts: Nanoc::LayoutCollectionView.new(site.layouts, view_context),
|
47
|
-
config: Nanoc::ConfigView.new(site.config, view_context),
|
45
|
+
items: Nanoc::Core::PostCompileItemCollectionView.new(site.items, view_context),
|
46
|
+
layouts: Nanoc::Core::LayoutCollectionView.new(site.layouts, view_context),
|
47
|
+
config: Nanoc::Core::ConfigView.new(site.config, view_context),
|
48
48
|
output_filenames: output_filenames,
|
49
49
|
}
|
50
50
|
|
@@ -91,7 +91,7 @@ module ::Nanoc::Checking::Checks
|
|
91
91
|
if last_err
|
92
92
|
return Result.new(href, last_err.message)
|
93
93
|
else
|
94
|
-
raise Nanoc::
|
94
|
+
raise Nanoc::Core::Errors::InternalInconsistency, 'last_err cannot be nil'
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -35,7 +35,7 @@ module Nanoc::Checking::Checks
|
|
35
35
|
exclude_config = @config.fetch(:prune, {}).fetch(:exclude, [])
|
36
36
|
# FIXME: specifying reps this way is icky
|
37
37
|
reps = Nanoc::Core::ItemRepRepo.new
|
38
|
-
@pruner ||= Nanoc::Pruner.new(@config._unwrap, reps, exclude: exclude_config)
|
38
|
+
@pruner ||= Nanoc::Core::Pruner.new(@config._unwrap, reps, exclude: exclude_config)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -80,7 +80,7 @@ module Nanoc::Checking
|
|
80
80
|
names.map do |name|
|
81
81
|
name = name.to_s.tr('-', '_').to_sym
|
82
82
|
klass = Nanoc::Checking::Check.named(name)
|
83
|
-
raise Nanoc::
|
83
|
+
raise Nanoc::Core::TrivialError, "Unknown check: #{name}" if klass.nil?
|
84
84
|
|
85
85
|
klass
|
86
86
|
end
|
@@ -90,7 +90,7 @@ module Nanoc::Checking
|
|
90
90
|
return [] if classes.empty?
|
91
91
|
|
92
92
|
# TODO: remove me
|
93
|
-
Nanoc::
|
93
|
+
Nanoc::Core::Compiler.new_for(@site).run_until_reps_built
|
94
94
|
|
95
95
|
checks = []
|
96
96
|
issues = Set.new
|
@@ -6,7 +6,7 @@ class Nanoc::DataSources::Filesystem < Nanoc::DataSource
|
|
6
6
|
# @api private
|
7
7
|
module Tools
|
8
8
|
# Error that is raised when too many symlink indirections are encountered.
|
9
|
-
class MaxSymlinkDepthExceededError < ::Nanoc::
|
9
|
+
class MaxSymlinkDepthExceededError < ::Nanoc::Core::TrivialError
|
10
10
|
# @return [String] The last filename that was attempted to be
|
11
11
|
# resolved before giving up
|
12
12
|
attr_reader :filename
|
@@ -21,7 +21,7 @@ class Nanoc::DataSources::Filesystem < Nanoc::DataSource
|
|
21
21
|
|
22
22
|
# Error that is raised when a file of an unknown type is encountered
|
23
23
|
# (something other than file, directory or link).
|
24
|
-
class UnsupportedFileTypeError < ::Nanoc::
|
24
|
+
class UnsupportedFileTypeError < ::Nanoc::Core::TrivialError
|
25
25
|
# @return [String] The filename of the file whose type is not supported
|
26
26
|
attr_reader :filename
|
27
27
|
|
@@ -93,7 +93,7 @@ class Nanoc::DataSources::Filesystem < Nanoc::DataSource
|
|
93
93
|
#
|
94
94
|
# @return [Array<String>] A list of files and directories
|
95
95
|
#
|
96
|
-
# @raise [
|
96
|
+
# @raise [Nanoc::Core::TrivialError] when pattern can not be handled
|
97
97
|
def all_files_and_dirs_in(dir_name, extra_files)
|
98
98
|
base_patterns = ["#{dir_name}/**/*"]
|
99
99
|
|
@@ -107,7 +107,7 @@ class Nanoc::DataSources::Filesystem < Nanoc::DataSource
|
|
107
107
|
extra_files.map { |extra_file| "#{dir_name}/#{extra_file}" }
|
108
108
|
else
|
109
109
|
raise(
|
110
|
-
Nanoc::
|
110
|
+
Nanoc::Core::TrivialError,
|
111
111
|
"Do not know how to handle extra_files: #{extra_files.inspect}",
|
112
112
|
)
|
113
113
|
end
|
data/lib/nanoc/extra.rb
CHANGED
@@ -83,28 +83,28 @@ module Nanoc::Helpers
|
|
83
83
|
|
84
84
|
def validate_config
|
85
85
|
if @config[:base_url].nil?
|
86
|
-
raise Nanoc::
|
86
|
+
raise Nanoc::Core::TrivialError.new('Cannot build Atom feed: site configuration has no base_url')
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
90
|
def validate_feed_item
|
91
91
|
if title.nil?
|
92
|
-
raise Nanoc::
|
92
|
+
raise Nanoc::Core::TrivialError.new('Cannot build Atom feed: no title in params, item or site config')
|
93
93
|
end
|
94
94
|
if author_name.nil?
|
95
|
-
raise Nanoc::
|
95
|
+
raise Nanoc::Core::TrivialError.new('Cannot build Atom feed: no author_name in params, item or site config')
|
96
96
|
end
|
97
97
|
if author_uri.nil?
|
98
|
-
raise Nanoc::
|
98
|
+
raise Nanoc::Core::TrivialError.new('Cannot build Atom feed: no author_uri in params, item or site config')
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
102
|
def validate_articles
|
103
103
|
if relevant_articles.empty?
|
104
|
-
raise Nanoc::
|
104
|
+
raise Nanoc::Core::TrivialError.new('Cannot build Atom feed: no articles')
|
105
105
|
end
|
106
106
|
if relevant_articles.any? { |a| a[:created_at].nil? }
|
107
|
-
raise Nanoc::
|
107
|
+
raise Nanoc::Core::TrivialError.new('Cannot build Atom feed: one or more articles lack created_at')
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
@@ -218,7 +218,7 @@ module Nanoc::Helpers
|
|
218
218
|
def url_for(item)
|
219
219
|
# Check attributes
|
220
220
|
if @config[:base_url].nil?
|
221
|
-
raise Nanoc::
|
221
|
+
raise Nanoc::Core::TrivialError.new('Cannot build Atom feed: site configuration has no base_url')
|
222
222
|
end
|
223
223
|
|
224
224
|
# Build URL
|
@@ -235,7 +235,7 @@ module Nanoc::Helpers
|
|
235
235
|
def feed_url
|
236
236
|
# Check attributes
|
237
237
|
if @config[:base_url].nil?
|
238
|
-
raise Nanoc::
|
238
|
+
raise Nanoc::Core::TrivialError.new('Cannot build Atom feed: site configuration has no base_url')
|
239
239
|
end
|
240
240
|
|
241
241
|
@item[:feed_url] || @config[:base_url] + @item.path
|
@@ -17,7 +17,7 @@ module Nanoc::Helpers
|
|
17
17
|
case target
|
18
18
|
when String
|
19
19
|
target
|
20
|
-
when Nanoc::CompilationItemView, Nanoc::BasicItemView, Nanoc::BasicItemRepView
|
20
|
+
when Nanoc::Core::CompilationItemView, Nanoc::Core::BasicItemView, Nanoc::Core::BasicItemRepView
|
21
21
|
raise "Cannot create a link to #{target.inspect} because this target is not outputted (its routing rule returns nil)" if target.path.nil?
|
22
22
|
|
23
23
|
target.path
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'nanoc-cli'
|
4
|
+
|
5
|
+
# @api private
|
6
|
+
module Nanoc::OrigCLI
|
7
|
+
module Commands
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Nanoc::CLI.after_setup do
|
12
|
+
root = File.dirname(__FILE__)
|
13
|
+
commands_path = File.join(root, 'orig_cli', 'commands')
|
14
|
+
Nanoc::CLI.add_command(Cri::Command.load_file(File.join(commands_path, 'check.rb'), infer_name: true))
|
15
|
+
Nanoc::CLI.add_command(Cri::Command.load_file(File.join(commands_path, 'deploy.rb'), infer_name: true))
|
16
|
+
Nanoc::CLI.add_command(Cri::Command.load_file(File.join(commands_path, 'show-rules.rb'), infer_name: true))
|
17
|
+
|
18
|
+
# TODO: move into nanoc-deploying, once that exists as a package
|
19
|
+
Nanoc::CLI::Commands::ShowPlugins.add_plugin_class(Nanoc::Deploying::Deployer, 'Deployers')
|
20
|
+
end
|