nanoc 3.6.1 → 3.6.2
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 +15 -0
- data/Gemfile.lock +4 -4
- data/LICENSE +1 -1
- data/NEWS.md +17 -0
- data/lib/nanoc.rb +1 -1
- data/lib/nanoc/base/result_data/item_rep.rb +20 -12
- data/lib/nanoc/base/source_data/item_array.rb +1 -1
- data/lib/nanoc/cli/commands/check.rb +1 -1
- data/lib/nanoc/cli/commands/deploy.rb +32 -23
- data/lib/nanoc/cli/commands/prune.rb +2 -2
- data/lib/nanoc/cli/commands/validate-css.rb +1 -0
- data/lib/nanoc/cli/commands/validate-html.rb +1 -0
- data/lib/nanoc/cli/commands/validate-links.rb +2 -0
- data/lib/nanoc/cli/commands/watch.rb +1 -1
- data/lib/nanoc/extra/checking/checks/external_links.rb +5 -2
- data/lib/nanoc/extra/checking/runner.rb +9 -4
- data/lib/nanoc/filters/rdoc.rb +9 -2
- data/lib/nanoc/helpers/breadcrumbs.rb +10 -15
- data/nanoc.gemspec +3 -2
- data/test/base/test_checksum_store.rb +1 -3
- data/test/base/test_code_snippet.rb +1 -3
- data/test/base/test_compiler.rb +24 -3
- data/test/base/test_compiler_dsl.rb +1 -3
- data/test/base/test_context.rb +1 -3
- data/test/base/test_data_source.rb +1 -3
- data/test/base/test_dependency_tracker.rb +1 -3
- data/test/base/test_directed_graph.rb +1 -3
- data/test/base/test_filter.rb +1 -3
- data/test/base/test_item.rb +1 -3
- data/test/base/test_item_array.rb +1 -3
- data/test/base/test_item_rep.rb +1 -3
- data/test/base/test_layout.rb +1 -3
- data/test/base/test_memoization.rb +1 -3
- data/test/base/test_notification_center.rb +1 -3
- data/test/base/test_outdatedness_checker.rb +1 -3
- data/test/base/test_plugin.rb +1 -3
- data/test/base/test_rule.rb +1 -3
- data/test/base/test_rule_context.rb +1 -3
- data/test/base/test_site.rb +1 -3
- data/test/cli/commands/test_check.rb +1 -3
- data/test/cli/commands/test_compile.rb +1 -3
- data/test/cli/commands/test_create_item.rb +1 -3
- data/test/cli/commands/test_create_layout.rb +1 -3
- data/test/cli/commands/test_create_site.rb +1 -3
- data/test/cli/commands/test_deploy.rb +45 -4
- data/test/cli/commands/test_help.rb +1 -3
- data/test/cli/commands/test_info.rb +1 -3
- data/test/cli/commands/test_prune.rb +1 -3
- data/test/cli/commands/test_sync.rb +1 -3
- data/test/cli/commands/test_update.rb +1 -3
- data/test/cli/commands/test_watch.rb +1 -3
- data/test/cli/test_cleaning_stream.rb +1 -3
- data/test/cli/test_cli.rb +1 -3
- data/test/cli/test_error_handler.rb +1 -3
- data/test/cli/test_logger.rb +1 -3
- data/test/data_sources/test_filesystem.rb +1 -3
- data/test/data_sources/test_filesystem_unified.rb +1 -3
- data/test/data_sources/test_filesystem_verbose.rb +1 -3
- data/test/data_sources/test_static.rb +1 -3
- data/test/extra/checking/checks/test_css.rb +1 -3
- data/test/extra/checking/checks/test_external_links.rb +20 -43
- data/test/extra/checking/checks/test_html.rb +1 -3
- data/test/extra/checking/checks/test_internal_links.rb +1 -3
- data/test/extra/checking/checks/test_stale.rb +1 -3
- data/test/extra/checking/test_check.rb +1 -3
- data/test/extra/checking/test_dsl.rb +1 -3
- data/test/extra/checking/test_runner.rb +1 -3
- data/test/extra/core_ext/test_enumerable.rb +1 -3
- data/test/extra/core_ext/test_pathname.rb +1 -3
- data/test/extra/core_ext/test_time.rb +1 -3
- data/test/extra/deployers/test_fog.rb +1 -3
- data/test/extra/deployers/test_rsync.rb +1 -3
- data/test/extra/test_auto_compiler.rb +1 -3
- data/test/extra/test_file_proxy.rb +1 -3
- data/test/extra/test_link_collector.rb +1 -3
- data/test/extra/test_vcs.rb +1 -3
- data/test/extra/validators/test_links.rb +1 -3
- data/test/extra/validators/test_w3c.rb +1 -3
- data/test/filters/test_asciidoc.rb +1 -3
- data/test/filters/test_bluecloth.rb +1 -3
- data/test/filters/test_coderay.rb +1 -3
- data/test/filters/test_coffeescript.rb +1 -3
- data/test/filters/test_colorize_syntax.rb +3 -16
- data/test/filters/test_erb.rb +1 -3
- data/test/filters/test_erubis.rb +1 -3
- data/test/filters/test_haml.rb +1 -3
- data/test/filters/test_handlebars.rb +1 -3
- data/test/filters/test_kramdown.rb +1 -3
- data/test/filters/test_less.rb +1 -3
- data/test/filters/test_markaby.rb +1 -3
- data/test/filters/test_maruku.rb +1 -3
- data/test/filters/test_mustache.rb +1 -3
- data/test/filters/test_pandoc.rb +1 -3
- data/test/filters/test_rainpress.rb +1 -3
- data/test/filters/test_rdiscount.rb +1 -3
- data/test/filters/test_rdoc.rb +6 -10
- data/test/filters/test_redcarpet.rb +1 -3
- data/test/filters/test_redcloth.rb +1 -3
- data/test/filters/test_relativize_paths.rb +2 -9
- data/test/filters/test_rubypants.rb +1 -3
- data/test/filters/test_sass.rb +1 -3
- data/test/filters/test_slim.rb +1 -3
- data/test/filters/test_typogruby.rb +1 -3
- data/test/filters/test_uglify_js.rb +1 -3
- data/test/filters/test_xsl.rb +1 -3
- data/test/filters/test_yui_compressor.rb +1 -3
- data/test/helper.rb +6 -0
- data/test/helpers/test_blogging.rb +1 -3
- data/test/helpers/test_breadcrumbs.rb +21 -59
- data/test/helpers/test_capturing.rb +1 -3
- data/test/helpers/test_filtering.rb +1 -3
- data/test/helpers/test_html_escape.rb +1 -3
- data/test/helpers/test_link_to.rb +1 -3
- data/test/helpers/test_rendering.rb +1 -3
- data/test/helpers/test_tagging.rb +1 -3
- data/test/helpers/test_text.rb +1 -3
- data/test/helpers/test_xml_sitemap.rb +1 -3
- data/test/tasks/test_clean.rb +1 -3
- data/test/test_gem.rb +1 -3
- metadata +7 -20
data/test/cli/test_logger.rb
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
class Nanoc::DataSources::FilesystemTest <
|
|
4
|
-
|
|
5
|
-
include Nanoc::TestHelpers
|
|
3
|
+
class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
|
|
6
4
|
|
|
7
5
|
class SampleFilesystemDataSource < Nanoc::DataSource
|
|
8
6
|
include Nanoc::DataSources::Filesystem
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
class Nanoc::Extra::Checking::Checks::ExternalLinksTest <
|
|
4
|
-
|
|
5
|
-
include Nanoc::TestHelpers
|
|
6
|
-
|
|
7
|
-
def setup
|
|
8
|
-
super
|
|
9
|
-
require 'timeout'
|
|
10
|
-
end
|
|
3
|
+
class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
|
|
11
4
|
|
|
12
5
|
def test_run
|
|
13
6
|
with_site do |site|
|
|
14
7
|
# Create files
|
|
15
8
|
FileUtils.mkdir_p('output')
|
|
16
|
-
FileUtils.mkdir_p('output/stuff')
|
|
17
9
|
File.open('output/foo.txt', 'w') { |io| io.write('<a href="http://example.com/404">broken</a>') }
|
|
18
10
|
File.open('output/bar.html', 'w') { |io| io.write('<a href="http://example.com/">not broken</a>') }
|
|
19
11
|
|
|
20
12
|
# Create check
|
|
21
|
-
check = Nanoc::Extra::Checking::Checks::
|
|
13
|
+
check = Nanoc::Extra::Checking::Checks::ExternalLinks.new(site)
|
|
14
|
+
def check.request_url_once(url)
|
|
15
|
+
Net::HTTPResponse.new('1.1', url.path == '/' ? '200' : '404', 'okay')
|
|
16
|
+
end
|
|
22
17
|
check.run
|
|
23
18
|
|
|
24
19
|
# Test
|
|
@@ -28,49 +23,31 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < MiniTest::Unit::TestCa
|
|
|
28
23
|
|
|
29
24
|
def test_valid?
|
|
30
25
|
with_site do |site|
|
|
31
|
-
# Create files
|
|
32
|
-
FileUtils.mkdir_p('output')
|
|
33
|
-
FileUtils.mkdir_p('output/stuff')
|
|
34
|
-
File.open('output/origin', 'w') { |io| io.write('hi') }
|
|
35
|
-
File.open('output/foo', 'w') { |io| io.write('hi') }
|
|
36
|
-
File.open('output/stuff/blah', 'w') { |io| io.write('hi') }
|
|
37
|
-
|
|
38
26
|
# Create check
|
|
39
27
|
check = Nanoc::Extra::Checking::Checks::ExternalLinks.new(site)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
self.run_server_while do
|
|
43
|
-
assert ok?(check, 'http://127.0.0.1:9204/200')
|
|
44
|
-
assert ok?(check, 'foo://example.com/')
|
|
45
|
-
refute ok?(check, 'http://127.0.0.1:9204">')
|
|
28
|
+
def check.request_url_once(url)
|
|
29
|
+
Net::HTTPResponse.new('1.1', url.path == '/200' ? '200' : '404', 'okay')
|
|
46
30
|
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
31
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
check.validate(
|
|
32
|
+
# Test
|
|
33
|
+
assert_nil check.validate('http://127.0.0.1:9204/200')
|
|
34
|
+
assert_nil check.validate('foo://example.com/')
|
|
35
|
+
refute_nil check.validate('http://127.0.0.1:9204">')
|
|
53
36
|
end
|
|
54
37
|
end
|
|
55
38
|
|
|
56
|
-
def
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@server = server
|
|
39
|
+
def test_fallback_to_get_when_head_is_not_allowed
|
|
40
|
+
with_site do |site|
|
|
41
|
+
#Create check
|
|
42
|
+
check = Nanoc::Extra::Checking::Checks::ExternalLinks.new(site)
|
|
43
|
+
def check.request_url_once(url, req_method = Net::HTTP::Head)
|
|
44
|
+
Net::HTTPResponse.new('1.1', (req_method == Net::HTTP::Head || url.path == '/405') ? '405' : '200', 'okay')
|
|
63
45
|
end
|
|
64
|
-
end
|
|
65
46
|
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
#Test
|
|
48
|
+
assert_nil check.validate('http://127.0.0.1:9204')
|
|
49
|
+
refute_nil check.validate('http://127.0.0.1:9204/405')
|
|
68
50
|
end
|
|
69
|
-
|
|
70
|
-
yield
|
|
71
|
-
|
|
72
|
-
@server.stop
|
|
73
|
-
@thread.kill
|
|
74
51
|
end
|
|
75
52
|
|
|
76
53
|
end
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
class Nanoc::Extra::CoreExtPathnameTest <
|
|
4
|
-
|
|
5
|
-
include Nanoc::TestHelpers
|
|
3
|
+
class Nanoc::Extra::CoreExtPathnameTest < Nanoc::TestCase
|
|
6
4
|
|
|
7
5
|
def test_components
|
|
8
6
|
assert_equal %w( / a bb ccc dd e ), Pathname.new('/a/bb/ccc/dd/e').components
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
class Nanoc::ExtraCoreExtTimeTest <
|
|
4
|
-
|
|
5
|
-
include Nanoc::TestHelpers
|
|
3
|
+
class Nanoc::ExtraCoreExtTimeTest < Nanoc::TestCase
|
|
6
4
|
|
|
7
5
|
def test_to_iso8601_date
|
|
8
6
|
assert_equal('2008-05-19', Time.utc(2008, 5, 19, 14, 20, 0, 0).to_iso8601_date)
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
class Nanoc::Extra::AutoCompilerTest <
|
|
4
|
-
|
|
5
|
-
include Nanoc::TestHelpers
|
|
3
|
+
class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
6
4
|
|
|
7
5
|
def test_handle_request_with_item_rep_with_index_filename
|
|
8
6
|
if_have 'mime/types', 'rack' do
|
data/test/extra/test_vcs.rb
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
class Nanoc::Filters::ColorizeSyntaxTest <
|
|
4
|
-
|
|
5
|
-
include Nanoc::TestHelpers
|
|
3
|
+
class Nanoc::Filters::ColorizeSyntaxTest < Nanoc::TestCase
|
|
6
4
|
|
|
7
5
|
CODERAY_PRE = '<div class="CodeRay"><div class="code">'
|
|
8
6
|
CODERAY_POST = '</div></div>'
|
|
@@ -54,22 +52,11 @@ class Nanoc::Filters::ColorizeSyntaxTest < MiniTest::Unit::TestCase
|
|
|
54
52
|
</body>
|
|
55
53
|
</html>
|
|
56
54
|
EOS
|
|
57
|
-
|
|
58
|
-
<!DOCTYPE html>
|
|
59
|
-
<html>
|
|
60
|
-
<head>
|
|
61
|
-
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
|
|
62
|
-
<title>Foo</title>
|
|
63
|
-
</head>
|
|
64
|
-
<body>
|
|
65
|
-
<pre title="moo"><code class="language-ruby"># comment</code></pre>
|
|
66
|
-
</body>
|
|
67
|
-
</html>
|
|
68
|
-
EOS
|
|
55
|
+
expected_output_regex = %r[^<!DOCTYPE html>\s*<html>\s*<head>\s*<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\s*<title>Foo</title>\s*</head>\s*<body>\s*<pre title="moo"><code class="language-ruby"># comment</code></pre>\s*</body>\s*</html>]
|
|
69
56
|
|
|
70
57
|
# Run filter
|
|
71
58
|
actual_output = filter.setup_and_run(input, :default_colorizer => :dummy, :is_fullpage => true)
|
|
72
|
-
|
|
59
|
+
assert_match expected_output_regex, actual_output
|
|
73
60
|
end
|
|
74
61
|
end
|
|
75
62
|
|
data/test/filters/test_erb.rb
CHANGED
data/test/filters/test_erubis.rb
CHANGED