nanoc 4.3.7 → 4.3.8
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/Appraisals +11 -0
- data/Gemfile +6 -6
- data/Gemfile.lock +32 -18
- data/NEWS.md +14 -0
- data/Rakefile +30 -1
- data/lib/nanoc.rb +3 -0
- data/lib/nanoc/base/checksummer.rb +28 -0
- data/lib/nanoc/base/compilation/compiler.rb +34 -20
- data/lib/nanoc/base/compilation/filter.rb +1 -1
- data/lib/nanoc/base/context.rb +5 -0
- data/lib/nanoc/base/entities/item_rep.rb +2 -13
- data/lib/nanoc/base/services.rb +1 -0
- data/lib/nanoc/base/services/compiler_loader.rb +2 -2
- data/lib/nanoc/{extra → base/services}/pruner.rb +56 -48
- data/lib/nanoc/checking.rb +11 -0
- data/lib/nanoc/{extra/checking → checking}/check.rb +3 -3
- data/lib/nanoc/checking/checks.rb +20 -0
- data/lib/nanoc/{extra/checking → checking}/checks/css.rb +2 -2
- data/lib/nanoc/{extra/checking → checking}/checks/external_links.rb +2 -2
- data/lib/nanoc/{extra/checking → checking}/checks/html.rb +2 -2
- data/lib/nanoc/{extra/checking → checking}/checks/internal_links.rb +2 -2
- data/lib/nanoc/{extra/checking → checking}/checks/mixed_content.rb +2 -2
- data/lib/nanoc/{extra/checking → checking}/checks/stale.rb +4 -3
- data/lib/nanoc/{extra/checking → checking}/checks/w3c_validator.rb +2 -2
- data/lib/nanoc/{extra/checking → checking}/dsl.rb +2 -2
- data/lib/nanoc/{extra/checking → checking}/issue.rb +1 -1
- data/lib/nanoc/{extra/checking → checking}/runner.rb +4 -4
- data/lib/nanoc/cli/cleaning_stream.rb +1 -1
- data/lib/nanoc/cli/commands/check.rb +1 -1
- data/lib/nanoc/cli/commands/compile.rb +62 -56
- data/lib/nanoc/cli/commands/deploy.rb +4 -4
- data/lib/nanoc/cli/commands/prune.rb +2 -2
- data/lib/nanoc/cli/commands/show-plugins.rb +4 -4
- data/lib/nanoc/data_sources/filesystem.rb +3 -1
- data/lib/nanoc/{extra/filesystem_tools.rb → data_sources/filesystem/tools.rb} +20 -15
- data/lib/nanoc/deploying.rb +8 -0
- data/lib/nanoc/{extra → deploying}/deployer.rb +2 -2
- data/lib/nanoc/deploying/deployers.rb +10 -0
- data/lib/nanoc/{extra → deploying}/deployers/fog.rb +3 -3
- data/lib/nanoc/{extra → deploying}/deployers/rsync.rb +3 -3
- data/lib/nanoc/extra.rb +9 -5
- data/lib/nanoc/filters/colorize_syntax.rb +15 -4
- data/lib/nanoc/filters/rdoc.rb +0 -5
- data/lib/nanoc/helpers/capturing.rb +2 -1
- data/lib/nanoc/rule_dsl/recording_executor.rb +7 -1
- data/lib/nanoc/spec.rb +10 -34
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.gemspec +2 -1
- data/test/base/test_context.rb +6 -0
- data/test/base/test_dependency_tracker.rb +0 -18
- data/test/base/test_item_rep.rb +2 -2
- data/test/{extra/checking → checking}/checks/test_css.rb +4 -4
- data/test/{extra/checking → checking}/checks/test_external_links.rb +8 -8
- data/test/{extra/checking → checking}/checks/test_html.rb +3 -3
- data/test/{extra/checking → checking}/checks/test_internal_links.rb +9 -9
- data/test/{extra/checking → checking}/checks/test_mixed_content.rb +9 -9
- data/test/{extra/checking → checking}/checks/test_stale.rb +3 -3
- data/test/{extra/checking → checking}/test_check.rb +4 -4
- data/test/{extra/checking → checking}/test_dsl.rb +5 -5
- data/test/{extra/checking → checking}/test_runner.rb +4 -4
- data/test/data_sources/test_filesystem.rb +0 -18
- data/test/{extra → data_sources}/test_filesystem_tools.rb +13 -13
- data/test/{extra/deployers → deploying}/test_fog.rb +8 -8
- data/test/{extra/deployers → deploying}/test_rsync.rb +7 -7
- data/test/filters/{test_colorize_syntax.rb → colorize_syntax/test_coderay.rb} +1 -177
- data/test/filters/colorize_syntax/test_common.rb +81 -0
- data/test/filters/colorize_syntax/test_pygmentize.rb +35 -0
- data/test/filters/colorize_syntax/test_pygments.rb +17 -0
- data/test/filters/colorize_syntax/test_simon.rb +20 -0
- data/test/filters/test_less.rb +0 -55
- metadata +55 -43
- data/ChangeLog +0 -3
- data/doc/yardoc_handlers/identifier.rb +0 -30
- data/doc/yardoc_templates/default/layout/html/footer.erb +0 -19
- data/lib/nanoc/extra/checking.rb +0 -11
- data/lib/nanoc/extra/checking/checks.rb +0 -20
- data/lib/nanoc/extra/deployers.rb +0 -10
- data/tasks/doc.rake +0 -16
- data/tasks/rubocop.rake +0 -6
- data/tasks/test.rake +0 -25
- data/test/base/temp_filename_factory_spec.rb +0 -66
|
@@ -27,7 +27,7 @@ module Nanoc::CLI::Commands
|
|
|
27
27
|
private
|
|
28
28
|
|
|
29
29
|
def list_deployers
|
|
30
|
-
deployers = Nanoc::Int::PluginRegistry.instance.find_all(Nanoc::
|
|
30
|
+
deployers = Nanoc::Int::PluginRegistry.instance.find_all(Nanoc::Deploying::Deployer)
|
|
31
31
|
deployer_names = deployers.keys.sort_by(&:to_s)
|
|
32
32
|
puts 'Available deployers:'
|
|
33
33
|
deployer_names.each do |name|
|
|
@@ -85,7 +85,7 @@ module Nanoc::CLI::Commands
|
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def check
|
|
88
|
-
runner = Nanoc::
|
|
88
|
+
runner = Nanoc::Checking::Runner.new(site)
|
|
89
89
|
if runner.dsl_present?
|
|
90
90
|
puts 'Running issue checks…'
|
|
91
91
|
is_success = runner.run_for_deploy
|
|
@@ -105,13 +105,13 @@ module Nanoc::CLI::Commands
|
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
def deployer_class_for_config(config)
|
|
108
|
-
names = Nanoc::
|
|
108
|
+
names = Nanoc::Deploying::Deployer.all.keys
|
|
109
109
|
name = config.fetch(:kind) do
|
|
110
110
|
$stderr.puts 'Warning: The specified deploy target does not have a kind attribute. Assuming rsync.'
|
|
111
111
|
'rsync'
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
deployer_class = Nanoc::
|
|
114
|
+
deployer_class = Nanoc::Deploying::Deployer.named(name)
|
|
115
115
|
if deployer_class.nil?
|
|
116
116
|
raise Nanoc::Int::Errors::GenericTrivial, "The specified deploy target has an unrecognised kind “#{name}” (expected one of #{names.join(', ')})."
|
|
117
117
|
end
|
|
@@ -19,9 +19,9 @@ module Nanoc::CLI::Commands
|
|
|
19
19
|
site.compiler.build_reps
|
|
20
20
|
|
|
21
21
|
if options.key?(:yes)
|
|
22
|
-
Nanoc::
|
|
22
|
+
Nanoc::Pruner.new(site.config, site.compiler.reps, exclude: prune_config_exclude).run
|
|
23
23
|
elsif options.key?(:'dry-run')
|
|
24
|
-
Nanoc::
|
|
24
|
+
Nanoc::Pruner.new(site.config, site.compiler.reps, exclude: prune_config_exclude, dry_run: true).run
|
|
25
25
|
else
|
|
26
26
|
$stderr.puts 'WARNING: Since the prune command is a destructive command, it requires an additional --yes flag in order to work.'
|
|
27
27
|
$stderr.puts
|
|
@@ -72,14 +72,14 @@ module Nanoc::CLI::Commands
|
|
|
72
72
|
PLUGIN_CLASS_ORDER = [
|
|
73
73
|
Nanoc::Filter,
|
|
74
74
|
Nanoc::DataSource,
|
|
75
|
-
Nanoc::
|
|
76
|
-
].freeze
|
|
75
|
+
Nanoc::Deploying::Deployer,
|
|
76
|
+
].freeze
|
|
77
77
|
|
|
78
78
|
PLUGIN_CLASSES = {
|
|
79
79
|
Nanoc::Filter => 'Filters',
|
|
80
80
|
Nanoc::DataSource => 'Data Sources',
|
|
81
|
-
Nanoc::
|
|
82
|
-
}.freeze
|
|
81
|
+
Nanoc::Deploying::Deployer => 'Deployers',
|
|
82
|
+
}.freeze
|
|
83
83
|
|
|
84
84
|
def name_for_plugin_class(klass)
|
|
85
85
|
PLUGIN_CLASSES[klass]
|
|
@@ -252,7 +252,7 @@ module Nanoc::DataSources
|
|
|
252
252
|
|
|
253
253
|
# Returns all files in the given directory and directories below it.
|
|
254
254
|
def all_files_in(dir_name)
|
|
255
|
-
Nanoc::
|
|
255
|
+
Nanoc::DataSources::Filesystem::Tools.all_files_in(dir_name, config[:extra_files])
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
# Returns the filename for the given base filename and the extension.
|
|
@@ -435,3 +435,5 @@ module Nanoc::DataSources
|
|
|
435
435
|
end
|
|
436
436
|
end
|
|
437
437
|
end
|
|
438
|
+
|
|
439
|
+
require_relative 'filesystem/tools'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
class Nanoc::DataSources::Filesystem < Nanoc::DataSource
|
|
2
2
|
# Contains useful functions for managing the filesystem.
|
|
3
3
|
#
|
|
4
4
|
# @api private
|
|
5
|
-
module
|
|
5
|
+
module Tools
|
|
6
6
|
# Error that is raised when too many symlink indirections are encountered.
|
|
7
7
|
class MaxSymlinkDepthExceededError < ::Nanoc::Int::Errors::GenericTrivial
|
|
8
8
|
# @return [String] The last filename that was attempted to be
|
|
@@ -92,19 +92,24 @@ module Nanoc::Extra
|
|
|
92
92
|
#
|
|
93
93
|
# @raise [GenericTrivial] when pattern can not be handled
|
|
94
94
|
def all_files_and_dirs_in(dir_name, extra_files)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
95
|
+
base_patterns = ["#{dir_name}/**/*"]
|
|
96
|
+
|
|
97
|
+
extra_patterns =
|
|
98
|
+
case extra_files
|
|
99
|
+
when nil
|
|
100
|
+
[]
|
|
101
|
+
when String
|
|
102
|
+
["#{dir_name}/#{extra_files}"]
|
|
103
|
+
when Array
|
|
104
|
+
extra_files.map { |extra_file| "#{dir_name}/#{extra_file}" }
|
|
105
|
+
else
|
|
106
|
+
raise(
|
|
107
|
+
Nanoc::Int::Errors::GenericTrivial,
|
|
108
|
+
"Do not know how to handle extra_files: #{extra_files.inspect}",
|
|
109
|
+
)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
patterns = base_patterns + extra_patterns
|
|
108
113
|
Dir.glob(patterns)
|
|
109
114
|
end
|
|
110
115
|
module_function :all_files_and_dirs_in
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module Nanoc::
|
|
1
|
+
module Nanoc::Deploying
|
|
2
2
|
# Represents a deployer, an object that allows uploading the compiled site
|
|
3
3
|
# to a specific (remote) location.
|
|
4
4
|
#
|
|
@@ -37,7 +37,7 @@ module Nanoc::Extra
|
|
|
37
37
|
#
|
|
38
38
|
# @abstract
|
|
39
39
|
def run
|
|
40
|
-
raise NotImplementedError.new('Nanoc::
|
|
40
|
+
raise NotImplementedError.new('Nanoc::Deploying::Deployer subclasses must implement #run')
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module Nanoc::Deploying
|
|
2
|
+
# @api private
|
|
3
|
+
module Deployers
|
|
4
|
+
autoload 'Fog', 'nanoc/deploying/deployers/fog'
|
|
5
|
+
autoload 'Rsync', 'nanoc/deploying/deployers/rsync'
|
|
6
|
+
|
|
7
|
+
Nanoc::Deploying::Deployer.register '::Nanoc::Deploying::Deployers::Fog', :fog
|
|
8
|
+
Nanoc::Deploying::Deployer.register '::Nanoc::Deploying::Deployers::Rsync', :rsync
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module Nanoc::
|
|
1
|
+
module Nanoc::Deploying::Deployers
|
|
2
2
|
# A deployer that deploys a site using [fog](https://github.com/geemus/fog).
|
|
3
3
|
#
|
|
4
4
|
# @example A deployment configuration with public and staging configurations
|
|
@@ -20,7 +20,7 @@ module Nanoc::Extra::Deployers
|
|
|
20
20
|
# bucket: nanoc-site-staging
|
|
21
21
|
#
|
|
22
22
|
# @api private
|
|
23
|
-
class Fog < ::Nanoc::
|
|
23
|
+
class Fog < ::Nanoc::Deploying::Deployer
|
|
24
24
|
class FogWrapper
|
|
25
25
|
def initialize(directory, is_dry_run)
|
|
26
26
|
@directory = directory
|
|
@@ -75,7 +75,7 @@ module Nanoc::Extra::Deployers
|
|
|
75
75
|
end
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
# @see Nanoc::
|
|
78
|
+
# @see Nanoc::Deploying::Deployer#run
|
|
79
79
|
def run
|
|
80
80
|
require 'fog'
|
|
81
81
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module Nanoc::
|
|
1
|
+
module Nanoc::Deploying::Deployers
|
|
2
2
|
# A deployer that deploys a site using rsync.
|
|
3
3
|
#
|
|
4
4
|
# The configuration has should include a `:dst` value, a string containing
|
|
@@ -18,7 +18,7 @@ module Nanoc::Extra::Deployers
|
|
|
18
18
|
# options: [ "-glpPrtvz" ]
|
|
19
19
|
#
|
|
20
20
|
# @api private
|
|
21
|
-
class Rsync < ::Nanoc::
|
|
21
|
+
class Rsync < ::Nanoc::Deploying::Deployer
|
|
22
22
|
# Default rsync options
|
|
23
23
|
DEFAULT_OPTIONS = [
|
|
24
24
|
'--group',
|
|
@@ -35,7 +35,7 @@ module Nanoc::Extra::Deployers
|
|
|
35
35
|
'--exclude=".git"',
|
|
36
36
|
].freeze
|
|
37
37
|
|
|
38
|
-
# @see Nanoc::
|
|
38
|
+
# @see Nanoc::Deploying::Deployer#run
|
|
39
39
|
def run
|
|
40
40
|
# Get params
|
|
41
41
|
src = source_path + '/'
|
data/lib/nanoc/extra.rb
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
require 'nanoc/checking'
|
|
2
|
+
require 'nanoc/deploying'
|
|
3
|
+
|
|
1
4
|
# @api private
|
|
2
5
|
module Nanoc::Extra
|
|
3
|
-
autoload 'Checking', 'nanoc/extra/checking'
|
|
4
|
-
autoload 'FilesystemTools', 'nanoc/extra/filesystem_tools'
|
|
5
6
|
autoload 'LinkCollector', 'nanoc/extra/link_collector.rb'
|
|
6
|
-
autoload 'Pruner', 'nanoc/extra/pruner'
|
|
7
7
|
autoload 'Piper', 'nanoc/extra/piper'
|
|
8
8
|
autoload 'JRubyNokogiriWarner', 'nanoc/extra/jruby_nokogiri_warner'
|
|
9
|
+
|
|
10
|
+
# @deprecated
|
|
11
|
+
Checking = Nanoc::Checking
|
|
12
|
+
|
|
13
|
+
# @deprecated
|
|
14
|
+
Deployer = Nanoc::Deploying::Deployer
|
|
9
15
|
end
|
|
10
16
|
|
|
11
17
|
require 'nanoc/extra/core_ext'
|
|
12
|
-
require 'nanoc/extra/deployer'
|
|
13
|
-
require 'nanoc/extra/deployers'
|
|
@@ -312,10 +312,21 @@ module Nanoc::Filters
|
|
|
312
312
|
def rouge(code, language, params = {})
|
|
313
313
|
require 'rouge'
|
|
314
314
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
315
|
+
if Rouge.version < '2' || params.fetch(:legacy, false)
|
|
316
|
+
# Rouge 1.x or Rouge 2.x legacy options
|
|
317
|
+
formatter_options = {
|
|
318
|
+
css_class: params.fetch(:css_class, 'highlight'),
|
|
319
|
+
inline_theme: params.fetch(:inline_theme, nil),
|
|
320
|
+
line_numbers: params.fetch(:line_numbers, false),
|
|
321
|
+
start_line: params.fetch(:start_line, 1),
|
|
322
|
+
wrap: params.fetch(:wrap, false),
|
|
323
|
+
}
|
|
324
|
+
formatter_cls = Rouge::Formatters.const_get(Rouge.version < '2' ? 'HTML' : 'HTMLLegacy')
|
|
325
|
+
formatter = formatter_cls.new(formatter_options)
|
|
326
|
+
else
|
|
327
|
+
formatter = params.fetch(:formatter, Rouge::Formatters::HTML.new)
|
|
328
|
+
end
|
|
329
|
+
|
|
319
330
|
lexer = Rouge::Lexer.find_fancy(language, code) || Rouge::Lexers::PlainText
|
|
320
331
|
formatter.format(lexer.lex(code))
|
|
321
332
|
end
|
data/lib/nanoc/filters/rdoc.rb
CHANGED
|
@@ -3,11 +3,6 @@ module Nanoc::Filters
|
|
|
3
3
|
class RDoc < Nanoc::Filter
|
|
4
4
|
requires 'rdoc'
|
|
5
5
|
|
|
6
|
-
def self.setup
|
|
7
|
-
gem 'rdoc', '~> 4.0'
|
|
8
|
-
super
|
|
9
|
-
end
|
|
10
|
-
|
|
11
6
|
# Runs the content through [RDoc::Markup](http://docs.seattlerb.org/rdoc/RDoc/Markup.html).
|
|
12
7
|
# This method takes no options.
|
|
13
8
|
#
|
|
@@ -67,7 +67,8 @@ module Nanoc::Helpers
|
|
|
67
67
|
dependency_tracker.bounce(item.unwrap)
|
|
68
68
|
|
|
69
69
|
unless rep.compiled?
|
|
70
|
-
|
|
70
|
+
Fiber.yield(Nanoc::Int::Errors::UnmetDependency.new(rep))
|
|
71
|
+
return content_for(*args, &block)
|
|
71
72
|
end
|
|
72
73
|
end
|
|
73
74
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
module Nanoc
|
|
2
2
|
module RuleDSL
|
|
3
3
|
class RecordingExecutor
|
|
4
|
+
include Nanoc::Int::ContractsSupport
|
|
5
|
+
|
|
4
6
|
class PathWithoutInitialSlashError < ::Nanoc::Error
|
|
5
7
|
def initialize(rep, basic_path)
|
|
6
8
|
super("The path returned for the #{rep.inspect} item representation, “#{basic_path}”, does not start with a slash. Please ensure that all routing rules return a path that starts with a slash.")
|
|
@@ -33,9 +35,13 @@ module Nanoc
|
|
|
33
35
|
@rule_memory.add_layout(layout_identifier, extra_filter_args)
|
|
34
36
|
end
|
|
35
37
|
|
|
38
|
+
Pathlike = C::Maybe[C::Or[String, Nanoc::Identifier]]
|
|
39
|
+
contract C::Any, Symbol, C::KeywordArgs[path: C::Optional[Pathlike], final: C::Optional[C::Bool]] => nil
|
|
36
40
|
def snapshot(rep, snapshot_name, final: true, path: nil)
|
|
37
|
-
|
|
41
|
+
pathlike = final ? (path || basic_path_from_rules_for(rep, snapshot_name)) : nil
|
|
42
|
+
actual_path = pathlike && pathlike.to_s
|
|
38
43
|
@rule_memory.add_snapshot(snapshot_name, final, actual_path)
|
|
44
|
+
nil
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
def basic_path_from_rules_for(rep, snapshot_name)
|
data/lib/nanoc/spec.rb
CHANGED
|
@@ -35,7 +35,15 @@ module Nanoc
|
|
|
35
35
|
Nanoc::ItemWithRepsView.new(item, view_context)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
#
|
|
38
|
+
# Creates a new layout and adds it to the site’s collection of layouts.
|
|
39
|
+
#
|
|
40
|
+
# @param [String] content The raw layout content
|
|
41
|
+
#
|
|
42
|
+
# @param [Hash] attributes A hash containing this layout's attributes
|
|
43
|
+
#
|
|
44
|
+
# @param [Nanoc::Identifier, String] identifier This layout's identifier
|
|
45
|
+
#
|
|
46
|
+
# @return [Nanoc::ItemWithRepsView] A view for the newly created layout
|
|
39
47
|
def create_layout(content, attributes, identifier)
|
|
40
48
|
layout = Nanoc::Int::Layout.new(content, attributes, identifier)
|
|
41
49
|
@layouts << layout
|
|
@@ -139,39 +147,7 @@ module Nanoc
|
|
|
139
147
|
end
|
|
140
148
|
|
|
141
149
|
def new_compiler_for(site)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
dependency_store =
|
|
145
|
-
Nanoc::Int::DependencyStore.new(site.items.to_a + site.layouts.to_a)
|
|
146
|
-
|
|
147
|
-
checksum_store =
|
|
148
|
-
Nanoc::Int::ChecksumStore.new(site: site)
|
|
149
|
-
|
|
150
|
-
item_rep_repo = Nanoc::Int::ItemRepRepo.new
|
|
151
|
-
|
|
152
|
-
action_provider = new_action_provider
|
|
153
|
-
|
|
154
|
-
outdatedness_checker =
|
|
155
|
-
Nanoc::Int::OutdatednessChecker.new(
|
|
156
|
-
site: site,
|
|
157
|
-
checksum_store: checksum_store,
|
|
158
|
-
dependency_store: dependency_store,
|
|
159
|
-
rule_memory_store: rule_memory_store,
|
|
160
|
-
action_provider: action_provider,
|
|
161
|
-
reps: item_rep_repo,
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
params = {
|
|
165
|
-
compiled_content_cache: Nanoc::Int::CompiledContentCache.new,
|
|
166
|
-
checksum_store: checksum_store,
|
|
167
|
-
rule_memory_store: rule_memory_store,
|
|
168
|
-
dependency_store: dependency_store,
|
|
169
|
-
outdatedness_checker: outdatedness_checker,
|
|
170
|
-
reps: item_rep_repo,
|
|
171
|
-
action_provider: action_provider,
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
Nanoc::Int::Compiler.new(site, params)
|
|
150
|
+
Nanoc::Int::CompilerLoader.new.load(site, action_provider: new_action_provider)
|
|
175
151
|
end
|
|
176
152
|
|
|
177
153
|
def new_site
|
data/lib/nanoc/version.rb
CHANGED
data/nanoc.gemspec
CHANGED
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
|
20
20
|
s.require_paths = ['lib']
|
|
21
21
|
|
|
22
22
|
s.rdoc_options = ['--main', 'README.md']
|
|
23
|
-
s.extra_rdoc_files = ['
|
|
23
|
+
s.extra_rdoc_files = ['LICENSE', 'README.md', 'NEWS.md']
|
|
24
24
|
|
|
25
25
|
s.required_ruby_version = '>= 2.1.0'
|
|
26
26
|
|
|
@@ -30,4 +30,5 @@ Gem::Specification.new do |s|
|
|
|
30
30
|
s.add_runtime_dependency('parallel', '~> 1.9')
|
|
31
31
|
|
|
32
32
|
s.add_development_dependency('bundler', '>= 1.7.10', '< 2.0')
|
|
33
|
+
s.add_development_dependency('appraisal', '~> 2.1')
|
|
33
34
|
end
|
data/test/base/test_context.rb
CHANGED
|
@@ -22,4 +22,10 @@ class Nanoc::Int::ContextTest < Nanoc::TestCase
|
|
|
22
22
|
# Run
|
|
23
23
|
assert_examples_correct 'Nanoc::Int::Context#initialize'
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def test_include
|
|
27
|
+
context = Nanoc::Int::Context.new({})
|
|
28
|
+
eval('include Nanoc::Helpers::HTMLEscape', context.get_binding)
|
|
29
|
+
assert_equal('<>', eval('h("<>")', context.get_binding))
|
|
30
|
+
end
|
|
25
31
|
end
|
|
@@ -86,24 +86,6 @@ class Nanoc::Int::DependencyTrackerTest < Nanoc::TestCase
|
|
|
86
86
|
assert_contains_exactly [items[0]], store.objects_outdated_due_to(items[1])
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
def test_enter_and_exit
|
|
90
|
-
items = [
|
|
91
|
-
Nanoc::Int::Item.new('Foo', {}, '/foo.md'),
|
|
92
|
-
Nanoc::Int::Item.new('Bar', {}, '/bar.md'),
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
store = Nanoc::Int::DependencyStore.new(items)
|
|
96
|
-
tracker = Nanoc::Int::DependencyTracker.new(store)
|
|
97
|
-
|
|
98
|
-
tracker.enter(items[0])
|
|
99
|
-
tracker.enter(items[1])
|
|
100
|
-
tracker.exit(items[1])
|
|
101
|
-
tracker.exit(items[0])
|
|
102
|
-
|
|
103
|
-
assert_contains_exactly [items[1]], store.objects_causing_outdatedness_of(items[0])
|
|
104
|
-
assert_empty store.objects_causing_outdatedness_of(items[1])
|
|
105
|
-
end
|
|
106
|
-
|
|
107
89
|
def test_store_graph_and_load_graph_simple
|
|
108
90
|
# Mock items
|
|
109
91
|
items = [mock('0'), mock('1'), mock('2'), mock('3')]
|
data/test/base/test_item_rep.rb
CHANGED
|
@@ -72,7 +72,7 @@ class Nanoc::Int::ItemRepTest < Nanoc::TestCase
|
|
|
72
72
|
rep.expects(:compiled?).returns(false)
|
|
73
73
|
|
|
74
74
|
# Check
|
|
75
|
-
assert_raises(
|
|
75
|
+
assert_raises(FiberError) do
|
|
76
76
|
rep.compiled_content
|
|
77
77
|
end
|
|
78
78
|
end
|
|
@@ -90,7 +90,7 @@ class Nanoc::Int::ItemRepTest < Nanoc::TestCase
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
# Check
|
|
93
|
-
assert_raises(
|
|
93
|
+
assert_raises(FiberError) do
|
|
94
94
|
rep.compiled_content(snapshot: :pre)
|
|
95
95
|
end
|
|
96
96
|
end
|