nanoc 4.3.7 → 4.3.8

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +11 -0
  3. data/Gemfile +6 -6
  4. data/Gemfile.lock +32 -18
  5. data/NEWS.md +14 -0
  6. data/Rakefile +30 -1
  7. data/lib/nanoc.rb +3 -0
  8. data/lib/nanoc/base/checksummer.rb +28 -0
  9. data/lib/nanoc/base/compilation/compiler.rb +34 -20
  10. data/lib/nanoc/base/compilation/filter.rb +1 -1
  11. data/lib/nanoc/base/context.rb +5 -0
  12. data/lib/nanoc/base/entities/item_rep.rb +2 -13
  13. data/lib/nanoc/base/services.rb +1 -0
  14. data/lib/nanoc/base/services/compiler_loader.rb +2 -2
  15. data/lib/nanoc/{extra → base/services}/pruner.rb +56 -48
  16. data/lib/nanoc/checking.rb +11 -0
  17. data/lib/nanoc/{extra/checking → checking}/check.rb +3 -3
  18. data/lib/nanoc/checking/checks.rb +20 -0
  19. data/lib/nanoc/{extra/checking → checking}/checks/css.rb +2 -2
  20. data/lib/nanoc/{extra/checking → checking}/checks/external_links.rb +2 -2
  21. data/lib/nanoc/{extra/checking → checking}/checks/html.rb +2 -2
  22. data/lib/nanoc/{extra/checking → checking}/checks/internal_links.rb +2 -2
  23. data/lib/nanoc/{extra/checking → checking}/checks/mixed_content.rb +2 -2
  24. data/lib/nanoc/{extra/checking → checking}/checks/stale.rb +4 -3
  25. data/lib/nanoc/{extra/checking → checking}/checks/w3c_validator.rb +2 -2
  26. data/lib/nanoc/{extra/checking → checking}/dsl.rb +2 -2
  27. data/lib/nanoc/{extra/checking → checking}/issue.rb +1 -1
  28. data/lib/nanoc/{extra/checking → checking}/runner.rb +4 -4
  29. data/lib/nanoc/cli/cleaning_stream.rb +1 -1
  30. data/lib/nanoc/cli/commands/check.rb +1 -1
  31. data/lib/nanoc/cli/commands/compile.rb +62 -56
  32. data/lib/nanoc/cli/commands/deploy.rb +4 -4
  33. data/lib/nanoc/cli/commands/prune.rb +2 -2
  34. data/lib/nanoc/cli/commands/show-plugins.rb +4 -4
  35. data/lib/nanoc/data_sources/filesystem.rb +3 -1
  36. data/lib/nanoc/{extra/filesystem_tools.rb → data_sources/filesystem/tools.rb} +20 -15
  37. data/lib/nanoc/deploying.rb +8 -0
  38. data/lib/nanoc/{extra → deploying}/deployer.rb +2 -2
  39. data/lib/nanoc/deploying/deployers.rb +10 -0
  40. data/lib/nanoc/{extra → deploying}/deployers/fog.rb +3 -3
  41. data/lib/nanoc/{extra → deploying}/deployers/rsync.rb +3 -3
  42. data/lib/nanoc/extra.rb +9 -5
  43. data/lib/nanoc/filters/colorize_syntax.rb +15 -4
  44. data/lib/nanoc/filters/rdoc.rb +0 -5
  45. data/lib/nanoc/helpers/capturing.rb +2 -1
  46. data/lib/nanoc/rule_dsl/recording_executor.rb +7 -1
  47. data/lib/nanoc/spec.rb +10 -34
  48. data/lib/nanoc/version.rb +1 -1
  49. data/nanoc.gemspec +2 -1
  50. data/test/base/test_context.rb +6 -0
  51. data/test/base/test_dependency_tracker.rb +0 -18
  52. data/test/base/test_item_rep.rb +2 -2
  53. data/test/{extra/checking → checking}/checks/test_css.rb +4 -4
  54. data/test/{extra/checking → checking}/checks/test_external_links.rb +8 -8
  55. data/test/{extra/checking → checking}/checks/test_html.rb +3 -3
  56. data/test/{extra/checking → checking}/checks/test_internal_links.rb +9 -9
  57. data/test/{extra/checking → checking}/checks/test_mixed_content.rb +9 -9
  58. data/test/{extra/checking → checking}/checks/test_stale.rb +3 -3
  59. data/test/{extra/checking → checking}/test_check.rb +4 -4
  60. data/test/{extra/checking → checking}/test_dsl.rb +5 -5
  61. data/test/{extra/checking → checking}/test_runner.rb +4 -4
  62. data/test/data_sources/test_filesystem.rb +0 -18
  63. data/test/{extra → data_sources}/test_filesystem_tools.rb +13 -13
  64. data/test/{extra/deployers → deploying}/test_fog.rb +8 -8
  65. data/test/{extra/deployers → deploying}/test_rsync.rb +7 -7
  66. data/test/filters/{test_colorize_syntax.rb → colorize_syntax/test_coderay.rb} +1 -177
  67. data/test/filters/colorize_syntax/test_common.rb +81 -0
  68. data/test/filters/colorize_syntax/test_pygmentize.rb +35 -0
  69. data/test/filters/colorize_syntax/test_pygments.rb +17 -0
  70. data/test/filters/colorize_syntax/test_simon.rb +20 -0
  71. data/test/filters/test_less.rb +0 -55
  72. metadata +55 -43
  73. data/ChangeLog +0 -3
  74. data/doc/yardoc_handlers/identifier.rb +0 -30
  75. data/doc/yardoc_templates/default/layout/html/footer.erb +0 -19
  76. data/lib/nanoc/extra/checking.rb +0 -11
  77. data/lib/nanoc/extra/checking/checks.rb +0 -20
  78. data/lib/nanoc/extra/deployers.rb +0 -10
  79. data/tasks/doc.rake +0 -16
  80. data/tasks/rubocop.rake +0 -6
  81. data/tasks/test.rake +0 -25
  82. data/test/base/temp_filename_factory_spec.rb +0 -66
@@ -1,4 +1,4 @@
1
- class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
1
+ class Nanoc::Checking::Checks::CSSTest < Nanoc::TestCase
2
2
  def test_run_ok
3
3
  VCR.use_cassette('css_run_ok') do
4
4
  with_site do |site|
@@ -8,7 +8,7 @@ class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
8
8
  File.open('output/style.css', 'w') { |io| io.write('h1 { color: red; }') }
9
9
 
10
10
  # Run check
11
- check = Nanoc::Extra::Checking::Checks::CSS.create(site)
11
+ check = Nanoc::Checking::Checks::CSS.create(site)
12
12
  check.run
13
13
 
14
14
  # Check
@@ -26,7 +26,7 @@ class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
26
26
  File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
27
27
 
28
28
  # Run check
29
- check = Nanoc::Extra::Checking::Checks::CSS.create(site)
29
+ check = Nanoc::Checking::Checks::CSS.create(site)
30
30
  check.run
31
31
 
32
32
  # Check
@@ -49,7 +49,7 @@ class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
49
49
  File.open('output/style.css', 'w') { |io| io.write('h1 { ; {') }
50
50
 
51
51
  # Run check
52
- check = Nanoc::Extra::Checking::Checks::CSS.create(site)
52
+ check = Nanoc::Checking::Checks::CSS.create(site)
53
53
  check.run
54
54
 
55
55
  # Check
@@ -1,4 +1,4 @@
1
- class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
1
+ class Nanoc::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
2
2
  def test_run
3
3
  with_site do |site|
4
4
  # Create files
@@ -7,7 +7,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
7
7
  File.open('output/bar.html', 'w') { |io| io.write('<a href="http://example.com/">not broken</a>') }
8
8
 
9
9
  # Create check
10
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
10
+ check = Nanoc::Checking::Checks::ExternalLinks.create(site)
11
11
  def check.request_url_once(url)
12
12
  Net::HTTPResponse.new('1.1', url.path == '/' ? '200' : '404', 'okay')
13
13
  end
@@ -21,7 +21,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
21
21
  def test_valid_by_path
22
22
  with_site do |site|
23
23
  # Create check
24
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
24
+ check = Nanoc::Checking::Checks::ExternalLinks.create(site)
25
25
  def check.request_url_once(url)
26
26
  Net::HTTPResponse.new('1.1', url.path == '/200' ? '200' : '404', 'okay')
27
27
  end
@@ -36,7 +36,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
36
36
  def test_valid_by_query
37
37
  with_site do |site|
38
38
  # Create check
39
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
39
+ check = Nanoc::Checking::Checks::ExternalLinks.create(site)
40
40
  def check.request_url_once(url)
41
41
  Net::HTTPResponse.new('1.1', url.query == 'status=200' ? '200' : '404', 'okay')
42
42
  end
@@ -50,7 +50,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
50
50
  def test_fallback_to_get_when_head_is_not_allowed
51
51
  with_site do |site|
52
52
  # Create check
53
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
53
+ check = Nanoc::Checking::Checks::ExternalLinks.create(site)
54
54
  def check.request_url_once(url, req_method = Net::HTTP::Head)
55
55
  Net::HTTPResponse.new('1.1', req_method == Net::HTTP::Head || url.path == '/405' ? '405' : '200', 'okay')
56
56
  end
@@ -63,7 +63,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
63
63
 
64
64
  def test_path_for_url
65
65
  with_site do |site|
66
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
66
+ check = Nanoc::Checking::Checks::ExternalLinks.create(site)
67
67
 
68
68
  assert_equal '/', check.send(:path_for_url, URI.parse('http://example.com'))
69
69
  assert_equal '/', check.send(:path_for_url, URI.parse('http://example.com/'))
@@ -76,7 +76,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
76
76
  def test_excluded
77
77
  with_site do |site|
78
78
  # Create check
79
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
79
+ check = Nanoc::Checking::Checks::ExternalLinks.create(site)
80
80
  site.config.update({ checks: { external_links: { exclude: ['^http://excluded.com$'] } } })
81
81
 
82
82
  # Test
@@ -89,7 +89,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
89
89
  def test_excluded_file
90
90
  with_site do |site|
91
91
  # Create check
92
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
92
+ check = Nanoc::Checking::Checks::ExternalLinks.create(site)
93
93
  site.config.update({ checks: { external_links: { exclude_files: ['blog/page'] } } })
94
94
 
95
95
  # Test
@@ -1,4 +1,4 @@
1
- class Nanoc::Extra::Checking::Checks::HTMLTest < Nanoc::TestCase
1
+ class Nanoc::Checking::Checks::HTMLTest < Nanoc::TestCase
2
2
  def test_run_ok
3
3
  VCR.use_cassette('html_run_ok') do
4
4
  with_site do |site|
@@ -8,7 +8,7 @@ class Nanoc::Extra::Checking::Checks::HTMLTest < Nanoc::TestCase
8
8
  File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
9
9
 
10
10
  # Run check
11
- check = Nanoc::Extra::Checking::Checks::HTML.create(site)
11
+ check = Nanoc::Checking::Checks::HTML.create(site)
12
12
  check.run
13
13
 
14
14
  # Check
@@ -26,7 +26,7 @@ class Nanoc::Extra::Checking::Checks::HTMLTest < Nanoc::TestCase
26
26
  File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
27
27
 
28
28
  # Run check
29
- check = Nanoc::Extra::Checking::Checks::HTML.create(site)
29
+ check = Nanoc::Checking::Checks::HTML.create(site)
30
30
  check.run
31
31
 
32
32
  # Check
@@ -1,4 +1,4 @@
1
- class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
1
+ class Nanoc::Checking::Checks::InternalLinksTest < Nanoc::TestCase
2
2
  def test_run
3
3
  with_site do |site|
4
4
  # Create files
@@ -8,7 +8,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
8
8
  File.open('output/bar.html', 'w') { |io| io.write('<a href="/foo.txt">not broken</a>') }
9
9
 
10
10
  # Create check
11
- check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
11
+ check = Nanoc::Checking::Checks::InternalLinks.create(site)
12
12
  check.run
13
13
 
14
14
  # Test
@@ -23,7 +23,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
23
23
  File.open('output/bar.html', 'w') { |io| io.write('<link rel="stylesheet" href="/styledinges.css">') }
24
24
 
25
25
  # Create check
26
- check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
26
+ check = Nanoc::Checking::Checks::InternalLinks.create(site)
27
27
  check.run
28
28
 
29
29
  # Test
@@ -41,7 +41,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
41
41
  File.open('output/stuff/blah', 'w') { |io| io.write('hi') }
42
42
 
43
43
  # Create check
44
- check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
44
+ check = Nanoc::Checking::Checks::InternalLinks.create(site)
45
45
 
46
46
  # Test
47
47
  assert check.send(:valid?, 'foo', 'output/origin')
@@ -58,7 +58,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
58
58
  FileUtils.mkdir_p('output/stuff')
59
59
  File.open('output/stuff/right', 'w') { |io| io.write('hi') }
60
60
 
61
- check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
61
+ check = Nanoc::Checking::Checks::InternalLinks.create(site)
62
62
 
63
63
  assert check.send(:valid?, 'stuff/right?foo=123', 'output/origin')
64
64
  refute check.send(:valid?, 'stuff/wrong?foo=123', 'output/origin')
@@ -68,7 +68,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
68
68
  def test_exclude
69
69
  with_site do |site|
70
70
  # Create check
71
- check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
71
+ check = Nanoc::Checking::Checks::InternalLinks.create(site)
72
72
  site.config.update({ checks: { internal_links: { exclude: ['^/excluded\d+'] } } })
73
73
 
74
74
  # Test
@@ -81,7 +81,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
81
81
  def test_exclude_targets
82
82
  with_site do |site|
83
83
  # Create check
84
- check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
84
+ check = Nanoc::Checking::Checks::InternalLinks.create(site)
85
85
  site.config.update({ checks: { internal_links: { exclude_targets: ['^/excluded\d+'] } } })
86
86
 
87
87
  # Test
@@ -94,7 +94,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
94
94
  def test_exclude_origins
95
95
  with_site do |site|
96
96
  # Create check
97
- check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
97
+ check = Nanoc::Checking::Checks::InternalLinks.create(site)
98
98
  site.config.update({ checks: { internal_links: { exclude_origins: ['^/excluded'] } } })
99
99
 
100
100
  # Test
@@ -108,7 +108,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
108
108
  FileUtils.mkdir_p('output/stuff')
109
109
  File.open('output/stuff/right foo', 'w') { |io| io.write('hi') }
110
110
 
111
- check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
111
+ check = Nanoc::Checking::Checks::InternalLinks.create(site)
112
112
 
113
113
  assert check.send(:valid?, 'stuff/right%20foo', 'output/origin')
114
114
  refute check.send(:valid?, 'stuff/wrong%20foo', 'output/origin')
@@ -1,4 +1,4 @@
1
- class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
1
+ class Nanoc::Checking::Checks::MixedContentTest < Nanoc::TestCase
2
2
  def create_output_file(name, lines)
3
3
  FileUtils.mkdir_p('output')
4
4
  File.open('output/' + name, 'w') do |io|
@@ -22,7 +22,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
22
22
  '<audio src="https://nanoc.ws/theme-song.flac"></audio>',
23
23
  '<video src="https://nanoc.ws/screen-cast.mkv"></video>',
24
24
  ])
25
- check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
25
+ check = Nanoc::Checking::Checks::MixedContent.create(site)
26
26
  check.run
27
27
 
28
28
  assert_empty check.issues
@@ -40,7 +40,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
40
40
  '<audio src="/theme-song.flac"></audio>',
41
41
  '<video src="/screen-cast.mkv"></video>',
42
42
  ])
43
- check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
43
+ check = Nanoc::Checking::Checks::MixedContent.create(site)
44
44
  check.run
45
45
 
46
46
  assert_empty check.issues
@@ -58,7 +58,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
58
58
  '<audio src="//nanoc.ws/theme-song.flac"></audio>',
59
59
  '<video src="//nanoc.ws/screen-cast.mkv"></video>',
60
60
  ])
61
- check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
61
+ check = Nanoc::Checking::Checks::MixedContent.create(site)
62
62
  check.run
63
63
 
64
64
  assert_empty check.issues
@@ -76,7 +76,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
76
76
  '<audio src="theme-song.flac"></audio>',
77
77
  '<video src="screen-cast.mkv"></video>',
78
78
  ])
79
- check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
79
+ check = Nanoc::Checking::Checks::MixedContent.create(site)
80
80
  check.run
81
81
 
82
82
  assert_empty check.issues
@@ -94,7 +94,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
94
94
  '<audio src="?query-string"></audio>',
95
95
  '<video src="?query-string"></video>',
96
96
  ])
97
- check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
97
+ check = Nanoc::Checking::Checks::MixedContent.create(site)
98
98
  check.run
99
99
 
100
100
  assert_empty check.issues
@@ -112,7 +112,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
112
112
  '<audio src="#fragment"></audio>',
113
113
  '<video src="#fragment"></video>',
114
114
  ])
115
- check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
115
+ check = Nanoc::Checking::Checks::MixedContent.create(site)
116
116
  check.run
117
117
 
118
118
  assert_empty check.issues
@@ -131,7 +131,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
131
131
  '<audio src="http://nanoc.ws/theme-song.flac"></audio>',
132
132
  '<video src="http://nanoc.ws/screencast.mkv"></video>',
133
133
  ])
134
- check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
134
+ check = Nanoc::Checking::Checks::MixedContent.create(site)
135
135
  check.run
136
136
 
137
137
  issues = check.issues.to_a
@@ -177,7 +177,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
177
177
  '<video target="http://nanoc.ws/screen-cast.mkv"></video>',
178
178
  '<p>http://nanoc.ws/harmless-text</p>',
179
179
  ])
180
- check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
180
+ check = Nanoc::Checking::Checks::MixedContent.create(site)
181
181
  check.run
182
182
 
183
183
  assert_empty check.issues
@@ -1,11 +1,11 @@
1
- class Nanoc::Extra::Checking::Checks::StaleTest < Nanoc::TestCase
1
+ class Nanoc::Checking::Checks::StaleTest < Nanoc::TestCase
2
2
  def check_class
3
- Nanoc::Extra::Checking::Checks::Stale
3
+ Nanoc::Checking::Checks::Stale
4
4
  end
5
5
 
6
6
  def calc_issues
7
7
  site = Nanoc::Int::SiteLoader.new.new_from_cwd
8
- runner = Nanoc::Extra::Checking::Runner.new(site)
8
+ runner = Nanoc::Checking::Runner.new(site)
9
9
  runner.run_checks([check_class])
10
10
  end
11
11
 
@@ -1,8 +1,8 @@
1
- class Nanoc::Extra::Checking::CheckTest < Nanoc::TestCase
1
+ class Nanoc::Checking::CheckTest < Nanoc::TestCase
2
2
  def test_output_filenames
3
3
  with_site do |site|
4
4
  File.open('output/foo.html', 'w') { |io| io.write 'hello' }
5
- check = Nanoc::Extra::Checking::Check.create(site)
5
+ check = Nanoc::Checking::Check.create(site)
6
6
  assert_equal ['output/foo.html'], check.output_filenames
7
7
  end
8
8
  end
@@ -10,8 +10,8 @@ class Nanoc::Extra::Checking::CheckTest < Nanoc::TestCase
10
10
  def test_no_output_dir
11
11
  with_site do |site|
12
12
  site.config[:output_dir] = 'non-existent'
13
- assert_raises Nanoc::Extra::Checking::OutputDirNotFoundError do
14
- Nanoc::Extra::Checking::Check.create(site)
13
+ assert_raises Nanoc::Checking::OutputDirNotFoundError do
14
+ Nanoc::Checking::Check.create(site)
15
15
  end
16
16
  end
17
17
  end
@@ -1,11 +1,11 @@
1
- class Nanoc::Extra::Checking::DSLTest < Nanoc::TestCase
1
+ class Nanoc::Checking::DSLTest < Nanoc::TestCase
2
2
  def test_from_file
3
3
  with_site do |_site|
4
4
  File.open('Checks', 'w') { |io| io.write("check :foo do\n\nend\ndeploy_check :bar\n") }
5
- dsl = Nanoc::Extra::Checking::DSL.from_file('Checks')
5
+ dsl = Nanoc::Checking::DSL.from_file('Checks')
6
6
 
7
7
  # One new check
8
- refute Nanoc::Extra::Checking::Check.named(:foo).nil?
8
+ refute Nanoc::Checking::Check.named(:foo).nil?
9
9
 
10
10
  # One check marked for deployment
11
11
  assert_equal [:bar], dsl.deploy_checks
@@ -16,7 +16,7 @@ class Nanoc::Extra::Checking::DSLTest < Nanoc::TestCase
16
16
  with_site do |_site|
17
17
  File.write('stuff.rb', '$greeting = "hello"')
18
18
  File.write('Checks', 'require "./stuff"')
19
- Nanoc::Extra::Checking::DSL.from_file('Checks')
19
+ Nanoc::Checking::DSL.from_file('Checks')
20
20
  assert_equal 'hello', $greeting
21
21
  end
22
22
  end
@@ -24,7 +24,7 @@ class Nanoc::Extra::Checking::DSLTest < Nanoc::TestCase
24
24
  def test_has_absolute_path
25
25
  with_site do |_site|
26
26
  File.write('Checks', '$stuff = __FILE__')
27
- Nanoc::Extra::Checking::DSL.from_file('Checks')
27
+ Nanoc::Checking::DSL.from_file('Checks')
28
28
  assert($stuff.start_with?('/'))
29
29
  end
30
30
  end
@@ -1,8 +1,8 @@
1
- class Nanoc::Extra::Checking::RunnerTest < Nanoc::TestCase
1
+ class Nanoc::Checking::RunnerTest < Nanoc::TestCase
2
2
  def test_run_specific
3
3
  with_site do |site|
4
4
  File.open('output/blah', 'w') { |io| io.write('I am stale! Haha!') }
5
- runner = Nanoc::Extra::Checking::Runner.new(site)
5
+ runner = Nanoc::Checking::Runner.new(site)
6
6
  runner.run_specific(%w(stale))
7
7
  end
8
8
  end
@@ -13,7 +13,7 @@ class Nanoc::Extra::Checking::RunnerTest < Nanoc::TestCase
13
13
  io.write('check :my_foo_check do ; puts "I AM FOO!" ; end')
14
14
  end
15
15
 
16
- runner = Nanoc::Extra::Checking::Runner.new(site)
16
+ runner = Nanoc::Checking::Runner.new(site)
17
17
  ios = capturing_stdio do
18
18
  runner.run_specific(%w(my_foo_check))
19
19
  end
@@ -28,7 +28,7 @@ class Nanoc::Extra::Checking::RunnerTest < Nanoc::TestCase
28
28
  io.write('check :my_foo_check do ; end')
29
29
  end
30
30
 
31
- runner = Nanoc::Extra::Checking::Runner.new(site)
31
+ runner = Nanoc::Checking::Runner.new(site)
32
32
  ios = capturing_stdio do
33
33
  runner.list_checks
34
34
  end
@@ -483,24 +483,6 @@ class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
483
483
  assert_equal nil, data_source.send(:filename_for, '/foo', nil)
484
484
  end
485
485
 
486
- def test_compile_huge_site
487
- if_implemented do
488
- # Create data source
489
- data_source = new_data_source
490
-
491
- # Create a lot of items
492
- count = Process.getrlimit(Process::RLIMIT_NOFILE)[0] + 5
493
- count.times do |i|
494
- FileUtils.mkdir_p("content/#{i}")
495
- File.open("content/#{i}/#{i}.html", 'w') { |io| io << "This is item #{i}." }
496
- File.open("content/#{i}/#{i}.yaml", 'w') { |io| io << "title: Item #{i}" }
497
- end
498
-
499
- # Read all items
500
- data_source.items
501
- end
502
- end
503
-
504
486
  def test_compile_iso_8859_1_site
505
487
  # Check encoding
506
488
  unless ''.respond_to?(:encode)
@@ -1,4 +1,4 @@
1
- class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
1
+ class Nanoc::DataSources::FilesystemToolsTest < Nanoc::TestCase
2
2
  def setup
3
3
  super
4
4
  skip_unless_symlinks_supported
@@ -30,7 +30,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
30
30
  'dir0/sub/sub/sub/sub/sub/sub/sub/sub/sub/foo.md',
31
31
  'dir0/sub/sub/sub/sub/sub/sub/sub/sub/sub/sub/foo.md',
32
32
  ]
33
- actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir0', nil).sort
33
+ actual_files = Nanoc::DataSources::Filesystem::Tools.all_files_in('dir0', nil).sort
34
34
  assert_equal expected_files, actual_files
35
35
  end
36
36
 
@@ -44,8 +44,8 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
44
44
  File.symlink("../dir#{i}", "dir#{i - 1}/sub")
45
45
  end
46
46
 
47
- assert_raises Nanoc::Extra::FilesystemTools::MaxSymlinkDepthExceededError do
48
- Nanoc::Extra::FilesystemTools.all_files_in('dir0', nil)
47
+ assert_raises Nanoc::DataSources::Filesystem::Tools::MaxSymlinkDepthExceededError do
48
+ Nanoc::DataSources::Filesystem::Tools.all_files_in('dir0', nil)
49
49
  end
50
50
  end
51
51
 
@@ -59,7 +59,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
59
59
  File.symlink('../bar', 'foo/barlink')
60
60
 
61
61
  expected_files = ['foo/barlink/y.md', 'foo/x.md']
62
- actual_files = Nanoc::Extra::FilesystemTools.all_files_in('foo', nil).sort
62
+ actual_files = Nanoc::DataSources::Filesystem::Tools.all_files_in('foo', nil).sort
63
63
  assert_equal expected_files, actual_files
64
64
  end
65
65
 
@@ -72,7 +72,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
72
72
 
73
73
  # Check
74
74
  expected_files = ['dir/bar-link', 'dir/foo']
75
- actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir', nil).sort
75
+ actual_files = Nanoc::DataSources::Filesystem::Tools.all_files_in('dir', nil).sort
76
76
  assert_equal expected_files, actual_files
77
77
  end
78
78
 
@@ -83,7 +83,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
83
83
  File.symlink('baz', 'qux')
84
84
 
85
85
  expected = File.expand_path('foo')
86
- actual = Nanoc::Extra::FilesystemTools.resolve_symlink('qux')
86
+ actual = Nanoc::DataSources::Filesystem::Tools.resolve_symlink('qux')
87
87
  assert_equal expected, actual
88
88
  end
89
89
 
@@ -94,8 +94,8 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
94
94
  File.symlink("symlink-#{i - 1}", "symlink-#{i}")
95
95
  end
96
96
 
97
- assert_raises Nanoc::Extra::FilesystemTools::MaxSymlinkDepthExceededError do
98
- Nanoc::Extra::FilesystemTools.resolve_symlink('symlink-7')
97
+ assert_raises Nanoc::DataSources::Filesystem::Tools::MaxSymlinkDepthExceededError do
98
+ Nanoc::DataSources::Filesystem::Tools.resolve_symlink('symlink-7')
99
99
  end
100
100
  end
101
101
 
@@ -105,7 +105,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
105
105
  File.open('dir/.DS_Store', 'w') { |io| io.write('o hai') }
106
106
  File.open('dir/.htaccess', 'w') { |io| io.write('o hai') }
107
107
 
108
- actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir', nil).sort
108
+ actual_files = Nanoc::DataSources::Filesystem::Tools.all_files_in('dir', nil).sort
109
109
  assert_equal [], actual_files
110
110
  end
111
111
 
@@ -114,7 +114,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
114
114
  FileUtils.mkdir_p('dir')
115
115
  File.open('dir/.other', 'w') { |io| io.write('o hai') }
116
116
 
117
- actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir', '**/.other').sort
117
+ actual_files = Nanoc::DataSources::Filesystem::Tools.all_files_in('dir', '**/.other').sort
118
118
  assert_equal ['dir/.other'], actual_files
119
119
  end
120
120
 
@@ -124,7 +124,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
124
124
  File.open('dir/.other', 'w') { |io| io.write('o hai') }
125
125
  File.open('dir/.DS_Store', 'w') { |io| io.write('o hai') }
126
126
 
127
- actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir', ['**/.other', '**/.DS_Store']).sort
127
+ actual_files = Nanoc::DataSources::Filesystem::Tools.all_files_in('dir', ['**/.other', '**/.DS_Store']).sort
128
128
  assert_equal ['dir/.other', 'dir/.DS_Store'].sort, actual_files.sort
129
129
  end
130
130
 
@@ -136,7 +136,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
136
136
  pattern = { dotfiles: '**/.other' }
137
137
 
138
138
  assert_raises Nanoc::Int::Errors::GenericTrivial, "Do not know how to handle extra_files: #{pattern.inspect}" do
139
- Nanoc::Extra::FilesystemTools.all_files_in('dir0', pattern)
139
+ Nanoc::DataSources::Filesystem::Tools.all_files_in('dir0', pattern)
140
140
  end
141
141
  end
142
142
  end