nanoc 4.1.0a1 → 4.1.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/NEWS.md +10 -0
  4. data/lib/nanoc/base/checksummer.rb +2 -1
  5. data/lib/nanoc/base/compilation/compiler.rb +33 -43
  6. data/lib/nanoc/base/compilation/outdatedness_checker.rb +4 -8
  7. data/lib/nanoc/base/entities/rule_memory.rb +5 -1
  8. data/lib/nanoc/base/entities.rb +0 -1
  9. data/lib/nanoc/base/services/action_provider.rb +22 -0
  10. data/lib/nanoc/base/services/compiler_loader.rb +5 -14
  11. data/lib/nanoc/base/services/executor.rb +1 -1
  12. data/lib/nanoc/base/services/item_rep_builder.rb +4 -12
  13. data/lib/nanoc/base/services/item_rep_router.rb +3 -4
  14. data/lib/nanoc/base/services.rb +1 -5
  15. data/lib/nanoc/base.rb +0 -3
  16. data/lib/nanoc/cli/commands/create-site.rb +2 -5
  17. data/lib/nanoc/cli/commands/show-rules.rb +9 -1
  18. data/lib/nanoc/helpers/rendering.rb +1 -1
  19. data/lib/nanoc/rule_dsl/action_provider.rb +76 -0
  20. data/lib/nanoc/{base/compilation → rule_dsl}/compiler_dsl.rb +9 -9
  21. data/lib/nanoc/{base/services → rule_dsl}/recording_executor.rb +6 -11
  22. data/lib/nanoc/{base/compilation → rule_dsl}/rule.rb +3 -3
  23. data/lib/nanoc/{base/compilation → rule_dsl}/rule_context.rb +2 -2
  24. data/lib/nanoc/{base/services → rule_dsl}/rule_memory_calculator.rb +16 -11
  25. data/lib/nanoc/{base/entities → rule_dsl}/rules_collection.rb +1 -1
  26. data/lib/nanoc/{base/services → rule_dsl}/rules_loader.rb +2 -2
  27. data/lib/nanoc/rule_dsl.rb +8 -0
  28. data/lib/nanoc/version.rb +1 -1
  29. data/lib/nanoc.rb +1 -0
  30. data/test/base/test_compiler.rb +45 -147
  31. data/test/filters/test_erb.rb +1 -1
  32. data/test/helper.rb +2 -2
  33. data/test/rule_dsl/test_action_provider.rb +70 -0
  34. data/test/{base → rule_dsl}/test_compiler_dsl.rb +25 -86
  35. data/test/{base → rule_dsl}/test_rule.rb +1 -1
  36. data/test/rule_dsl/test_rules_collection.rb +89 -0
  37. metadata +17 -16
  38. data/lib/nanoc/base/services/postprocessor.rb +0 -26
  39. data/lib/nanoc/base/services/preprocessor.rb +0 -26
  40. data/nanoc-4.0.2.gem +0 -0
  41. data/tags +0 -1175
@@ -1,4 +1,4 @@
1
- class Nanoc::Int::CompilerDSLTest < Nanoc::TestCase
1
+ class Nanoc::RuleDSL::CompilerDSLTest < Nanoc::TestCase
2
2
  def test_compile
3
3
  # TODO: implement
4
4
  end
@@ -12,8 +12,8 @@ class Nanoc::Int::CompilerDSLTest < Nanoc::TestCase
12
12
  end
13
13
 
14
14
  def test_preprocess_twice
15
- rules_collection = Nanoc::Int::RulesCollection.new
16
- compiler_dsl = Nanoc::Int::CompilerDSL.new(rules_collection, {})
15
+ rules_collection = Nanoc::RuleDSL::RulesCollection.new
16
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(rules_collection, {})
17
17
 
18
18
  # first time
19
19
  io = capturing_stdio do
@@ -31,8 +31,8 @@ class Nanoc::Int::CompilerDSLTest < Nanoc::TestCase
31
31
  end
32
32
 
33
33
  def test_postprocess_twice
34
- rules_collection = Nanoc::Int::RulesCollection.new
35
- compiler_dsl = Nanoc::Int::CompilerDSL.new(rules_collection, {})
34
+ rules_collection = Nanoc::RuleDSL::RulesCollection.new
35
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(rules_collection, {})
36
36
 
37
37
  # first time
38
38
  io = capturing_stdio do
@@ -49,62 +49,6 @@ class Nanoc::Int::CompilerDSLTest < Nanoc::TestCase
49
49
  assert_match(/WARNING: A postprocess block is already defined./, io[:stderr])
50
50
  end
51
51
 
52
- def test_per_rules_file_preprocessor
53
- # Create site
54
- Nanoc::CLI.run %w( create_site foo )
55
- FileUtils.cd('foo') do
56
- # Create a bonus rules file
57
- File.write(
58
- 'more_rules.rb',
59
- "preprocess { @items['/index.*'][:preprocessed] = true }")
60
-
61
- # Adjust normal rules file
62
- File.write(
63
- 'Rules',
64
- "include_rules 'more_rules'\n\npreprocess {}\n\n" + File.read('Rules'))
65
-
66
- # Create site and compiler
67
- site = Nanoc::Int::SiteLoader.new.new_from_cwd
68
- compiler = Nanoc::Int::CompilerLoader.new.load(site)
69
-
70
- # Check that the two preprocess blocks have been added
71
- assert_equal 2, compiler.rules_collection.preprocessors.size
72
- refute_nil compiler.rules_collection.preprocessors.first
73
- refute_nil compiler.rules_collection.preprocessors.to_a.last
74
-
75
- # Apply preprocess blocks
76
- Nanoc::Int::Preprocessor
77
- .new(site: site, rules_collection: compiler.rules_collection)
78
- .run
79
- assert site.items['/index.*'].attributes[:preprocessed]
80
- end
81
- end
82
-
83
- def test_per_rules_file_postprocessor
84
- # Create site
85
- Nanoc::CLI.run %w( create_site foo )
86
- FileUtils.cd('foo') do
87
- # Create a bonus rules file
88
- File.write(
89
- 'more_rules.rb',
90
- 'postprocess {}')
91
-
92
- # Adjust normal rules file
93
- File.write(
94
- 'Rules',
95
- "include_rules 'more_rules'\n\npostprocess {}\n\n" + File.read('Rules'))
96
-
97
- # Create site and compiler
98
- site = Nanoc::Int::SiteLoader.new.new_from_cwd
99
- compiler = Nanoc::Int::CompilerLoader.new.load(site)
100
-
101
- # Check that the two postprocess blocks have been added
102
- assert_equal 2, compiler.rules_collection.postprocessors.size
103
- refute_nil compiler.rules_collection.postprocessors.first
104
- refute_nil compiler.rules_collection.postprocessors.to_a.last
105
- end
106
- end
107
-
108
52
  def test_postprocessor_modified_method
109
53
  with_site do |site|
110
54
  # Create rules
@@ -132,9 +76,7 @@ EOS
132
76
  end
133
77
 
134
78
  def test_include_rules
135
- # Create site
136
- Nanoc::CLI.run %w( create_site foo )
137
- FileUtils.cd('foo') do
79
+ with_site(legacy: false) do |site|
138
80
  # Create a bonus rules file
139
81
  File.write(
140
82
  'more_rules.rb',
@@ -147,18 +89,15 @@ EOS
147
89
  "route '/**/*' do ; nil ; end\n\n" \
148
90
  "compile '/**/*' do ; end\n")
149
91
 
150
- # Create site and compiler
92
+ # Create items
93
+ File.write('content/index.html', 'hello!')
94
+
95
+ # Compile
151
96
  site = Nanoc::Int::SiteLoader.new.new_from_cwd
152
- compiler = Nanoc::Int::CompilerLoader.new.load(site)
153
- compiler.build_reps
97
+ site.compile
154
98
 
155
99
  # Check
156
- rep = compiler.reps[site.items['/index.*']][0]
157
- routing_rules = site.compiler.rules_collection.routing_rules_for(rep)
158
- routing_rule = routing_rules[:last]
159
- refute_nil routing_rule
160
- assert_equal Nanoc::Int::StringPattern, routing_rule.pattern.class
161
- assert_equal '/index.*', routing_rule.pattern.to_s
100
+ assert File.file?('output/index.html')
162
101
  end
163
102
  end
164
103
 
@@ -340,7 +279,7 @@ EOS
340
279
  end
341
280
 
342
281
  def test_create_pattern_with_string_with_no_config
343
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
282
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
344
283
 
345
284
  err = assert_raises(Nanoc::Int::Errors::GenericTrivial) do
346
285
  compiler_dsl.create_pattern('/foo/*')
@@ -349,7 +288,7 @@ EOS
349
288
  end
350
289
 
351
290
  def test_create_pattern_with_string_with_glob_string_pattern_type
352
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, { string_pattern_type: 'glob' })
291
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, { string_pattern_type: 'glob' })
353
292
 
354
293
  pattern = compiler_dsl.create_pattern('/foo/*')
355
294
  assert pattern.match?('/foo/aaaa')
@@ -358,14 +297,14 @@ EOS
358
297
  end
359
298
 
360
299
  def test_create_pattern_with_regex
361
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, { string_pattern_type: 'glob' })
300
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, { string_pattern_type: 'glob' })
362
301
 
363
302
  pattern = compiler_dsl.create_pattern(%r{\A/foo/a*/})
364
303
  assert pattern.match?('/foo/aaaa/')
365
304
  end
366
305
 
367
306
  def test_create_pattern_with_string_with_unknown_string_pattern_type
368
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, { string_pattern_type: 'donkey' })
307
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, { string_pattern_type: 'donkey' })
369
308
 
370
309
  err = assert_raises(Nanoc::Int::Errors::GenericTrivial) do
371
310
  compiler_dsl.create_pattern('/foo/*')
@@ -375,7 +314,7 @@ EOS
375
314
 
376
315
  def test_identifier_to_regex_without_wildcards
377
316
  # Create compiler DSL
378
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
317
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
379
318
 
380
319
  actual = compiler_dsl.instance_eval { identifier_to_regex('foo') }
381
320
  expected = %r{^/foo/$}
@@ -389,7 +328,7 @@ EOS
389
328
 
390
329
  def test_identifier_to_regex_with_one_wildcard
391
330
  # Create compiler DSL
392
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
331
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
393
332
 
394
333
  actual = compiler_dsl.instance_eval { identifier_to_regex('foo/*/bar') }
395
334
  expected = %r{^/foo/(.*?)/bar/$}
@@ -403,7 +342,7 @@ EOS
403
342
 
404
343
  def test_identifier_to_regex_with_two_wildcards
405
344
  # Create compiler DSL
406
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
345
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
407
346
 
408
347
  actual = compiler_dsl.instance_eval { identifier_to_regex('foo/*/bar/*/qux') }
409
348
  expected = %r{^/foo/(.*?)/bar/(.*?)/qux/$}
@@ -417,7 +356,7 @@ EOS
417
356
 
418
357
  def test_identifier_to_regex_with_just_one_wildcard
419
358
  # Create compiler DSL
420
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
359
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
421
360
 
422
361
  actual = compiler_dsl.instance_eval { identifier_to_regex('*') }
423
362
  expected = %r{^/(.*?)$}
@@ -431,7 +370,7 @@ EOS
431
370
 
432
371
  def test_identifier_to_regex_with_root
433
372
  # Create compiler DSL
434
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
373
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
435
374
 
436
375
  actual = compiler_dsl.instance_eval { identifier_to_regex('/') }
437
376
  expected = %r{^/$}
@@ -445,7 +384,7 @@ EOS
445
384
 
446
385
  def test_identifier_to_regex_with_only_children
447
386
  # Create compiler DSL
448
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
387
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
449
388
 
450
389
  actual = compiler_dsl.instance_eval { identifier_to_regex('/foo/*/') }
451
390
  expected = %r{^/foo/(.*?)/$}
@@ -459,7 +398,7 @@ EOS
459
398
 
460
399
  def test_identifier_to_regex_with_plus_wildcard
461
400
  # Create compiler DSL
462
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
401
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
463
402
 
464
403
  actual = compiler_dsl.instance_eval { identifier_to_regex('/foo/+') }
465
404
  expected = %r{^/foo/(.+?)/$}
@@ -474,7 +413,7 @@ EOS
474
413
  end
475
414
 
476
415
  def test_dsl_has_no_access_to_compiler
477
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, {})
416
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, {})
478
417
  assert_raises(NameError) do
479
418
  compiler_dsl.instance_eval { compiler }
480
419
  end
@@ -482,7 +421,7 @@ EOS
482
421
 
483
422
  def test_config
484
423
  $venetian = 'unsnares'
485
- compiler_dsl = Nanoc::Int::CompilerDSL.new(nil, { venetian: 'snares' })
424
+ compiler_dsl = Nanoc::RuleDSL::CompilerDSL.new(nil, { venetian: 'snares' })
486
425
  compiler_dsl.instance_eval { $venetian = @config[:venetian] }
487
426
  assert_equal 'snares', $venetian
488
427
  end
@@ -16,7 +16,7 @@ class Nanoc::Int::RuleTest < Nanoc::TestCase
16
16
  identifier = '/anything/else/'
17
17
  expected = %w(anything else)
18
18
 
19
- rule = Nanoc::Int::Rule.new(pattern, :string, proc {})
19
+ rule = Nanoc::RuleDSL::Rule.new(pattern, :string, proc {})
20
20
 
21
21
  assert_equal expected, rule.send(:matches, identifier)
22
22
  end
@@ -0,0 +1,89 @@
1
+ class Nanoc::RuleDSL::RulesCollectionTest < Nanoc::TestCase
2
+ def test_compilation_rule_for
3
+ # Mock rules
4
+ rules = [mock, mock, mock]
5
+ rules[0].expects(:applicable_to?).returns(false)
6
+ rules[1].expects(:applicable_to?).returns(true)
7
+ rules[1].expects(:rep_name).returns('wrong')
8
+ rules[2].expects(:applicable_to?).returns(true)
9
+ rules[2].expects(:rep_name).returns('right')
10
+
11
+ rules_collection = Nanoc::RuleDSL::RulesCollection.new
12
+ rules_collection.instance_eval { @item_compilation_rules = rules }
13
+
14
+ # Mock rep
15
+ rep = mock
16
+ rep.stubs(:name).returns('right')
17
+ item = mock
18
+ rep.stubs(:item).returns(item)
19
+
20
+ # Test
21
+ assert_equal rules[2], rules_collection.compilation_rule_for(rep)
22
+ end
23
+
24
+ def test_filter_for_layout_with_existant_layout
25
+ rules_collection = Nanoc::RuleDSL::RulesCollection.new
26
+ rules_collection.layout_filter_mapping[Nanoc::Int::Pattern.from(/.*/)] = [:erb, { foo: 'bar' }]
27
+
28
+ # Mock layout
29
+ layout = MiniTest::Mock.new
30
+ layout.expect(:identifier, '/some_layout/')
31
+
32
+ # Check
33
+ assert_equal([:erb, { foo: 'bar' }], rules_collection.filter_for_layout(layout))
34
+ end
35
+
36
+ def test_filter_for_layout_with_existant_layout_and_unknown_filter
37
+ rules_collection = Nanoc::RuleDSL::RulesCollection.new
38
+ rules_collection.layout_filter_mapping[Nanoc::Int::Pattern.from(/.*/)] = [:some_unknown_filter, { foo: 'bar' }]
39
+
40
+ # Mock layout
41
+ layout = MiniTest::Mock.new
42
+ layout.expect(:identifier, '/some_layout/')
43
+
44
+ # Check
45
+ assert_equal([:some_unknown_filter, { foo: 'bar' }], rules_collection.filter_for_layout(layout))
46
+ end
47
+
48
+ def test_filter_for_layout_with_nonexistant_layout
49
+ rules_collection = Nanoc::RuleDSL::RulesCollection.new
50
+ rules_collection.layout_filter_mapping[Nanoc::Int::Pattern.from(%r{^/foo/$})] = [:erb, { foo: 'bar' }]
51
+
52
+ # Mock layout
53
+ layout = MiniTest::Mock.new
54
+ layout.expect(:identifier, '/bar/')
55
+
56
+ # Check
57
+ assert_equal(nil, rules_collection.filter_for_layout(layout))
58
+ end
59
+
60
+ def test_filter_for_layout_with_many_layouts
61
+ rules_collection = Nanoc::RuleDSL::RulesCollection.new
62
+ rules_collection.layout_filter_mapping[Nanoc::Int::Pattern.from(%r{^/a/b/c/.*/$})] = [:erb, { char: 'd' }]
63
+ rules_collection.layout_filter_mapping[Nanoc::Int::Pattern.from(%r{^/a/.*/$})] = [:erb, { char: 'b' }]
64
+ rules_collection.layout_filter_mapping[Nanoc::Int::Pattern.from(%r{^/a/b/.*/$})] = [:erb, { char: 'c' }] # never used!
65
+ rules_collection.layout_filter_mapping[Nanoc::Int::Pattern.from(%r{^/.*/$})] = [:erb, { char: 'a' }]
66
+
67
+ # Mock layout
68
+ layouts = [mock, mock, mock, mock]
69
+ layouts[0].stubs(:identifier).returns('/a/b/c/d/')
70
+ layouts[1].stubs(:identifier).returns('/a/b/c/')
71
+ layouts[2].stubs(:identifier).returns('/a/b/')
72
+ layouts[3].stubs(:identifier).returns('/a/')
73
+
74
+ # Get expectations
75
+ expectations = {
76
+ 0 => 'd',
77
+ 1 => 'b', # never used! not c, because b takes priority
78
+ 2 => 'b',
79
+ 3 => 'a',
80
+ }
81
+
82
+ # Check
83
+ expectations.each_pair do |num, char|
84
+ filter_and_args = rules_collection.filter_for_layout(layouts[num])
85
+ refute_nil(filter_and_args)
86
+ assert_equal(char, filter_and_args[1][:char])
87
+ end
88
+ end
89
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0a1
4
+ version: 4.1.0b1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-05 00:00:00.000000000 Z
11
+ date: 2015-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri
@@ -74,14 +74,11 @@ files:
74
74
  - lib/nanoc/base.rb
75
75
  - lib/nanoc/base/checksummer.rb
76
76
  - lib/nanoc/base/compilation/compiler.rb
77
- - lib/nanoc/base/compilation/compiler_dsl.rb
78
77
  - lib/nanoc/base/compilation/dependency_tracker.rb
79
78
  - lib/nanoc/base/compilation/filter.rb
80
79
  - lib/nanoc/base/compilation/item_rep_repo.rb
81
80
  - lib/nanoc/base/compilation/outdatedness_checker.rb
82
81
  - lib/nanoc/base/compilation/outdatedness_reasons.rb
83
- - lib/nanoc/base/compilation/rule.rb
84
- - lib/nanoc/base/compilation/rule_context.rb
85
82
  - lib/nanoc/base/context.rb
86
83
  - lib/nanoc/base/core_ext.rb
87
84
  - lib/nanoc/base/core_ext/array.rb
@@ -106,7 +103,6 @@ files:
106
103
  - lib/nanoc/base/entities/rule_memory_actions/filter.rb
107
104
  - lib/nanoc/base/entities/rule_memory_actions/layout.rb
108
105
  - lib/nanoc/base/entities/rule_memory_actions/snapshot.rb
109
- - lib/nanoc/base/entities/rules_collection.rb
110
106
  - lib/nanoc/base/entities/site.rb
111
107
  - lib/nanoc/base/entities/snapshot_def.rb
112
108
  - lib/nanoc/base/error.rb
@@ -123,6 +119,7 @@ files:
123
119
  - lib/nanoc/base/repos/site_loader.rb
124
120
  - lib/nanoc/base/repos/store.rb
125
121
  - lib/nanoc/base/services.rb
122
+ - lib/nanoc/base/services/action_provider.rb
126
123
  - lib/nanoc/base/services/compiler_loader.rb
127
124
  - lib/nanoc/base/services/executor.rb
128
125
  - lib/nanoc/base/services/item_rep_builder.rb
@@ -130,11 +127,6 @@ files:
130
127
  - lib/nanoc/base/services/item_rep_selector.rb
131
128
  - lib/nanoc/base/services/item_rep_writer.rb
132
129
  - lib/nanoc/base/services/notification_center.rb
133
- - lib/nanoc/base/services/postprocessor.rb
134
- - lib/nanoc/base/services/preprocessor.rb
135
- - lib/nanoc/base/services/recording_executor.rb
136
- - lib/nanoc/base/services/rule_memory_calculator.rb
137
- - lib/nanoc/base/services/rules_loader.rb
138
130
  - lib/nanoc/base/services/temp_filename_factory.rb
139
131
  - lib/nanoc/base/views.rb
140
132
  - lib/nanoc/base/views/config_view.rb
@@ -247,10 +239,17 @@ files:
247
239
  - lib/nanoc/helpers/tagging.rb
248
240
  - lib/nanoc/helpers/text.rb
249
241
  - lib/nanoc/helpers/xml_sitemap.rb
242
+ - lib/nanoc/rule_dsl.rb
243
+ - lib/nanoc/rule_dsl/action_provider.rb
244
+ - lib/nanoc/rule_dsl/compiler_dsl.rb
245
+ - lib/nanoc/rule_dsl/recording_executor.rb
246
+ - lib/nanoc/rule_dsl/rule.rb
247
+ - lib/nanoc/rule_dsl/rule_context.rb
248
+ - lib/nanoc/rule_dsl/rule_memory_calculator.rb
249
+ - lib/nanoc/rule_dsl/rules_collection.rb
250
+ - lib/nanoc/rule_dsl/rules_loader.rb
250
251
  - lib/nanoc/version.rb
251
- - nanoc-4.0.2.gem
252
252
  - nanoc.gemspec
253
- - tags
254
253
  - tasks/doc.rake
255
254
  - tasks/rubocop.rake
256
255
  - tasks/test.rake
@@ -262,7 +261,6 @@ files:
262
261
  - test/base/test_checksum_store.rb
263
262
  - test/base/test_code_snippet.rb
264
263
  - test/base/test_compiler.rb
265
- - test/base/test_compiler_dsl.rb
266
264
  - test/base/test_context.rb
267
265
  - test/base/test_data_source.rb
268
266
  - test/base/test_dependency_tracker.rb
@@ -276,7 +274,6 @@ files:
276
274
  - test/base/test_notification_center.rb
277
275
  - test/base/test_outdatedness_checker.rb
278
276
  - test/base/test_plugin.rb
279
- - test/base/test_rule.rb
280
277
  - test/base/test_site.rb
281
278
  - test/base/test_store.rb
282
279
  - test/cli/commands/test_check.rb
@@ -351,6 +348,10 @@ files:
351
348
  - test/helpers/test_tagging.rb
352
349
  - test/helpers/test_text.rb
353
350
  - test/helpers/test_xml_sitemap.rb
351
+ - test/rule_dsl/test_action_provider.rb
352
+ - test/rule_dsl/test_compiler_dsl.rb
353
+ - test/rule_dsl/test_rule.rb
354
+ - test/rule_dsl/test_rules_collection.rb
354
355
  - test/test_gem.rb
355
356
  homepage: http://nanoc.ws/
356
357
  licenses:
@@ -374,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
374
375
  version: 1.3.1
375
376
  requirements: []
376
377
  rubyforge_project:
377
- rubygems_version: 2.4.5.1
378
+ rubygems_version: 2.5.1
378
379
  signing_key:
379
380
  specification_version: 4
380
381
  summary: A static-site generator with a focus on flexibility.
@@ -1,26 +0,0 @@
1
- module Nanoc::Int
2
- # @api private
3
- class Postprocessor
4
- def initialize(context, site:, rules_collection:)
5
- @context = context
6
- @site = site
7
- @rules_collection = rules_collection
8
- end
9
-
10
- def run
11
- ctx = new_postprocessor_context
12
-
13
- @rules_collection.postprocessors.each_value do |postprocessor|
14
- ctx.instance_eval(&postprocessor)
15
- end
16
- end
17
-
18
- # @api private
19
- def new_postprocessor_context
20
- Nanoc::Int::Context.new(
21
- config: Nanoc::ConfigView.new(@site.config, @context),
22
- items: Nanoc::PostCompileItemCollectionView.new(@site.items, @context),
23
- )
24
- end
25
- end
26
- end
@@ -1,26 +0,0 @@
1
- module Nanoc::Int
2
- # @api private
3
- class Preprocessor
4
- def initialize(site:, rules_collection:)
5
- @site = site
6
- @rules_collection = rules_collection
7
- end
8
-
9
- def run
10
- ctx = new_preprocessor_context
11
-
12
- @rules_collection.preprocessors.each_value do |preprocessor|
13
- ctx.instance_eval(&preprocessor)
14
- end
15
- end
16
-
17
- # @api private
18
- def new_preprocessor_context
19
- Nanoc::Int::Context.new(
20
- config: Nanoc::MutableConfigView.new(@site.config, nil),
21
- items: Nanoc::MutableItemCollectionView.new(@site.items, nil),
22
- layouts: Nanoc::MutableLayoutCollectionView.new(@site.layouts, nil),
23
- )
24
- end
25
- end
26
- end
data/nanoc-4.0.2.gem DELETED
Binary file