nanoc 4.3.7 → 4.3.8
Sign up to get free protection for your applications and to get access to all the features.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8471fc905ae1f77b95c08da9253b6f4dcf20c85c
|
4
|
+
data.tar.gz: a944c679e283c221ec1c3f67270ceee7805f472a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e5e7d17725da1b15847d97fdead9b4f734c9b0865060124a84e8c8a5e0a832267ebe4575a781daa959657b36cf55b81b2e0b6a49f9e3afd8ba77d0438d4c1af
|
7
|
+
data.tar.gz: 648f66ee103dcf20b6b91f974528b4ce17cdc3f7c2c64de3df45e6377d306e3724f3874689e5706edf515022ec89caa8862901a1373d8b61c2a7bb71696492c0
|
data/Appraisals
ADDED
data/Gemfile
CHANGED
@@ -2,22 +2,22 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'json', '~> 2.0'
|
6
|
-
|
7
5
|
group :devel do
|
8
6
|
gem 'contracts', '~> 0.14'
|
9
7
|
gem 'coveralls', require: false
|
10
|
-
gem 'guard-rake'
|
11
8
|
gem 'fuubar'
|
9
|
+
gem 'guard-rake'
|
10
|
+
gem 'json', '~> 2.0'
|
12
11
|
gem 'minitest', '~> 5.0'
|
13
12
|
gem 'mocha'
|
14
13
|
gem 'pry'
|
15
14
|
gem 'rake'
|
16
|
-
gem 'rdoc'
|
17
|
-
gem 'rspec'
|
15
|
+
gem 'rdoc', '~> 5.0'
|
18
16
|
gem 'rspec-mocks'
|
17
|
+
gem 'rspec'
|
19
18
|
gem 'rubocop'
|
20
19
|
gem 'simplecov', require: false
|
20
|
+
gem 'timecop'
|
21
21
|
gem 'vcr'
|
22
22
|
gem 'webmock'
|
23
23
|
gem 'yard'
|
@@ -44,7 +44,7 @@ group :plugins do
|
|
44
44
|
gem 'nokogiri', '~> 1.6'
|
45
45
|
gem 'pandoc-ruby'
|
46
46
|
gem 'parallel'
|
47
|
-
gem 'pygments.rb', platforms: [:ruby, :mswin]
|
47
|
+
gem 'pygments.rb', github: 'tmm1/pygments.rb', platforms: [:ruby, :mswin]
|
48
48
|
gem 'rack'
|
49
49
|
gem 'rainpress'
|
50
50
|
gem 'rdiscount', '~> 2.2', platforms: [:ruby, :mswin]
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git://github.com/tmm1/pygments.rb.git
|
3
|
+
revision: 4ed8701d65f6db7d8778cc56291999a0a87c7eda
|
4
|
+
specs:
|
5
|
+
pygments.rb (0.6.3)
|
6
|
+
posix-spawn (~> 0.3.6)
|
7
|
+
yajl-ruby (~> 1.2)
|
8
|
+
|
1
9
|
PATH
|
2
10
|
remote: .
|
3
11
|
specs:
|
4
|
-
nanoc (4.3.
|
12
|
+
nanoc (4.3.8)
|
5
13
|
cri (~> 2.3)
|
6
14
|
hamster (~> 3.0)
|
7
15
|
parallel (~> 1.9)
|
@@ -12,13 +20,18 @@ GEM
|
|
12
20
|
specs:
|
13
21
|
CFPropertyList (2.3.3)
|
14
22
|
RedCloth (4.3.2)
|
15
|
-
addressable (2.
|
23
|
+
addressable (2.5.0)
|
24
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
16
25
|
adsf (1.2.1)
|
17
26
|
rack (>= 1.0.0)
|
27
|
+
appraisal (2.1.0)
|
28
|
+
bundler
|
29
|
+
rake
|
30
|
+
thor (>= 0.14.0)
|
18
31
|
ast (2.3.0)
|
19
32
|
bluecloth (2.2.0)
|
20
33
|
builder (3.2.2)
|
21
|
-
chunky_png (1.3.
|
34
|
+
chunky_png (1.3.8)
|
22
35
|
coderay (1.1.1)
|
23
36
|
coffee-script (2.4.1)
|
24
37
|
coffee-script-source
|
@@ -129,7 +142,7 @@ GEM
|
|
129
142
|
multi_json (~> 1.10)
|
130
143
|
fog-local (0.3.1)
|
131
144
|
fog-core (~> 1.27)
|
132
|
-
fog-openstack (0.1.
|
145
|
+
fog-openstack (0.1.17)
|
133
146
|
fog-core (>= 1.40)
|
134
147
|
fog-json (>= 1.0)
|
135
148
|
ipaddress (>= 0.8)
|
@@ -137,10 +150,10 @@ GEM
|
|
137
150
|
fog-core (~> 1.27)
|
138
151
|
fog-json (~> 1.0)
|
139
152
|
fog-xml (~> 0.1)
|
140
|
-
fog-profitbricks (
|
153
|
+
fog-profitbricks (3.0.0)
|
141
154
|
fog-core (~> 1.42)
|
142
155
|
fog-json (~> 1.0)
|
143
|
-
fog-rackspace (0.1.
|
156
|
+
fog-rackspace (0.1.2)
|
144
157
|
fog-core (>= 1.35)
|
145
158
|
fog-json (>= 1.0)
|
146
159
|
fog-xml (>= 0.1)
|
@@ -174,7 +187,7 @@ GEM
|
|
174
187
|
fog-voxel (0.1.0)
|
175
188
|
fog-core
|
176
189
|
fog-xml
|
177
|
-
fog-vsphere (1.5.
|
190
|
+
fog-vsphere (1.5.1)
|
178
191
|
fog-core
|
179
192
|
rbvmomi (~> 1.9)
|
180
193
|
fog-xenserver (0.2.3)
|
@@ -206,7 +219,7 @@ GEM
|
|
206
219
|
handlebars (0.8.0)
|
207
220
|
handlebars-source (~> 4.0.5)
|
208
221
|
therubyracer (~> 0.12.1)
|
209
|
-
handlebars-source (4.0.
|
222
|
+
handlebars-source (4.0.6)
|
210
223
|
hashdiff (0.3.0)
|
211
224
|
inflecto (0.0.2)
|
212
225
|
ipaddress (0.8.3)
|
@@ -244,15 +257,13 @@ GEM
|
|
244
257
|
parallel (1.9.0)
|
245
258
|
parser (2.3.1.4)
|
246
259
|
ast (~> 2.2)
|
247
|
-
posix-spawn (0.3.
|
260
|
+
posix-spawn (0.3.12)
|
248
261
|
powerpack (0.1.1)
|
249
262
|
pry (0.10.4)
|
250
263
|
coderay (~> 1.1.0)
|
251
264
|
method_source (~> 0.8.1)
|
252
265
|
slop (~> 3.4)
|
253
|
-
|
254
|
-
posix-spawn (~> 0.3.6)
|
255
|
-
yajl-ruby (~> 1.2.0)
|
266
|
+
public_suffix (2.0.4)
|
256
267
|
rack (2.0.1)
|
257
268
|
rainbow (2.1.0)
|
258
269
|
rainpress (1.0)
|
@@ -266,10 +277,10 @@ GEM
|
|
266
277
|
nokogiri (~> 1.5)
|
267
278
|
trollop (~> 2.1)
|
268
279
|
rdiscount (2.2.0.1)
|
269
|
-
rdoc (
|
280
|
+
rdoc (5.0.0)
|
270
281
|
redcarpet (3.3.4)
|
271
282
|
ref (2.0.0)
|
272
|
-
rouge (2.0.
|
283
|
+
rouge (2.0.7)
|
273
284
|
rspec (3.5.0)
|
274
285
|
rspec-core (~> 3.5.0)
|
275
286
|
rspec-expectations (~> 3.5.0)
|
@@ -283,7 +294,7 @@ GEM
|
|
283
294
|
diff-lcs (>= 1.2.0, < 2.0)
|
284
295
|
rspec-support (~> 3.5.0)
|
285
296
|
rspec-support (3.5.0)
|
286
|
-
rubocop (0.
|
297
|
+
rubocop (0.45.0)
|
287
298
|
parser (>= 2.3.1.1, < 3.0)
|
288
299
|
powerpack (~> 0.1)
|
289
300
|
rainbow (>= 1.99.1, < 3.0)
|
@@ -312,6 +323,7 @@ GEM
|
|
312
323
|
ref
|
313
324
|
thor (0.19.1)
|
314
325
|
tilt (2.0.5)
|
326
|
+
timecop (0.8.1)
|
315
327
|
tins (1.12.0)
|
316
328
|
trollop (2.1.2)
|
317
329
|
typogruby (1.0.18)
|
@@ -328,7 +340,7 @@ GEM
|
|
328
340
|
crack (>= 0.3.2)
|
329
341
|
hashdiff
|
330
342
|
xml-simple (1.1.5)
|
331
|
-
yajl-ruby (1.
|
343
|
+
yajl-ruby (1.3.0)
|
332
344
|
yard (0.9.5)
|
333
345
|
yuicompressor (1.3.3)
|
334
346
|
|
@@ -338,6 +350,7 @@ PLATFORMS
|
|
338
350
|
DEPENDENCIES
|
339
351
|
RedCloth
|
340
352
|
adsf
|
353
|
+
appraisal (~> 2.1)
|
341
354
|
bluecloth
|
342
355
|
builder
|
343
356
|
bundler (>= 1.7.10, < 2.0)
|
@@ -367,12 +380,12 @@ DEPENDENCIES
|
|
367
380
|
pandoc-ruby
|
368
381
|
parallel
|
369
382
|
pry
|
370
|
-
pygments.rb
|
383
|
+
pygments.rb!
|
371
384
|
rack
|
372
385
|
rainpress
|
373
386
|
rake
|
374
387
|
rdiscount (~> 2.2)
|
375
|
-
rdoc
|
388
|
+
rdoc (~> 5.0)
|
376
389
|
redcarpet
|
377
390
|
rouge
|
378
391
|
rspec
|
@@ -382,6 +395,7 @@ DEPENDENCIES
|
|
382
395
|
sass
|
383
396
|
simplecov
|
384
397
|
slim
|
398
|
+
timecop
|
385
399
|
typogruby
|
386
400
|
uglifier
|
387
401
|
vcr
|
data/NEWS.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Nanoc news
|
2
2
|
|
3
|
+
## 4.3.8 (2016-11-18)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
* Improved support for Rouge 1.x and 2.x (#880) [Rémi Barraquand]
|
8
|
+
* Added `#include` to the `nanoc shell` command (#973)
|
9
|
+
* Improved speed of full and incremental compilations (#977, #985)
|
10
|
+
|
11
|
+
Fixes:
|
12
|
+
|
13
|
+
* Made routing rules and `#write` calls accept an identifier, and not just a string (#976)
|
14
|
+
* Removed GC speed-up hacks, which became counterproductive in Ruby 2.2 (#975)
|
15
|
+
* Fixed issue which caused items to be always recompiled if `rep`/`item_rep` or `self` are used in those items’ rules (#982)
|
16
|
+
|
3
17
|
## 4.3.7 (2016-10-29)
|
4
18
|
|
5
19
|
Fixes:
|
data/Rakefile
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
-
|
1
|
+
require 'rubocop/rake_task'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'coveralls/rake/task'
|
5
|
+
|
6
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
7
|
+
task.options = %w(--display-cop-names --format simple)
|
8
|
+
task.patterns = ['bin/nanoc', 'lib/**/*.rb', 'spec/**/*.rb', 'test/**/*.rb']
|
9
|
+
end
|
10
|
+
|
11
|
+
Coveralls::RakeTask.new
|
12
|
+
|
13
|
+
SUBDIRS = %w(* base cli data_sources extra filters helpers).freeze
|
14
|
+
|
15
|
+
namespace :test do
|
16
|
+
SUBDIRS.each do |dir|
|
17
|
+
Rake::TestTask.new(dir == '*' ? 'all' : dir) do |t|
|
18
|
+
t.test_files = Dir["test/#{dir}/**/*_spec.rb"] + Dir["test/#{dir}/**/test_*.rb"]
|
19
|
+
t.libs = ['./lib', '.']
|
20
|
+
t.ruby_opts = ['-r./test/helper']
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
26
|
+
t.verbose = false
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Run all tests and specs'
|
30
|
+
task test: [:spec, :'test:all', :'coveralls:push']
|
2
31
|
|
3
32
|
task default: [:test, :rubocop]
|
data/lib/nanoc.rb
CHANGED
@@ -27,6 +27,7 @@ require 'ref'
|
|
27
27
|
# Load general requirements
|
28
28
|
require 'digest'
|
29
29
|
require 'enumerator'
|
30
|
+
require 'fiber'
|
30
31
|
require 'fileutils'
|
31
32
|
require 'forwardable'
|
32
33
|
require 'pathname'
|
@@ -41,6 +42,8 @@ require 'English'
|
|
41
42
|
# Load Nanoc
|
42
43
|
require 'nanoc/version'
|
43
44
|
require 'nanoc/base'
|
45
|
+
require 'nanoc/checking'
|
46
|
+
require 'nanoc/deploying'
|
44
47
|
require 'nanoc/extra'
|
45
48
|
require 'nanoc/data_sources'
|
46
49
|
require 'nanoc/filters'
|
@@ -72,6 +72,8 @@ module Nanoc::Int
|
|
72
72
|
HashUpdateBehavior
|
73
73
|
when Nanoc::Int::Item, Nanoc::Int::Layout
|
74
74
|
DocumentUpdateBehavior
|
75
|
+
when Nanoc::Int::ItemRep
|
76
|
+
ItemRepUpdateBehavior
|
75
77
|
when NilClass, TrueClass, FalseClass
|
76
78
|
NoUpdateBehavior
|
77
79
|
when Time
|
@@ -84,12 +86,29 @@ module Nanoc::Int
|
|
84
86
|
StringUpdateBehavior
|
85
87
|
when Nanoc::View
|
86
88
|
UnwrapUpdateBehavior
|
89
|
+
when Nanoc::RuleDSL::RuleContext
|
90
|
+
RuleContextUpdateBehavior
|
87
91
|
else
|
88
92
|
RescueUpdateBehavior
|
89
93
|
end
|
90
94
|
end
|
91
95
|
end
|
92
96
|
|
97
|
+
class RuleContextUpdateBehavior
|
98
|
+
def self.update(obj, digest)
|
99
|
+
digest.update('item=')
|
100
|
+
yield(obj.item)
|
101
|
+
digest.update(',rep=')
|
102
|
+
yield(obj.rep)
|
103
|
+
digest.update(',items=')
|
104
|
+
yield(obj.items)
|
105
|
+
digest.update(',layouts=')
|
106
|
+
yield(obj.layouts)
|
107
|
+
digest.update(',config=')
|
108
|
+
yield(obj.config)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
93
112
|
class UpdateBehavior
|
94
113
|
def self.update(_obj, _digest)
|
95
114
|
raise NotImpementedError
|
@@ -174,6 +193,15 @@ module Nanoc::Int
|
|
174
193
|
end
|
175
194
|
end
|
176
195
|
|
196
|
+
class ItemRepUpdateBehavior < UpdateBehavior
|
197
|
+
def self.update(obj, digest)
|
198
|
+
digest.update('item=')
|
199
|
+
yield(obj.item)
|
200
|
+
digest.update(',name=')
|
201
|
+
yield(obj.name)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
177
205
|
class PathnameUpdateBehavior < UpdateBehavior
|
178
206
|
def self.update(obj, digest)
|
179
207
|
filename = obj.to_s
|
@@ -183,7 +183,7 @@ module Nanoc::Int
|
|
183
183
|
|
184
184
|
def prune
|
185
185
|
if site.config[:prune][:auto_prune]
|
186
|
-
Nanoc::
|
186
|
+
Nanoc::Pruner.new(site.config, reps, exclude: prune_config_exclude).run
|
187
187
|
end
|
188
188
|
end
|
189
189
|
|
@@ -227,30 +227,44 @@ module Nanoc::Int
|
|
227
227
|
#
|
228
228
|
# @return [void]
|
229
229
|
def compile_rep(rep)
|
230
|
-
|
230
|
+
@fibers ||= {}
|
231
|
+
@fibers[rep] ||=
|
232
|
+
Fiber.new do
|
233
|
+
begin
|
234
|
+
dependency_tracker = Nanoc::Int::DependencyTracker.new(@dependency_store)
|
235
|
+
dependency_tracker.enter(rep.item)
|
236
|
+
|
237
|
+
if can_reuse_content_for_rep?(rep)
|
238
|
+
Nanoc::Int::NotificationCenter.post(:cached_content_used, rep)
|
239
|
+
rep.snapshot_contents = compiled_content_cache[rep]
|
240
|
+
else
|
241
|
+
recalculate_content_for_rep(rep, dependency_tracker)
|
242
|
+
end
|
243
|
+
|
244
|
+
rep.compiled = true
|
245
|
+
compiled_content_cache[rep] = rep.snapshot_contents
|
246
|
+
|
247
|
+
@fibers.delete(rep)
|
248
|
+
ensure
|
249
|
+
dependency_tracker.exit(rep.item)
|
250
|
+
end
|
251
|
+
end
|
231
252
|
|
232
|
-
|
233
|
-
|
234
|
-
|
253
|
+
fiber = @fibers[rep]
|
254
|
+
while fiber.alive?
|
255
|
+
Nanoc::Int::NotificationCenter.post(:processing_started, rep)
|
256
|
+
Nanoc::Int::NotificationCenter.post(:compilation_started, rep)
|
257
|
+
res = fiber.resume
|
235
258
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
259
|
+
if res.is_a?(Nanoc::Int::Errors::UnmetDependency)
|
260
|
+
Nanoc::Int::NotificationCenter.post(:compilation_suspended, rep, res)
|
261
|
+
Nanoc::Int::NotificationCenter.post(:processing_ended, rep)
|
262
|
+
raise(res)
|
263
|
+
end
|
241
264
|
end
|
242
265
|
|
243
|
-
rep.compiled = true
|
244
|
-
compiled_content_cache[rep] = rep.snapshot_contents
|
245
|
-
|
246
|
-
Nanoc::Int::NotificationCenter.post(:processing_ended, rep)
|
247
266
|
Nanoc::Int::NotificationCenter.post(:compilation_ended, rep)
|
248
|
-
|
249
|
-
rep.forget_progress
|
250
|
-
Nanoc::Int::NotificationCenter.post(:compilation_failed, rep, e)
|
251
|
-
raise e
|
252
|
-
ensure
|
253
|
-
dependency_tracker.exit(rep.item)
|
267
|
+
Nanoc::Int::NotificationCenter.post(:processing_ended, rep)
|
254
268
|
end
|
255
269
|
|
256
270
|
# @return [Boolean]
|
@@ -200,7 +200,7 @@ module Nanoc
|
|
200
200
|
# Raise unmet dependency error if necessary
|
201
201
|
items.each do |item|
|
202
202
|
rep = orig_items.sample._context.reps[item].find { |r| !r.compiled? }
|
203
|
-
|
203
|
+
Fiber.yield(Nanoc::Int::Errors::UnmetDependency.new(rep)) if rep
|
204
204
|
end
|
205
205
|
end
|
206
206
|
end
|
data/lib/nanoc/base/context.rb
CHANGED
@@ -89,7 +89,8 @@ module Nanoc::Int
|
|
89
89
|
end
|
90
90
|
is_usable_snapshot = @snapshot_contents[snapshot_name] && (compiled? || !is_still_moving)
|
91
91
|
unless is_usable_snapshot
|
92
|
-
|
92
|
+
Fiber.yield(Nanoc::Int::Errors::UnmetDependency.new(self))
|
93
|
+
return compiled_content(snapshot: snapshot)
|
93
94
|
end
|
94
95
|
|
95
96
|
@snapshot_contents[snapshot_name].string
|
@@ -133,18 +134,6 @@ module Nanoc::Int
|
|
133
134
|
@paths[snapshot]
|
134
135
|
end
|
135
136
|
|
136
|
-
contract C::None => nil
|
137
|
-
# Resets the compilation progress for this item representation. This is
|
138
|
-
# necessary when an unmet dependency is detected during compilation.
|
139
|
-
#
|
140
|
-
# @api private
|
141
|
-
#
|
142
|
-
# @return [void]
|
143
|
-
def forget_progress
|
144
|
-
initialize_content
|
145
|
-
nil
|
146
|
-
end
|
147
|
-
|
148
137
|
# Returns an object that can be used for uniquely identifying objects.
|
149
138
|
#
|
150
139
|
# @api private
|