nanoc 4.0.0b4 → 4.0.0rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +31 -32
- data/NEWS.md +7 -0
- data/README.md +1 -2
- data/Rakefile +2 -11
- data/TODO.md +0 -1
- data/bin/nanoc +4 -0
- data/lib/nanoc/base/checksummer.rb +1 -1
- data/lib/nanoc/base/compilation/compiler.rb +7 -13
- data/lib/nanoc/base/compilation/dependency_tracker.rb +1 -1
- data/lib/nanoc/base/compilation/rule.rb +2 -0
- data/lib/nanoc/base/compilation/rules_collection.rb +2 -2
- data/lib/nanoc/base/entities/identifier.rb +45 -15
- data/lib/nanoc/base/entities/pattern.rb +8 -0
- data/lib/nanoc/base/entities/snapshot_def.rb +16 -0
- data/lib/nanoc/base/entities.rb +1 -0
- data/lib/nanoc/base/plugin_registry.rb +1 -1
- data/lib/nanoc/base/{compilation → repos}/checksum_store.rb +0 -0
- data/lib/nanoc/base/{compilation → repos}/compiled_content_cache.rb +0 -0
- data/lib/nanoc/base/repos/config_loader.rb +67 -0
- data/lib/nanoc/base/{compilation → repos}/rule_memory_store.rb +0 -0
- data/lib/nanoc/base/repos/site_loader.rb +118 -0
- data/lib/nanoc/base/{store.rb → repos/store.rb} +0 -0
- data/lib/nanoc/base/repos.rb +7 -0
- data/lib/nanoc/base/result_data/item_rep.rb +37 -66
- data/lib/nanoc/base/services/executor.rb +15 -9
- data/lib/nanoc/base/services/item_rep_writer.rb +1 -1
- data/lib/nanoc/base/services/recording_executor.rb +4 -4
- data/lib/nanoc/base/source_data/configuration.rb +89 -3
- data/lib/nanoc/base/source_data/data_source.rb +2 -15
- data/lib/nanoc/base/source_data/site.rb +14 -378
- data/lib/nanoc/base/views/{config.rb → config_view.rb} +0 -0
- data/lib/nanoc/base/views/{identifiable_collection.rb → identifiable_collection_view.rb} +0 -0
- data/lib/nanoc/base/views/{item_collection.rb → item_collection_view.rb} +0 -0
- data/lib/nanoc/base/views/{item_rep_collection.rb → item_rep_collection_view.rb} +7 -1
- data/lib/nanoc/base/views/{item_rep.rb → item_rep_view.rb} +0 -0
- data/lib/nanoc/base/views/{item.rb → item_view.rb} +0 -0
- data/lib/nanoc/base/views/{layout_collection.rb → layout_collection_view.rb} +0 -0
- data/lib/nanoc/base/views/{layout.rb → layout_view.rb} +0 -0
- data/lib/nanoc/base/views/mixins/{document.rb → document_view_mixin.rb} +0 -0
- data/lib/nanoc/base/views/mixins/{mutable_document.rb → mutable_document_view_mixin.rb} +0 -0
- data/lib/nanoc/base/views/{mutable_config.rb → mutable_config_view.rb} +0 -0
- data/lib/nanoc/base/views/{mutable_identifiable_collection.rb → mutable_identifiable_collection_view.rb} +0 -0
- data/lib/nanoc/base/views/{mutable_item_collection.rb → mutable_item_collection_view.rb} +0 -0
- data/lib/nanoc/base/views/{mutable_item.rb → mutable_item_view.rb} +0 -0
- data/lib/nanoc/base/views/{mutable_layout_collection.rb → mutable_layout_collection_view.rb} +0 -0
- data/lib/nanoc/base/views/{mutable_layout.rb → mutable_layout_view.rb} +0 -0
- data/lib/nanoc/base/views/{site.rb → site_view.rb} +0 -0
- data/lib/nanoc/base/views.rb +17 -17
- data/lib/nanoc/base.rb +1 -4
- data/lib/nanoc/cli/ansi_string_colorizer.rb +1 -1
- data/lib/nanoc/cli/cleaning_stream.rb +5 -0
- data/lib/nanoc/cli/command_runner.rb +10 -4
- data/lib/nanoc/cli/commands/compile.rb +1 -1
- data/lib/nanoc/cli/commands/create-site.rb +12 -11
- data/lib/nanoc/cli/commands/prune.rb +1 -0
- data/lib/nanoc/cli/commands/show-plugins.rb +4 -4
- data/lib/nanoc/cli/commands/show-rules.rb +21 -30
- data/lib/nanoc/cli/commands/view.rb +1 -1
- data/lib/nanoc/cli/error_handler.rb +1 -1
- data/lib/nanoc/cli.rb +3 -3
- data/lib/nanoc/data_sources/filesystem.rb +4 -4
- data/lib/nanoc/extra/checking/runner.rb +3 -2
- data/lib/nanoc/extra/deployers/rsync.rb +1 -1
- data/lib/nanoc/extra/link_collector.rb +1 -1
- data/lib/nanoc/helpers/capturing.rb +1 -1
- data/lib/nanoc/helpers/rendering.rb +2 -2
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.gemspec +3 -4
- data/tasks/doc.rake +1 -1
- data/tasks/rubocop.rake +4 -8
- data/tasks/test.rake +11 -27
- data/test/base/test_compiler.rb +21 -16
- data/test/base/test_compiler_dsl.rb +8 -8
- data/test/base/test_item.rb +1 -1
- data/test/base/test_item_rep.rb +16 -14
- data/test/base/test_memoization.rb +1 -38
- data/test/base/test_outdatedness_checker.rb +38 -6
- data/test/base/test_site.rb +19 -121
- data/test/cli/commands/test_compile.rb +1 -1
- data/test/cli/commands/test_create_site.rb +7 -8
- data/test/data_sources/test_filesystem.rb +7 -7
- data/test/data_sources/test_filesystem_unified.rb +17 -17
- data/test/extra/checking/checks/test_mixed_content.rb +8 -8
- data/test/extra/checking/checks/test_stale.rb +3 -4
- data/test/extra/deployers/test_fog.rb +1 -1
- data/test/extra/deployers/test_rsync.rb +2 -2
- data/test/extra/test_filesystem_tools.rb +1 -1
- data/test/filters/test_erb.rb +1 -1
- data/test/filters/test_handlebars.rb +2 -2
- data/test/filters/test_less.rb +2 -2
- data/test/filters/test_mustache.rb +2 -2
- data/test/filters/test_relativize_paths.rb +1 -1
- data/test/filters/test_sass.rb +6 -6
- data/test/filters/test_xsl.rb +3 -3
- data/test/helper.rb +10 -15
- data/test/helpers/test_blogging.rb +16 -16
- data/test/helpers/test_capturing.rb +6 -6
- data/test/helpers/test_link_to.rb +13 -13
- data/test/helpers/test_rendering.rb +33 -0
- data/test/helpers/test_tagging.rb +8 -8
- metadata +32 -30
- data/test/gem_loader.rb +0 -9
@@ -113,7 +113,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
113
113
|
end
|
114
114
|
assert_equal(
|
115
115
|
'Cannot build Atom feed: no articles',
|
116
|
-
error.message
|
116
|
+
error.message,
|
117
117
|
)
|
118
118
|
end
|
119
119
|
end
|
@@ -138,7 +138,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
138
138
|
end
|
139
139
|
assert_equal(
|
140
140
|
'Cannot build Atom feed: site configuration has no base_url',
|
141
|
-
error.message
|
141
|
+
error.message,
|
142
142
|
)
|
143
143
|
end
|
144
144
|
end
|
@@ -163,7 +163,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
163
163
|
end
|
164
164
|
assert_equal(
|
165
165
|
'Cannot build Atom feed: no title in params, item or site config',
|
166
|
-
error.message
|
166
|
+
error.message,
|
167
167
|
)
|
168
168
|
end
|
169
169
|
end
|
@@ -188,7 +188,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
188
188
|
end
|
189
189
|
assert_equal(
|
190
190
|
'Cannot build Atom feed: no author_name in params, item or site config',
|
191
|
-
error.message
|
191
|
+
error.message,
|
192
192
|
)
|
193
193
|
end
|
194
194
|
end
|
@@ -221,21 +221,21 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
221
221
|
# Still should keep feed level author
|
222
222
|
assert_match(
|
223
223
|
/#{Regexp.escape('<name>Denis Defreyne</name>')}/, #'
|
224
|
-
result
|
224
|
+
result,
|
225
225
|
)
|
226
226
|
assert_match(
|
227
227
|
/#{Regexp.escape('<uri>http://stoneship.org/</uri>')}/, #'
|
228
|
-
result
|
228
|
+
result,
|
229
229
|
)
|
230
230
|
|
231
231
|
# Overrides on specific items
|
232
232
|
assert_match(
|
233
233
|
/#{Regexp.escape('<name>Don Alias</name>')}/, #'
|
234
|
-
result
|
234
|
+
result,
|
235
235
|
)
|
236
236
|
assert_match(
|
237
237
|
/#{Regexp.escape('<uri>http://don.example.com/</uri>')}/, #'
|
238
|
-
result
|
238
|
+
result,
|
239
239
|
)
|
240
240
|
end
|
241
241
|
end
|
@@ -260,7 +260,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
260
260
|
end
|
261
261
|
assert_equal(
|
262
262
|
'Cannot build Atom feed: no author_uri in params, item or site config',
|
263
|
-
error.message
|
263
|
+
error.message,
|
264
264
|
)
|
265
265
|
end
|
266
266
|
end
|
@@ -287,7 +287,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
287
287
|
end
|
288
288
|
assert_equal(
|
289
289
|
'Cannot build Atom feed: one or more articles lack created_at',
|
290
|
-
error.message
|
290
|
+
error.message,
|
291
291
|
)
|
292
292
|
end
|
293
293
|
end
|
@@ -312,7 +312,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
312
312
|
atom_feed(
|
313
313
|
author_name: 'Bob',
|
314
314
|
author_uri: 'http://example.com/~bob/',
|
315
|
-
title: 'My Blog Or Something'
|
315
|
+
title: 'My Blog Or Something',
|
316
316
|
)
|
317
317
|
end
|
318
318
|
end
|
@@ -328,7 +328,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
328
328
|
author_name: 'Bob',
|
329
329
|
author_uri: 'http://example.com/~bob/',
|
330
330
|
title: 'My Blog Or Something',
|
331
|
-
base_url: 'http://example.com'
|
331
|
+
base_url: 'http://example.com',
|
332
332
|
})
|
333
333
|
|
334
334
|
# Create feed item
|
@@ -390,11 +390,11 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
390
390
|
result = atom_feed limit: 1, articles: @items
|
391
391
|
assert_match(
|
392
392
|
Regexp.new('Article 0', Regexp::MULTILINE),
|
393
|
-
result
|
393
|
+
result,
|
394
394
|
)
|
395
395
|
refute_match(
|
396
396
|
Regexp.new('Article 1', Regexp::MULTILINE),
|
397
|
-
result
|
397
|
+
result,
|
398
398
|
)
|
399
399
|
end
|
400
400
|
end
|
@@ -423,7 +423,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
423
423
|
result = atom_feed
|
424
424
|
assert_match(
|
425
425
|
Regexp.new('Article 1.*Article 0', Regexp::MULTILINE),
|
426
|
-
result
|
426
|
+
result,
|
427
427
|
)
|
428
428
|
end
|
429
429
|
end
|
@@ -452,7 +452,7 @@ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
|
|
452
452
|
result = atom_feed(preserve_order: true)
|
453
453
|
assert_match(
|
454
454
|
Regexp.new('Article 1.*Article 0', Regexp::MULTILINE),
|
455
|
-
result
|
455
|
+
result,
|
456
456
|
)
|
457
457
|
end
|
458
458
|
end
|
@@ -15,9 +15,9 @@ class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
|
|
15
15
|
'<% end %> foot'
|
16
16
|
|
17
17
|
# Build site
|
18
|
-
site = Nanoc::Int::
|
18
|
+
site = Nanoc::Int::SiteLoader.new.new_empty
|
19
19
|
item = Nanoc::Int::Item.new('moo', {}, '/blah/')
|
20
|
-
@site = Nanoc::SiteView.new(Nanoc::Int::
|
20
|
+
@site = Nanoc::SiteView.new(Nanoc::Int::SiteLoader.new.new_empty)
|
21
21
|
@item = Nanoc::ItemView.new(item)
|
22
22
|
|
23
23
|
# Evaluate content
|
@@ -32,7 +32,7 @@ class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
|
|
32
32
|
require 'erb'
|
33
33
|
|
34
34
|
# Build site
|
35
|
-
@site = Nanoc::SiteView.new(Nanoc::Int::
|
35
|
+
@site = Nanoc::SiteView.new(Nanoc::Int::SiteLoader.new.new_empty)
|
36
36
|
@item = Nanoc::ItemView.new(Nanoc::Int::Item.new('moo', {}, '/blah/'))
|
37
37
|
|
38
38
|
# Capture
|
@@ -66,7 +66,7 @@ head
|
|
66
66
|
foot
|
67
67
|
EOS
|
68
68
|
|
69
|
-
@site = Nanoc::SiteView.new(Nanoc::Int::
|
69
|
+
@site = Nanoc::SiteView.new(Nanoc::Int::SiteLoader.new.new_empty)
|
70
70
|
@item = Nanoc::ItemView.new(Nanoc::Int::Item.new('content', {}, '/'))
|
71
71
|
|
72
72
|
result = ::ERB.new(content).result(binding)
|
@@ -84,7 +84,7 @@ EOS
|
|
84
84
|
io.write "route '*' do ; item.identifier + 'index.html' ; end\n"
|
85
85
|
end
|
86
86
|
|
87
|
-
@site = Nanoc::SiteView.new(Nanoc::Int::
|
87
|
+
@site = Nanoc::SiteView.new(Nanoc::Int::SiteLoader.new.new_empty)
|
88
88
|
@item = Nanoc::ItemView.new(Nanoc::Int::Item.new('content', {}, '/'))
|
89
89
|
content = '<% content_for :a do %>Content One<% end %>'
|
90
90
|
::ERB.new(content).result(binding)
|
@@ -92,7 +92,7 @@ EOS
|
|
92
92
|
assert_equal 'Content One', content_for(@item, :a)
|
93
93
|
assert_equal nil, content_for(@item, :b)
|
94
94
|
|
95
|
-
@site = Nanoc::SiteView.new(Nanoc::Int::
|
95
|
+
@site = Nanoc::SiteView.new(Nanoc::Int::SiteLoader.new.new_empty)
|
96
96
|
@item = Nanoc::ItemView.new(Nanoc::Int::Item.new('content', {}, '/'))
|
97
97
|
content = '<% content_for :b do %>Content Two<% end %>'
|
98
98
|
::ERB.new(content).result(binding)
|
@@ -5,7 +5,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
5
5
|
# Check
|
6
6
|
assert_equal(
|
7
7
|
'<a href="/foo/">Foo</a>',
|
8
|
-
link_to('Foo', '/foo/')
|
8
|
+
link_to('Foo', '/foo/'),
|
9
9
|
)
|
10
10
|
end
|
11
11
|
|
@@ -17,7 +17,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
17
17
|
# Check
|
18
18
|
assert_equal(
|
19
19
|
'<a href="/bar/">Bar</a>',
|
20
|
-
link_to('Bar', rep)
|
20
|
+
link_to('Bar', rep),
|
21
21
|
)
|
22
22
|
end
|
23
23
|
|
@@ -29,7 +29,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
29
29
|
# Check
|
30
30
|
assert_equal(
|
31
31
|
'<a href="/bar/">Bar</a>',
|
32
|
-
link_to('Bar', item)
|
32
|
+
link_to('Bar', item),
|
33
33
|
)
|
34
34
|
end
|
35
35
|
|
@@ -37,7 +37,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
37
37
|
# Check
|
38
38
|
assert_equal(
|
39
39
|
'<a title="Dis mai foo!" href="/foo/">Foo</a>',
|
40
|
-
link_to('Foo', '/foo/', title: 'Dis mai foo!')
|
40
|
+
link_to('Foo', '/foo/', title: 'Dis mai foo!'),
|
41
41
|
)
|
42
42
|
end
|
43
43
|
|
@@ -45,7 +45,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
45
45
|
# Check
|
46
46
|
assert_equal(
|
47
47
|
'<a title="Foo & Bar" href="/foo&bar/">Foo & Bar</a>',
|
48
|
-
link_to('Foo & Bar', '/foo&bar/', title: 'Foo & Bar')
|
48
|
+
link_to('Foo & Bar', '/foo&bar/', title: 'Foo & Bar'),
|
49
49
|
)
|
50
50
|
end
|
51
51
|
|
@@ -68,7 +68,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
68
68
|
# Check
|
69
69
|
assert_equal(
|
70
70
|
'<span class="active" title="You\'re here.">Bar</span>',
|
71
|
-
link_to_unless_current('Bar', @item_rep)
|
71
|
+
link_to_unless_current('Bar', @item_rep),
|
72
72
|
)
|
73
73
|
ensure
|
74
74
|
@item = nil
|
@@ -82,7 +82,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
82
82
|
# Check
|
83
83
|
assert_equal(
|
84
84
|
'<a href="/abc/xyz/">Bar</a>',
|
85
|
-
link_to_unless_current('Bar', '/abc/xyz/')
|
85
|
+
link_to_unless_current('Bar', '/abc/xyz/'),
|
86
86
|
)
|
87
87
|
end
|
88
88
|
|
@@ -94,7 +94,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
94
94
|
# Test
|
95
95
|
assert_equal(
|
96
96
|
'./',
|
97
|
-
relative_path_to('/foo/bar/baz/')
|
97
|
+
relative_path_to('/foo/bar/baz/'),
|
98
98
|
)
|
99
99
|
end
|
100
100
|
|
@@ -106,7 +106,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
106
106
|
# Test
|
107
107
|
assert_equal(
|
108
108
|
'../../../',
|
109
|
-
relative_path_to('/')
|
109
|
+
relative_path_to('/'),
|
110
110
|
)
|
111
111
|
end
|
112
112
|
|
@@ -118,7 +118,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
118
118
|
# Test
|
119
119
|
assert_equal(
|
120
120
|
'../../quux',
|
121
|
-
relative_path_to('/foo/quux')
|
121
|
+
relative_path_to('/foo/quux'),
|
122
122
|
)
|
123
123
|
end
|
124
124
|
|
@@ -130,7 +130,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
130
130
|
# Test
|
131
131
|
assert_equal(
|
132
132
|
'../../quux/',
|
133
|
-
relative_path_to('/foo/quux/')
|
133
|
+
relative_path_to('/foo/quux/'),
|
134
134
|
)
|
135
135
|
end
|
136
136
|
|
@@ -146,7 +146,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
146
146
|
# Test
|
147
147
|
assert_equal(
|
148
148
|
'../../quux/',
|
149
|
-
relative_path_to(other_item_rep)
|
149
|
+
relative_path_to(other_item_rep),
|
150
150
|
)
|
151
151
|
end
|
152
152
|
|
@@ -162,7 +162,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
162
162
|
# Test
|
163
163
|
assert_equal(
|
164
164
|
'../../quux/',
|
165
|
-
relative_path_to(other_item)
|
165
|
+
relative_path_to(other_item),
|
166
166
|
)
|
167
167
|
end
|
168
168
|
|
@@ -11,6 +11,8 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
11
11
|
io.write 'This is the <%= @layout.identifier %> layout.'
|
12
12
|
end
|
13
13
|
|
14
|
+
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
15
|
+
site.compiler.load
|
14
16
|
@site = Nanoc::SiteView.new(site)
|
15
17
|
@layouts = Nanoc::LayoutCollectionView.new(site.layouts)
|
16
18
|
|
@@ -28,6 +30,8 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
28
30
|
io.write 'This is the <%= @layout.identifier %> layout.'
|
29
31
|
end
|
30
32
|
|
33
|
+
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
34
|
+
site.compiler.load
|
31
35
|
@site = Nanoc::SiteView.new(site)
|
32
36
|
@layouts = Nanoc::LayoutCollectionView.new(site.layouts)
|
33
37
|
|
@@ -45,6 +49,8 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
45
49
|
io.write 'I am the <%= @layout.class %> class.'
|
46
50
|
end
|
47
51
|
|
52
|
+
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
53
|
+
site.compiler.load
|
48
54
|
@site = Nanoc::SiteView.new(site)
|
49
55
|
@layouts = Nanoc::LayoutCollectionView.new(site.layouts)
|
50
56
|
|
@@ -52,8 +58,29 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
52
58
|
end
|
53
59
|
end
|
54
60
|
|
61
|
+
def test_render_wrapped_class
|
62
|
+
with_site do |site|
|
63
|
+
File.open('Rules', 'w') do |io|
|
64
|
+
io.write("layout '/foo/', :erb\n")
|
65
|
+
end
|
66
|
+
|
67
|
+
File.open('layouts/foo.erb', 'w') do |io|
|
68
|
+
io.write 'I am the <%= @layout.unwrap.class %> class.'
|
69
|
+
end
|
70
|
+
|
71
|
+
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
72
|
+
site.compiler.load
|
73
|
+
@site = Nanoc::SiteView.new(site)
|
74
|
+
@layouts = Nanoc::LayoutCollectionView.new(site.layouts)
|
75
|
+
|
76
|
+
assert_equal('I am the Nanoc::Int::Layout class.', render('/foo/'))
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
55
80
|
def test_render_with_unknown_layout
|
56
81
|
with_site do |site|
|
82
|
+
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
83
|
+
site.compiler.load
|
57
84
|
@site = Nanoc::SiteView.new(site)
|
58
85
|
@layouts = Nanoc::LayoutCollectionView.new(site.layouts)
|
59
86
|
|
@@ -71,6 +98,8 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
71
98
|
|
72
99
|
File.open('layouts/foo.erb', 'w').close
|
73
100
|
|
101
|
+
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
102
|
+
site.compiler.load
|
74
103
|
@site = Nanoc::SiteView.new(site)
|
75
104
|
@layouts = Nanoc::LayoutCollectionView.new(site.layouts)
|
76
105
|
|
@@ -88,6 +117,8 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
88
117
|
|
89
118
|
File.open('layouts/foo.erb', 'w').close
|
90
119
|
|
120
|
+
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
121
|
+
site.compiler.load
|
91
122
|
@site = Nanoc::SiteView.new(site)
|
92
123
|
@layouts = Nanoc::LayoutCollectionView.new(site.layouts)
|
93
124
|
|
@@ -107,6 +138,8 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
107
138
|
io.write '[partial-before]<%= yield %>[partial-after]'
|
108
139
|
end
|
109
140
|
|
141
|
+
site = Nanoc::Int::SiteLoader.new.new_from_cwd
|
142
|
+
site.compiler.load
|
110
143
|
@site = Nanoc::SiteView.new(site)
|
111
144
|
@layouts = Nanoc::LayoutCollectionView.new(site.layouts)
|
112
145
|
|
@@ -8,7 +8,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
|
8
8
|
# Check
|
9
9
|
assert_equal(
|
10
10
|
'(none)',
|
11
|
-
tags_for(item, base_url: 'http://example.com/tag/')
|
11
|
+
tags_for(item, base_url: 'http://example.com/tag/'),
|
12
12
|
)
|
13
13
|
end
|
14
14
|
|
@@ -20,7 +20,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
|
20
20
|
assert_equal(
|
21
21
|
"#{link_for_tag('foo', 'http://stoneship.org/tag/')}, " \
|
22
22
|
"#{link_for_tag('bar', 'http://stoneship.org/tag/')}",
|
23
|
-
tags_for(item, base_url: 'http://stoneship.org/tag/')
|
23
|
+
tags_for(item, base_url: 'http://stoneship.org/tag/'),
|
24
24
|
)
|
25
25
|
end
|
26
26
|
|
@@ -31,7 +31,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
|
31
31
|
# Check
|
32
32
|
assert_equal(
|
33
33
|
'no tags for you, fool',
|
34
|
-
tags_for(item, none_text: 'no tags for you, fool', base_url: 'http://example.com/tag/')
|
34
|
+
tags_for(item, none_text: 'no tags for you, fool', base_url: 'http://example.com/tag/'),
|
35
35
|
)
|
36
36
|
end
|
37
37
|
|
@@ -43,7 +43,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
|
43
43
|
assert_equal(
|
44
44
|
"#{link_for_tag('foo', 'http://example.com/tag/')} ++ " \
|
45
45
|
"#{link_for_tag('bar', 'http://example.com/tag/')}",
|
46
|
-
tags_for(item, separator: ' ++ ', base_url: 'http://example.com/tag/')
|
46
|
+
tags_for(item, separator: ' ++ ', base_url: 'http://example.com/tag/'),
|
47
47
|
)
|
48
48
|
end
|
49
49
|
|
@@ -52,7 +52,7 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
|
52
52
|
@items = Nanoc::ItemCollectionView.new([
|
53
53
|
Nanoc::Int::Item.new('item 1', { tags: [:foo] }, '/item1/'),
|
54
54
|
Nanoc::Int::Item.new('item 2', { tags: [:bar] }, '/item2/'),
|
55
|
-
Nanoc::Int::Item.new('item 3', { tags: [:foo, :bar] }, '/item3/')
|
55
|
+
Nanoc::Int::Item.new('item 3', { tags: [:foo, :bar] }, '/item3/'),
|
56
56
|
])
|
57
57
|
|
58
58
|
# Find items
|
@@ -61,21 +61,21 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
|
61
61
|
# Check
|
62
62
|
assert_equal(
|
63
63
|
[@items[0], @items[2]],
|
64
|
-
items_with_foo_tag
|
64
|
+
items_with_foo_tag,
|
65
65
|
)
|
66
66
|
end
|
67
67
|
|
68
68
|
def test_link_for_tag
|
69
69
|
assert_equal(
|
70
70
|
%(<a href="http://stoneship.org/tags/foobar" rel="tag">foobar</a>),
|
71
|
-
link_for_tag('foobar', 'http://stoneship.org/tags/')
|
71
|
+
link_for_tag('foobar', 'http://stoneship.org/tags/'),
|
72
72
|
)
|
73
73
|
end
|
74
74
|
|
75
75
|
def test_link_for_tag_escape
|
76
76
|
assert_equal(
|
77
77
|
%(<a href="http://stoneship.org/tags&stuff/foo&bar" rel="tag">foo&bar</a>),
|
78
|
-
link_for_tag('foo&bar', 'http://stoneship.org/tags&stuff/')
|
78
|
+
link_for_tag('foo&bar', 'http://stoneship.org/tags&stuff/'),
|
79
79
|
)
|
80
80
|
end
|
81
81
|
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.0.
|
4
|
+
version: 4.0.0rc1
|
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-06-
|
11
|
+
date: 2015-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '2.0'
|
47
|
-
description: nanoc is a
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
description: nanoc is a static-site generator focused on flexibility. It transforms
|
48
|
+
content from a format such as Markdown or AsciiDoc into another format, usually
|
49
|
+
HTML, and lays out pages consistently to retain the site’s look and feel throughout.
|
50
|
+
Static sites built with nanoc can be deployed to any web server.
|
51
51
|
email: denis.defreyne@stoneship.org
|
52
52
|
executables:
|
53
53
|
- nanoc
|
@@ -73,8 +73,6 @@ files:
|
|
73
73
|
- lib/nanoc.rb
|
74
74
|
- lib/nanoc/base.rb
|
75
75
|
- lib/nanoc/base/checksummer.rb
|
76
|
-
- lib/nanoc/base/compilation/checksum_store.rb
|
77
|
-
- lib/nanoc/base/compilation/compiled_content_cache.rb
|
78
76
|
- lib/nanoc/base/compilation/compiler.rb
|
79
77
|
- lib/nanoc/base/compilation/compiler_dsl.rb
|
80
78
|
- lib/nanoc/base/compilation/dependency_tracker.rb
|
@@ -84,7 +82,6 @@ files:
|
|
84
82
|
- lib/nanoc/base/compilation/rule.rb
|
85
83
|
- lib/nanoc/base/compilation/rule_context.rb
|
86
84
|
- lib/nanoc/base/compilation/rule_memory_calculator.rb
|
87
|
-
- lib/nanoc/base/compilation/rule_memory_store.rb
|
88
85
|
- lib/nanoc/base/compilation/rules_collection.rb
|
89
86
|
- lib/nanoc/base/context.rb
|
90
87
|
- lib/nanoc/base/core_ext.rb
|
@@ -99,11 +96,19 @@ files:
|
|
99
96
|
- lib/nanoc/base/entities/identifier.rb
|
100
97
|
- lib/nanoc/base/entities/layout.rb
|
101
98
|
- lib/nanoc/base/entities/pattern.rb
|
99
|
+
- lib/nanoc/base/entities/snapshot_def.rb
|
102
100
|
- lib/nanoc/base/error.rb
|
103
101
|
- lib/nanoc/base/errors.rb
|
104
102
|
- lib/nanoc/base/identifiable_collection.rb
|
105
103
|
- lib/nanoc/base/memoization.rb
|
106
104
|
- lib/nanoc/base/plugin_registry.rb
|
105
|
+
- lib/nanoc/base/repos.rb
|
106
|
+
- lib/nanoc/base/repos/checksum_store.rb
|
107
|
+
- lib/nanoc/base/repos/compiled_content_cache.rb
|
108
|
+
- lib/nanoc/base/repos/config_loader.rb
|
109
|
+
- lib/nanoc/base/repos/rule_memory_store.rb
|
110
|
+
- lib/nanoc/base/repos/site_loader.rb
|
111
|
+
- lib/nanoc/base/repos/store.rb
|
107
112
|
- lib/nanoc/base/result_data/item_rep.rb
|
108
113
|
- lib/nanoc/base/services.rb
|
109
114
|
- lib/nanoc/base/services/executor.rb
|
@@ -116,25 +121,24 @@ files:
|
|
116
121
|
- lib/nanoc/base/source_data/data_source.rb
|
117
122
|
- lib/nanoc/base/source_data/item.rb
|
118
123
|
- lib/nanoc/base/source_data/site.rb
|
119
|
-
- lib/nanoc/base/store.rb
|
120
124
|
- lib/nanoc/base/views.rb
|
121
|
-
- lib/nanoc/base/views/
|
122
|
-
- lib/nanoc/base/views/
|
123
|
-
- lib/nanoc/base/views/
|
124
|
-
- lib/nanoc/base/views/
|
125
|
-
- lib/nanoc/base/views/
|
126
|
-
- lib/nanoc/base/views/
|
127
|
-
- lib/nanoc/base/views/
|
128
|
-
- lib/nanoc/base/views/
|
129
|
-
- lib/nanoc/base/views/mixins/
|
130
|
-
- lib/nanoc/base/views/mixins/
|
131
|
-
- lib/nanoc/base/views/
|
132
|
-
- lib/nanoc/base/views/
|
133
|
-
- lib/nanoc/base/views/
|
134
|
-
- lib/nanoc/base/views/
|
135
|
-
- lib/nanoc/base/views/
|
136
|
-
- lib/nanoc/base/views/
|
137
|
-
- lib/nanoc/base/views/
|
125
|
+
- lib/nanoc/base/views/config_view.rb
|
126
|
+
- lib/nanoc/base/views/identifiable_collection_view.rb
|
127
|
+
- lib/nanoc/base/views/item_collection_view.rb
|
128
|
+
- lib/nanoc/base/views/item_rep_collection_view.rb
|
129
|
+
- lib/nanoc/base/views/item_rep_view.rb
|
130
|
+
- lib/nanoc/base/views/item_view.rb
|
131
|
+
- lib/nanoc/base/views/layout_collection_view.rb
|
132
|
+
- lib/nanoc/base/views/layout_view.rb
|
133
|
+
- lib/nanoc/base/views/mixins/document_view_mixin.rb
|
134
|
+
- lib/nanoc/base/views/mixins/mutable_document_view_mixin.rb
|
135
|
+
- lib/nanoc/base/views/mutable_config_view.rb
|
136
|
+
- lib/nanoc/base/views/mutable_identifiable_collection_view.rb
|
137
|
+
- lib/nanoc/base/views/mutable_item_collection_view.rb
|
138
|
+
- lib/nanoc/base/views/mutable_item_view.rb
|
139
|
+
- lib/nanoc/base/views/mutable_layout_collection_view.rb
|
140
|
+
- lib/nanoc/base/views/mutable_layout_view.rb
|
141
|
+
- lib/nanoc/base/views/site_view.rb
|
138
142
|
- lib/nanoc/cli.rb
|
139
143
|
- lib/nanoc/cli/ansi_string_colorizer.rb
|
140
144
|
- lib/nanoc/cli/cleaning_stream.rb
|
@@ -316,7 +320,6 @@ files:
|
|
316
320
|
- test/fixtures/vcr_cassettes/css_run_parse_error.yml
|
317
321
|
- test/fixtures/vcr_cassettes/html_run_error.yml
|
318
322
|
- test/fixtures/vcr_cassettes/html_run_ok.yml
|
319
|
-
- test/gem_loader.rb
|
320
323
|
- test/helper.rb
|
321
324
|
- test/helpers/test_blogging.rb
|
322
325
|
- test/helpers/test_breadcrumbs.rb
|
@@ -354,7 +357,6 @@ rubyforge_project:
|
|
354
357
|
rubygems_version: 2.4.7
|
355
358
|
signing_key:
|
356
359
|
specification_version: 4
|
357
|
-
summary:
|
358
|
-
websites.
|
360
|
+
summary: A static-site generator with a focus on flexibility.
|
359
361
|
test_files: []
|
360
362
|
has_rdoc:
|