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.
Files changed (120) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile.lock +4 -4
  3. data/LICENSE +1 -1
  4. data/NEWS.md +17 -0
  5. data/lib/nanoc.rb +1 -1
  6. data/lib/nanoc/base/result_data/item_rep.rb +20 -12
  7. data/lib/nanoc/base/source_data/item_array.rb +1 -1
  8. data/lib/nanoc/cli/commands/check.rb +1 -1
  9. data/lib/nanoc/cli/commands/deploy.rb +32 -23
  10. data/lib/nanoc/cli/commands/prune.rb +2 -2
  11. data/lib/nanoc/cli/commands/validate-css.rb +1 -0
  12. data/lib/nanoc/cli/commands/validate-html.rb +1 -0
  13. data/lib/nanoc/cli/commands/validate-links.rb +2 -0
  14. data/lib/nanoc/cli/commands/watch.rb +1 -1
  15. data/lib/nanoc/extra/checking/checks/external_links.rb +5 -2
  16. data/lib/nanoc/extra/checking/runner.rb +9 -4
  17. data/lib/nanoc/filters/rdoc.rb +9 -2
  18. data/lib/nanoc/helpers/breadcrumbs.rb +10 -15
  19. data/nanoc.gemspec +3 -2
  20. data/test/base/test_checksum_store.rb +1 -3
  21. data/test/base/test_code_snippet.rb +1 -3
  22. data/test/base/test_compiler.rb +24 -3
  23. data/test/base/test_compiler_dsl.rb +1 -3
  24. data/test/base/test_context.rb +1 -3
  25. data/test/base/test_data_source.rb +1 -3
  26. data/test/base/test_dependency_tracker.rb +1 -3
  27. data/test/base/test_directed_graph.rb +1 -3
  28. data/test/base/test_filter.rb +1 -3
  29. data/test/base/test_item.rb +1 -3
  30. data/test/base/test_item_array.rb +1 -3
  31. data/test/base/test_item_rep.rb +1 -3
  32. data/test/base/test_layout.rb +1 -3
  33. data/test/base/test_memoization.rb +1 -3
  34. data/test/base/test_notification_center.rb +1 -3
  35. data/test/base/test_outdatedness_checker.rb +1 -3
  36. data/test/base/test_plugin.rb +1 -3
  37. data/test/base/test_rule.rb +1 -3
  38. data/test/base/test_rule_context.rb +1 -3
  39. data/test/base/test_site.rb +1 -3
  40. data/test/cli/commands/test_check.rb +1 -3
  41. data/test/cli/commands/test_compile.rb +1 -3
  42. data/test/cli/commands/test_create_item.rb +1 -3
  43. data/test/cli/commands/test_create_layout.rb +1 -3
  44. data/test/cli/commands/test_create_site.rb +1 -3
  45. data/test/cli/commands/test_deploy.rb +45 -4
  46. data/test/cli/commands/test_help.rb +1 -3
  47. data/test/cli/commands/test_info.rb +1 -3
  48. data/test/cli/commands/test_prune.rb +1 -3
  49. data/test/cli/commands/test_sync.rb +1 -3
  50. data/test/cli/commands/test_update.rb +1 -3
  51. data/test/cli/commands/test_watch.rb +1 -3
  52. data/test/cli/test_cleaning_stream.rb +1 -3
  53. data/test/cli/test_cli.rb +1 -3
  54. data/test/cli/test_error_handler.rb +1 -3
  55. data/test/cli/test_logger.rb +1 -3
  56. data/test/data_sources/test_filesystem.rb +1 -3
  57. data/test/data_sources/test_filesystem_unified.rb +1 -3
  58. data/test/data_sources/test_filesystem_verbose.rb +1 -3
  59. data/test/data_sources/test_static.rb +1 -3
  60. data/test/extra/checking/checks/test_css.rb +1 -3
  61. data/test/extra/checking/checks/test_external_links.rb +20 -43
  62. data/test/extra/checking/checks/test_html.rb +1 -3
  63. data/test/extra/checking/checks/test_internal_links.rb +1 -3
  64. data/test/extra/checking/checks/test_stale.rb +1 -3
  65. data/test/extra/checking/test_check.rb +1 -3
  66. data/test/extra/checking/test_dsl.rb +1 -3
  67. data/test/extra/checking/test_runner.rb +1 -3
  68. data/test/extra/core_ext/test_enumerable.rb +1 -3
  69. data/test/extra/core_ext/test_pathname.rb +1 -3
  70. data/test/extra/core_ext/test_time.rb +1 -3
  71. data/test/extra/deployers/test_fog.rb +1 -3
  72. data/test/extra/deployers/test_rsync.rb +1 -3
  73. data/test/extra/test_auto_compiler.rb +1 -3
  74. data/test/extra/test_file_proxy.rb +1 -3
  75. data/test/extra/test_link_collector.rb +1 -3
  76. data/test/extra/test_vcs.rb +1 -3
  77. data/test/extra/validators/test_links.rb +1 -3
  78. data/test/extra/validators/test_w3c.rb +1 -3
  79. data/test/filters/test_asciidoc.rb +1 -3
  80. data/test/filters/test_bluecloth.rb +1 -3
  81. data/test/filters/test_coderay.rb +1 -3
  82. data/test/filters/test_coffeescript.rb +1 -3
  83. data/test/filters/test_colorize_syntax.rb +3 -16
  84. data/test/filters/test_erb.rb +1 -3
  85. data/test/filters/test_erubis.rb +1 -3
  86. data/test/filters/test_haml.rb +1 -3
  87. data/test/filters/test_handlebars.rb +1 -3
  88. data/test/filters/test_kramdown.rb +1 -3
  89. data/test/filters/test_less.rb +1 -3
  90. data/test/filters/test_markaby.rb +1 -3
  91. data/test/filters/test_maruku.rb +1 -3
  92. data/test/filters/test_mustache.rb +1 -3
  93. data/test/filters/test_pandoc.rb +1 -3
  94. data/test/filters/test_rainpress.rb +1 -3
  95. data/test/filters/test_rdiscount.rb +1 -3
  96. data/test/filters/test_rdoc.rb +6 -10
  97. data/test/filters/test_redcarpet.rb +1 -3
  98. data/test/filters/test_redcloth.rb +1 -3
  99. data/test/filters/test_relativize_paths.rb +2 -9
  100. data/test/filters/test_rubypants.rb +1 -3
  101. data/test/filters/test_sass.rb +1 -3
  102. data/test/filters/test_slim.rb +1 -3
  103. data/test/filters/test_typogruby.rb +1 -3
  104. data/test/filters/test_uglify_js.rb +1 -3
  105. data/test/filters/test_xsl.rb +1 -3
  106. data/test/filters/test_yui_compressor.rb +1 -3
  107. data/test/helper.rb +6 -0
  108. data/test/helpers/test_blogging.rb +1 -3
  109. data/test/helpers/test_breadcrumbs.rb +21 -59
  110. data/test/helpers/test_capturing.rb +1 -3
  111. data/test/helpers/test_filtering.rb +1 -3
  112. data/test/helpers/test_html_escape.rb +1 -3
  113. data/test/helpers/test_link_to.rb +1 -3
  114. data/test/helpers/test_rendering.rb +1 -3
  115. data/test/helpers/test_tagging.rb +1 -3
  116. data/test/helpers/test_text.rb +1 -3
  117. data/test/helpers/test_xml_sitemap.rb +1 -3
  118. data/test/tasks/test_clean.rb +1 -3
  119. data/test/test_gem.rb +1 -3
  120. metadata +7 -20
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::HandlebarsTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::HandlebarsTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'handlebars' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::KramdownTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::KramdownTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'kramdown' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::LessTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::LessTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'less' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::MarkabyTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::MarkabyTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  # Don’t run this test on 1.9.x, because it breaks and it annoys me
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::MarukuTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::MarukuTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'maruku' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::MustacheTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::MustacheTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'mustache' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::PandocTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::PandocTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'pandoc-ruby' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::RainpressTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::RainpressTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'rainpress' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::RDiscountTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::RDiscountTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'rdiscount' do
@@ -1,18 +1,14 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::RDocTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::RDocTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
- if_have 'rdoc' do
9
- # Get filter
10
- filter = ::Nanoc::Filters::RDoc.new
6
+ # Get filter
7
+ filter = ::Nanoc::Filters::RDoc.new
11
8
 
12
- # Run filter
13
- result = filter.setup_and_run("= Foo")
14
- assert_match(%r{<h1( id="label-Foo")?>Foo</h1>\Z}, result)
15
- end
9
+ # Run filter
10
+ result = filter.setup_and_run("= Foo")
11
+ assert_match(%r{\A\s*<h1( id="label-Foo")?>Foo(<span>.*</span>)?</h1>\s*\Z}, result)
16
12
  end
17
13
 
18
14
  end
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::RedcarpetTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::RedcarpetTest < Nanoc::TestCase
6
4
 
7
5
  def test_find
8
6
  if_have 'redcarpet' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::RedClothTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::RedClothTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'redcloth' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::RelativizePathsTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::RelativizePathsTest < Nanoc::TestCase
6
4
 
7
5
 
8
6
  def test_filter_html_with_double_quotes
@@ -746,14 +744,9 @@ XML
746
744
  <![endif]-->
747
745
  ]
748
746
 
749
- expected_content = %[
750
- <!--[if lt IE 9]>
751
- <script src="../../js/lib/html5shiv.js"></script>
752
- <![endif]-->]
753
-
754
747
  # Test
755
748
  actual_content = filter.setup_and_run(raw_content.freeze, :type => :html)
756
- assert_equal(expected_content, actual_content)
749
+ assert actual_content.include? %[<script src="../../js/lib/html5shiv.js">]
757
750
  end
758
751
  end
759
752
 
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::RubyPantsTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::RubyPantsTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'rubypants' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::SassTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::SassTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'sass' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::SlimTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::SlimTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'slim' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::TypogrubyTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::TypogrubyTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'typogruby' do
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::UglifyJSTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::UglifyJSTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter
8
6
  if_have 'uglifier' do
@@ -2,9 +2,7 @@
2
2
 
3
3
  require 'tempfile'
4
4
 
5
- class Nanoc::Filters::XSLTest < MiniTest::Unit::TestCase
6
-
7
- include Nanoc::TestHelpers
5
+ class Nanoc::Filters::XSLTest < Nanoc::TestCase
8
6
 
9
7
  SAMPLE_XSL = <<-EOS
10
8
  <?xml version="1.0" encoding="utf-8"?>
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Filters::YUICompressorTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Filters::YUICompressorTest < Nanoc::TestCase
6
4
 
7
5
  def test_filter_javascript
8
6
  if_have 'yuicompressor' do
@@ -207,6 +207,12 @@ EOS
207
207
 
208
208
  end
209
209
 
210
+ class Nanoc::TestCase < MiniTest::Unit::TestCase
211
+
212
+ include Nanoc::TestHelpers
213
+
214
+ end
215
+
210
216
  # Unexpected system exit is unexpected
211
217
  ::MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.delete(SystemExit)
212
218
 
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::BloggingTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::BloggingTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::Blogging
8
6
  include Nanoc::Helpers::Text
@@ -1,81 +1,43 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::BreadcrumbsTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::BreadcrumbsTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::Breadcrumbs
8
6
 
9
7
  def test_breadcrumbs_trail_at_root
10
- # Mock item
11
- @item = mock
12
- @item.stubs(:identifier).returns('/')
13
- @items = [ @item ]
14
-
15
- # Build trail
16
- trail = breadcrumbs_trail
8
+ @items = Nanoc::ItemArray.new
9
+ @items << Nanoc::Item.new("root", {}, '/')
10
+ @item = @items.last
17
11
 
18
- # Check
19
- assert_equal(
20
- [ @item ],
21
- trail
22
- )
12
+ assert_equal [ @items[0] ], breadcrumbs_trail
23
13
  end
24
14
 
25
15
  def test_breadcrumbs_trail_with_1_parent
26
- # Mock item
27
- parent = mock
28
- parent.stubs(:identifier).returns('/')
29
- @item = mock
30
- @item.stubs(:identifier).returns('/foo/')
31
- @items = [ parent, @item ]
32
-
33
- # Build trail
34
- trail = breadcrumbs_trail
16
+ @items = Nanoc::ItemArray.new
17
+ @items << Nanoc::Item.new("parent", {}, '/')
18
+ @items << Nanoc::Item.new("child", {}, '/foo/')
19
+ @item = @items.last
35
20
 
36
- # Check
37
- assert_equal(
38
- [ parent, @item ],
39
- trail
40
- )
21
+ assert_equal [ @items[0], @items[1] ], breadcrumbs_trail
41
22
  end
42
23
 
43
24
  def test_breadcrumbs_trail_with_many_parents
44
- # Mock item
45
- grandparent = mock
46
- grandparent.stubs(:identifier).returns('/')
47
- parent = mock
48
- parent.stubs(:identifier).returns('/foo/')
49
- @item = mock
50
- @item.stubs(:identifier).returns('/foo/bar/')
51
- @items = [ grandparent, parent, @item ]
25
+ @items = Nanoc::ItemArray.new
26
+ @items << Nanoc::Item.new("grandparent", {}, '/')
27
+ @items << Nanoc::Item.new("parent", {}, '/foo/')
28
+ @items << Nanoc::Item.new("child", {}, '/foo/bar/')
29
+ @item = @items.last
52
30
 
53
- # Build trail
54
- trail = breadcrumbs_trail
55
-
56
- # Check
57
- assert_equal(
58
- [ grandparent, parent, @item ],
59
- trail
60
- )
31
+ assert_equal [ @items[0], @items[1], @items[2] ], breadcrumbs_trail
61
32
  end
62
33
 
63
34
  def test_breadcrumbs_trail_with_nils
64
- # Mock item
65
- grandparent = mock
66
- grandparent.stubs(:identifier).returns('/')
67
- @item = mock
68
- @item.stubs(:identifier).returns('/foo/bar/')
69
- @items = [ grandparent, @item ]
70
-
71
- # Build trail
72
- trail = breadcrumbs_trail
35
+ @items = Nanoc::ItemArray.new
36
+ @items << Nanoc::Item.new("grandparent", {}, '/')
37
+ @items << Nanoc::Item.new("child", {}, '/foo/bar/')
38
+ @item = @items.last
73
39
 
74
- # Check
75
- assert_equal(
76
- [ grandparent, nil, @item ],
77
- trail
78
- )
40
+ assert_equal [ @items[0], nil, @items[1] ], breadcrumbs_trail
79
41
  end
80
42
 
81
43
  end
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::CapturingTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::Capturing
8
6
 
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::FilteringTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::FilteringTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::Filtering
8
6
 
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::HTMLEscapeTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::HTMLEscapeTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::HTMLEscape
8
6
 
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::LinkToTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::LinkTo
8
6
 
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::RenderingTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::Rendering
8
6
 
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::TaggingTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::Tagging
8
6
 
@@ -1,8 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- class Nanoc::Helpers::TextTest < MiniTest::Unit::TestCase
4
-
5
- include Nanoc::TestHelpers
3
+ class Nanoc::Helpers::TextTest < Nanoc::TestCase
6
4
 
7
5
  include Nanoc::Helpers::Text
8
6