nanoc 4.0.0b2 → 4.0.0b3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +11 -22
  3. data/NEWS.md +20 -0
  4. data/Rakefile +0 -2
  5. data/bin/nanoc +0 -2
  6. data/lib/nanoc.rb +0 -2
  7. data/lib/nanoc/base.rb +1 -2
  8. data/lib/nanoc/base/checksummer.rb +0 -2
  9. data/lib/nanoc/base/compilation/checksum_store.rb +0 -2
  10. data/lib/nanoc/base/compilation/compiled_content_cache.rb +0 -2
  11. data/lib/nanoc/base/compilation/compiler.rb +0 -2
  12. data/lib/nanoc/base/compilation/compiler_dsl.rb +0 -2
  13. data/lib/nanoc/base/compilation/dependency_tracker.rb +0 -2
  14. data/lib/nanoc/base/compilation/filter.rb +0 -2
  15. data/lib/nanoc/base/compilation/item_rep_proxy.rb +0 -2
  16. data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +0 -2
  17. data/lib/nanoc/base/compilation/outdatedness_checker.rb +0 -2
  18. data/lib/nanoc/base/compilation/outdatedness_reasons.rb +0 -2
  19. data/lib/nanoc/base/compilation/rule.rb +0 -2
  20. data/lib/nanoc/base/compilation/rule_context.rb +0 -2
  21. data/lib/nanoc/base/compilation/rule_memory_calculator.rb +0 -2
  22. data/lib/nanoc/base/compilation/rule_memory_store.rb +0 -2
  23. data/lib/nanoc/base/compilation/rules_collection.rb +0 -2
  24. data/lib/nanoc/base/context.rb +0 -2
  25. data/lib/nanoc/base/core_ext.rb +0 -2
  26. data/lib/nanoc/base/core_ext/array.rb +0 -2
  27. data/lib/nanoc/base/core_ext/hash.rb +0 -2
  28. data/lib/nanoc/base/core_ext/pathname.rb +0 -2
  29. data/lib/nanoc/base/core_ext/string.rb +0 -2
  30. data/lib/nanoc/base/directed_graph.rb +0 -2
  31. data/lib/nanoc/base/error.rb +0 -2
  32. data/lib/nanoc/base/errors.rb +0 -2
  33. data/lib/nanoc/base/identifiable_collection.rb +0 -2
  34. data/lib/nanoc/base/memoization.rb +0 -2
  35. data/lib/nanoc/base/notification_center.rb +0 -2
  36. data/lib/nanoc/base/pattern.rb +0 -2
  37. data/lib/nanoc/base/plugin_registry.rb +0 -2
  38. data/lib/nanoc/base/result_data/item_rep.rb +0 -2
  39. data/lib/nanoc/base/source_data/code_snippet.rb +0 -2
  40. data/lib/nanoc/base/source_data/configuration.rb +0 -2
  41. data/lib/nanoc/base/source_data/data_source.rb +0 -2
  42. data/lib/nanoc/base/source_data/identifier.rb +0 -2
  43. data/lib/nanoc/base/source_data/item.rb +0 -2
  44. data/lib/nanoc/base/source_data/layout.rb +0 -2
  45. data/lib/nanoc/base/source_data/site.rb +1 -3
  46. data/lib/nanoc/base/store.rb +0 -2
  47. data/lib/nanoc/base/temp_filename_factory.rb +0 -2
  48. data/lib/nanoc/base/views/config.rb +0 -2
  49. data/lib/nanoc/base/views/identifiable_collection.rb +0 -2
  50. data/lib/nanoc/base/views/item.rb +3 -5
  51. data/lib/nanoc/base/views/item_collection.rb +0 -2
  52. data/lib/nanoc/base/views/item_rep.rb +0 -2
  53. data/lib/nanoc/base/views/item_rep_collection.rb +48 -0
  54. data/lib/nanoc/base/views/layout.rb +0 -2
  55. data/lib/nanoc/base/views/layout_collection.rb +0 -2
  56. data/lib/nanoc/base/views/mutable_config.rb +0 -2
  57. data/lib/nanoc/base/views/mutable_identifiable_collection.rb +0 -2
  58. data/lib/nanoc/base/views/mutable_item.rb +0 -2
  59. data/lib/nanoc/base/views/mutable_item_collection.rb +0 -2
  60. data/lib/nanoc/base/views/mutable_layout.rb +0 -2
  61. data/lib/nanoc/base/views/mutable_layout_collection.rb +0 -2
  62. data/lib/nanoc/base/views/site.rb +0 -2
  63. data/lib/nanoc/cli.rb +0 -2
  64. data/lib/nanoc/cli/ansi_string_colorizer.rb +0 -2
  65. data/lib/nanoc/cli/cleaning_stream.rb +0 -2
  66. data/lib/nanoc/cli/command_runner.rb +0 -2
  67. data/lib/nanoc/cli/commands/check.rb +0 -2
  68. data/lib/nanoc/cli/commands/compile.rb +0 -2
  69. data/lib/nanoc/cli/commands/create-site.rb +7 -25
  70. data/lib/nanoc/cli/commands/deploy.rb +0 -2
  71. data/lib/nanoc/cli/commands/nanoc.rb +0 -2
  72. data/lib/nanoc/cli/commands/prune.rb +0 -2
  73. data/lib/nanoc/cli/commands/shell.rb +0 -2
  74. data/lib/nanoc/cli/commands/show-data.rb +0 -2
  75. data/lib/nanoc/cli/commands/show-plugins.rb +0 -2
  76. data/lib/nanoc/cli/commands/show-rules.rb +0 -2
  77. data/lib/nanoc/cli/commands/view.rb +0 -2
  78. data/lib/nanoc/cli/error_handler.rb +0 -2
  79. data/lib/nanoc/cli/logger.rb +0 -2
  80. data/lib/nanoc/cli/stream_cleaners.rb +0 -2
  81. data/lib/nanoc/cli/stream_cleaners/abstract.rb +0 -2
  82. data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +0 -2
  83. data/lib/nanoc/cli/stream_cleaners/utf8.rb +0 -2
  84. data/lib/nanoc/data_sources.rb +1 -5
  85. data/lib/nanoc/data_sources/filesystem.rb +2 -2
  86. data/lib/nanoc/data_sources/filesystem_unified.rb +0 -2
  87. data/lib/nanoc/extra.rb +0 -2
  88. data/lib/nanoc/extra/checking.rb +0 -2
  89. data/lib/nanoc/extra/checking/check.rb +23 -15
  90. data/lib/nanoc/extra/checking/checks.rb +0 -2
  91. data/lib/nanoc/extra/checking/checks/css.rb +1 -3
  92. data/lib/nanoc/extra/checking/checks/external_links.rb +0 -2
  93. data/lib/nanoc/extra/checking/checks/html.rb +1 -3
  94. data/lib/nanoc/extra/checking/checks/internal_links.rb +3 -5
  95. data/lib/nanoc/extra/checking/checks/mixed_content.rb +0 -2
  96. data/lib/nanoc/extra/checking/checks/stale.rb +2 -4
  97. data/lib/nanoc/extra/checking/dsl.rb +0 -2
  98. data/lib/nanoc/extra/checking/issue.rb +0 -2
  99. data/lib/nanoc/extra/checking/runner.rb +1 -3
  100. data/lib/nanoc/extra/core_ext.rb +0 -2
  101. data/lib/nanoc/extra/core_ext/pathname.rb +0 -2
  102. data/lib/nanoc/extra/core_ext/time.rb +0 -2
  103. data/lib/nanoc/extra/deployer.rb +0 -2
  104. data/lib/nanoc/extra/deployers.rb +0 -2
  105. data/lib/nanoc/extra/deployers/fog.rb +40 -8
  106. data/lib/nanoc/extra/deployers/rsync.rb +0 -2
  107. data/lib/nanoc/extra/filesystem_tools.rb +0 -2
  108. data/lib/nanoc/extra/jruby_nokogiri_warner.rb +0 -2
  109. data/lib/nanoc/extra/link_collector.rb +0 -2
  110. data/lib/nanoc/extra/piper.rb +0 -2
  111. data/lib/nanoc/extra/pruner.rb +0 -2
  112. data/lib/nanoc/filters.rb +0 -2
  113. data/lib/nanoc/filters/asciidoc.rb +0 -2
  114. data/lib/nanoc/filters/bluecloth.rb +0 -2
  115. data/lib/nanoc/filters/coffeescript.rb +0 -2
  116. data/lib/nanoc/filters/colorize_syntax.rb +0 -2
  117. data/lib/nanoc/filters/erb.rb +0 -2
  118. data/lib/nanoc/filters/erubis.rb +0 -2
  119. data/lib/nanoc/filters/haml.rb +0 -2
  120. data/lib/nanoc/filters/handlebars.rb +0 -2
  121. data/lib/nanoc/filters/kramdown.rb +0 -2
  122. data/lib/nanoc/filters/less.rb +0 -2
  123. data/lib/nanoc/filters/markaby.rb +0 -2
  124. data/lib/nanoc/filters/maruku.rb +0 -2
  125. data/lib/nanoc/filters/mustache.rb +0 -2
  126. data/lib/nanoc/filters/pandoc.rb +0 -2
  127. data/lib/nanoc/filters/rainpress.rb +0 -2
  128. data/lib/nanoc/filters/rdiscount.rb +0 -2
  129. data/lib/nanoc/filters/rdoc.rb +0 -2
  130. data/lib/nanoc/filters/redcarpet.rb +0 -2
  131. data/lib/nanoc/filters/redcloth.rb +0 -2
  132. data/lib/nanoc/filters/relativize_paths.rb +0 -2
  133. data/lib/nanoc/filters/rubypants.rb +0 -2
  134. data/lib/nanoc/filters/sass.rb +0 -2
  135. data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +0 -2
  136. data/lib/nanoc/filters/slim.rb +0 -2
  137. data/lib/nanoc/filters/typogruby.rb +0 -2
  138. data/lib/nanoc/filters/uglify_js.rb +0 -2
  139. data/lib/nanoc/filters/xsl.rb +0 -2
  140. data/lib/nanoc/filters/yui_compressor.rb +0 -2
  141. data/lib/nanoc/helpers.rb +0 -2
  142. data/lib/nanoc/helpers/blogging.rb +0 -2
  143. data/lib/nanoc/helpers/breadcrumbs.rb +0 -2
  144. data/lib/nanoc/helpers/capturing.rb +0 -2
  145. data/lib/nanoc/helpers/filtering.rb +0 -2
  146. data/lib/nanoc/helpers/html_escape.rb +0 -2
  147. data/lib/nanoc/helpers/link_to.rb +0 -2
  148. data/lib/nanoc/helpers/rendering.rb +0 -2
  149. data/lib/nanoc/helpers/tagging.rb +0 -2
  150. data/lib/nanoc/helpers/text.rb +0 -2
  151. data/lib/nanoc/helpers/xml_sitemap.rb +0 -2
  152. data/lib/nanoc/version.rb +1 -3
  153. data/nanoc.gemspec +1 -3
  154. data/tasks/doc.rake +0 -2
  155. data/tasks/test.rake +0 -2
  156. data/test/base/checksummer_spec.rb +0 -2
  157. data/test/base/core_ext/array_spec.rb +0 -2
  158. data/test/base/core_ext/hash_spec.rb +0 -2
  159. data/test/base/core_ext/pathname_spec.rb +0 -2
  160. data/test/base/core_ext/string_spec.rb +0 -2
  161. data/test/base/temp_filename_factory_spec.rb +0 -2
  162. data/test/base/test_checksum_store.rb +0 -2
  163. data/test/base/test_code_snippet.rb +0 -2
  164. data/test/base/test_compiler.rb +0 -2
  165. data/test/base/test_compiler_dsl.rb +1 -3
  166. data/test/base/test_context.rb +0 -2
  167. data/test/base/test_data_source.rb +0 -2
  168. data/test/base/test_dependency_tracker.rb +0 -2
  169. data/test/base/test_directed_graph.rb +0 -2
  170. data/test/base/test_filter.rb +0 -2
  171. data/test/base/test_item.rb +0 -2
  172. data/test/base/test_item_array.rb +0 -2
  173. data/test/base/test_item_rep.rb +0 -2
  174. data/test/base/test_item_rep_recorder_proxy.rb +0 -2
  175. data/test/base/test_layout.rb +0 -2
  176. data/test/base/test_memoization.rb +0 -2
  177. data/test/base/test_notification_center.rb +0 -2
  178. data/test/base/test_outdatedness_checker.rb +1 -3
  179. data/test/base/test_plugin.rb +0 -2
  180. data/test/base/test_rule.rb +0 -2
  181. data/test/base/test_rule_context.rb +0 -2
  182. data/test/base/test_site.rb +1 -3
  183. data/test/base/test_store.rb +0 -2
  184. data/test/cli/commands/test_check.rb +0 -2
  185. data/test/cli/commands/test_compile.rb +0 -2
  186. data/test/cli/commands/test_create_site.rb +1 -3
  187. data/test/cli/commands/test_deploy.rb +0 -2
  188. data/test/cli/commands/test_help.rb +0 -2
  189. data/test/cli/commands/test_info.rb +0 -2
  190. data/test/cli/commands/test_prune.rb +2 -4
  191. data/test/cli/test_cleaning_stream.rb +0 -2
  192. data/test/cli/test_cli.rb +0 -6
  193. data/test/cli/test_error_handler.rb +0 -2
  194. data/test/cli/test_logger.rb +0 -2
  195. data/test/data_sources/test_filesystem.rb +0 -2
  196. data/test/data_sources/test_filesystem_unified.rb +15 -2
  197. data/test/extra/checking/checks/test_css.rb +3 -5
  198. data/test/extra/checking/checks/test_external_links.rb +5 -7
  199. data/test/extra/checking/checks/test_html.rb +2 -4
  200. data/test/extra/checking/checks/test_internal_links.rb +5 -7
  201. data/test/extra/checking/checks/test_mixed_content.rb +8 -10
  202. data/test/extra/checking/checks/test_stale.rb +1 -3
  203. data/test/extra/checking/test_check.rb +2 -6
  204. data/test/extra/checking/test_dsl.rb +0 -2
  205. data/test/extra/checking/test_runner.rb +0 -2
  206. data/test/extra/core_ext/test_pathname.rb +0 -2
  207. data/test/extra/core_ext/test_time.rb +0 -2
  208. data/test/extra/deployers/test_fog.rb +147 -2
  209. data/test/extra/deployers/test_rsync.rb +0 -2
  210. data/test/extra/test_filesystem_tools.rb +0 -2
  211. data/test/extra/test_link_collector.rb +0 -2
  212. data/test/extra/test_piper.rb +0 -2
  213. data/test/filters/test_asciidoc.rb +0 -2
  214. data/test/filters/test_bluecloth.rb +0 -2
  215. data/test/filters/test_coffeescript.rb +0 -2
  216. data/test/filters/test_colorize_syntax.rb +0 -2
  217. data/test/filters/test_erb.rb +0 -2
  218. data/test/filters/test_erubis.rb +0 -2
  219. data/test/filters/test_haml.rb +0 -2
  220. data/test/filters/test_handlebars.rb +0 -2
  221. data/test/filters/test_kramdown.rb +0 -2
  222. data/test/filters/test_less.rb +0 -2
  223. data/test/filters/test_markaby.rb +0 -2
  224. data/test/filters/test_maruku.rb +0 -2
  225. data/test/filters/test_mustache.rb +0 -2
  226. data/test/filters/test_pandoc.rb +0 -2
  227. data/test/filters/test_rainpress.rb +0 -2
  228. data/test/filters/test_rdiscount.rb +0 -2
  229. data/test/filters/test_rdoc.rb +0 -2
  230. data/test/filters/test_redcarpet.rb +0 -2
  231. data/test/filters/test_redcloth.rb +0 -2
  232. data/test/filters/test_relativize_paths.rb +0 -2
  233. data/test/filters/test_rubypants.rb +0 -2
  234. data/test/filters/test_sass.rb +0 -2
  235. data/test/filters/test_slim.rb +0 -2
  236. data/test/filters/test_typogruby.rb +0 -2
  237. data/test/filters/test_uglify_js.rb +0 -2
  238. data/test/filters/test_xsl.rb +0 -2
  239. data/test/filters/test_yui_compressor.rb +0 -2
  240. data/test/gem_loader.rb +0 -2
  241. data/test/helper.rb +1 -3
  242. data/test/helpers/test_blogging.rb +0 -2
  243. data/test/helpers/test_breadcrumbs.rb +0 -2
  244. data/test/helpers/test_capturing.rb +0 -2
  245. data/test/helpers/test_filtering.rb +0 -2
  246. data/test/helpers/test_html_escape.rb +0 -2
  247. data/test/helpers/test_link_to.rb +0 -2
  248. data/test/helpers/test_rendering.rb +0 -2
  249. data/test/helpers/test_tagging.rb +0 -2
  250. data/test/helpers/test_text.rb +0 -2
  251. data/test/helpers/test_xml_sitemap.rb +0 -2
  252. data/test/test_gem.rb +0 -5
  253. metadata +5 -6
  254. data/lib/nanoc/data_sources/filesystem_verbose.rb +0 -71
  255. data/test/data_sources/test_filesystem_verbose.rb +0 -308
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Int::StoreTest < Nanoc::TestCase
4
2
  class TestStore < Nanoc::Int::Store
5
3
  def data
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::Commands::CheckTest < Nanoc::TestCase
4
2
  def test_check_stale
5
3
  with_site do |_site|
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::Commands::CompileTest < Nanoc::TestCase
4
2
  def test_profiling_information
5
3
  with_site do |_site|
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::Commands::CreateSiteTest < Nanoc::TestCase
4
2
  def test_create_site_with_existing_name
5
3
  Nanoc::CLI.run %w( create_site foo )
@@ -88,7 +86,7 @@ class Nanoc::CLI::Commands::CreateSiteTest < Nanoc::TestCase
88
86
  io.write("string_pattern_type: glob\n")
89
87
  io.write("data_sources:\n")
90
88
  io.write(" -\n")
91
- io.write(" type: filesystem_unified\n")
89
+ io.write(" type: filesystem\n")
92
90
  io.write(" identifier_type: full\n")
93
91
  end
94
92
  site = Nanoc::Int::Site.new('.')
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::Commands::DeployTest < Nanoc::TestCase
4
2
  def test_deploy
5
3
  skip_unless_have_command 'rsync'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::Commands::HelpTest < Nanoc::TestCase
4
2
  def test_run
5
3
  Nanoc::CLI.run %w( help )
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::Commands::InfoTest < Nanoc::TestCase
4
2
  def test_run
5
3
  Nanoc::CLI.run %w( info )
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::Commands::PruneTest < Nanoc::TestCase
4
2
  def test_run_without_yes
5
3
  with_site do |_site|
@@ -31,7 +29,7 @@ class Nanoc::CLI::Commands::PruneTest < Nanoc::TestCase
31
29
  io << 'string_pattern_type: legacy' << "\n"
32
30
  io << 'data_sources:' << "\n"
33
31
  io << ' -' << "\n"
34
- io << ' type: filesystem_unified' << "\n"
32
+ io << ' type: filesystem' << "\n"
35
33
  io << ' identifier_type: legacy' << "\n"
36
34
  end
37
35
  FileUtils.mkdir_p('output2')
@@ -79,7 +77,7 @@ class Nanoc::CLI::Commands::PruneTest < Nanoc::TestCase
79
77
  io << 'string_pattern_type: legacy' << "\n"
80
78
  io << 'data_sources:' << "\n"
81
79
  io << ' -' << "\n"
82
- io << ' type: filesystem_unified' << "\n"
80
+ io << ' type: filesystem' << "\n"
83
81
  io << ' identifier_type: legacy' << "\n"
84
82
  end
85
83
  FileUtils.mkdir_p('output')
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::CleaningStreamTest < Nanoc::TestCase
4
2
  class Stream
5
3
  attr_accessor :called_methods
@@ -1,9 +1,5 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLITest < Nanoc::TestCase
4
2
  COMMAND_CODE = <<EOS
5
- # encoding: utf-8
6
-
7
3
  usage '_test [options]'
8
4
  summary 'meh'
9
5
  description 'longer meh'
@@ -14,8 +10,6 @@ end
14
10
  EOS
15
11
 
16
12
  SUBCOMMAND_CODE = <<EOS
17
- # encoding: utf-8
18
-
19
13
  usage '_sub [options]'
20
14
  summary 'meh sub'
21
15
  description 'longer meh sub'
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::ErrorHandlerTest < Nanoc::TestCase
4
2
  def setup
5
3
  super
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::CLI::LoggerTest < Nanoc::TestCase
4
2
  def test_stub
5
3
  end
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
4
2
  class SampleFilesystemDataSource < Nanoc::DataSource
5
3
  include Nanoc::DataSources::Filesystem
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::DataSources::FilesystemUnifiedTest < Nanoc::TestCase
4
2
  def new_data_source(params = nil)
5
3
  # Mock site
@@ -117,6 +115,21 @@ class Nanoc::DataSources::FilesystemUnifiedTest < Nanoc::TestCase
117
115
  assert_nil items[0].raw_content
118
116
  end
119
117
 
118
+ def test_load_layouts_with_nil_dir_name
119
+ # Create data source
120
+ data_source = new_data_source(layouts_dir: nil)
121
+
122
+ # Create sample files
123
+ FileUtils.mkdir_p('layouts')
124
+ File.write('layouts/stuff.txt', 'blah blah')
125
+
126
+ # Load
127
+ layouts = data_source.layouts
128
+
129
+ # Check
130
+ assert_empty(layouts)
131
+ end
132
+
120
133
  def test_load_binary_layouts
121
134
  # Create data source
122
135
  data_source = new_data_source
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
4
2
  def test_run_ok
5
3
  VCR.use_cassette('css_run_ok') do
@@ -10,7 +8,7 @@ class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
10
8
  File.open('output/style.css', 'w') { |io| io.write('h1 { color: red; }') }
11
9
 
12
10
  # Run check
13
- check = Nanoc::Extra::Checking::Checks::CSS.new(site)
11
+ check = Nanoc::Extra::Checking::Checks::CSS.create(site)
14
12
  check.run
15
13
 
16
14
  # Check
@@ -28,7 +26,7 @@ class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
28
26
  File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
29
27
 
30
28
  # Run check
31
- check = Nanoc::Extra::Checking::Checks::CSS.new(site)
29
+ check = Nanoc::Extra::Checking::Checks::CSS.create(site)
32
30
  check.run
33
31
 
34
32
  # Check
@@ -49,7 +47,7 @@ class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
49
47
  File.open('output/style.css', 'w') { |io| io.write('h1 { ; {') }
50
48
 
51
49
  # Run check
52
- check = Nanoc::Extra::Checking::Checks::CSS.new(site)
50
+ check = Nanoc::Extra::Checking::Checks::CSS.create(site)
53
51
  check.run
54
52
 
55
53
  # Check
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
4
2
  def test_run
5
3
  with_site do |site|
@@ -9,7 +7,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
9
7
  File.open('output/bar.html', 'w') { |io| io.write('<a href="http://example.com/">not broken</a>') }
10
8
 
11
9
  # Create check
12
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.new(site)
10
+ check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
13
11
  def check.request_url_once(url)
14
12
  Net::HTTPResponse.new('1.1', url.path == '/' ? '200' : '404', 'okay')
15
13
  end
@@ -23,7 +21,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
23
21
  def test_valid_by_path
24
22
  with_site do |site|
25
23
  # Create check
26
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.new(site)
24
+ check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
27
25
  def check.request_url_once(url)
28
26
  Net::HTTPResponse.new('1.1', url.path == '/200' ? '200' : '404', 'okay')
29
27
  end
@@ -38,7 +36,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
38
36
  def test_valid_by_query
39
37
  with_site do |site|
40
38
  # Create check
41
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.new(site)
39
+ check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
42
40
  def check.request_url_once(url)
43
41
  Net::HTTPResponse.new('1.1', url.query == 'status=200' ? '200' : '404', 'okay')
44
42
  end
@@ -52,7 +50,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
52
50
  def test_fallback_to_get_when_head_is_not_allowed
53
51
  with_site do |site|
54
52
  # Create check
55
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.new(site)
53
+ check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
56
54
  def check.request_url_once(url, req_method = Net::HTTP::Head)
57
55
  Net::HTTPResponse.new('1.1', (req_method == Net::HTTP::Head || url.path == '/405') ? '405' : '200', 'okay')
58
56
  end
@@ -65,7 +63,7 @@ class Nanoc::Extra::Checking::Checks::ExternalLinksTest < Nanoc::TestCase
65
63
 
66
64
  def test_path_for_url
67
65
  with_site do |site|
68
- check = Nanoc::Extra::Checking::Checks::ExternalLinks.new(site)
66
+ check = Nanoc::Extra::Checking::Checks::ExternalLinks.create(site)
69
67
 
70
68
  assert_equal '/', check.send(:path_for_url, URI.parse('http://example.com'))
71
69
  assert_equal '/', check.send(:path_for_url, URI.parse('http://example.com/'))
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::Checks::HTMLTest < Nanoc::TestCase
4
2
  def test_run_ok
5
3
  VCR.use_cassette('html_run_ok') do
@@ -10,7 +8,7 @@ class Nanoc::Extra::Checking::Checks::HTMLTest < Nanoc::TestCase
10
8
  File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
11
9
 
12
10
  # Run check
13
- check = Nanoc::Extra::Checking::Checks::HTML.new(site)
11
+ check = Nanoc::Extra::Checking::Checks::HTML.create(site)
14
12
  check.run
15
13
 
16
14
  # Check
@@ -28,7 +26,7 @@ class Nanoc::Extra::Checking::Checks::HTMLTest < Nanoc::TestCase
28
26
  File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
29
27
 
30
28
  # Run check
31
- check = Nanoc::Extra::Checking::Checks::HTML.new(site)
29
+ check = Nanoc::Extra::Checking::Checks::HTML.create(site)
32
30
  check.run
33
31
 
34
32
  # Check
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
4
2
  def test_run
5
3
  with_site do |site|
@@ -10,7 +8,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
10
8
  File.open('output/bar.html', 'w') { |io| io.write('<a href="/foo.txt">not broken</a>') }
11
9
 
12
10
  # Create check
13
- check = Nanoc::Extra::Checking::Checks::InternalLinks.new(site)
11
+ check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
14
12
  check.run
15
13
 
16
14
  # Test
@@ -28,7 +26,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
28
26
  File.open('output/stuff/blah', 'w') { |io| io.write('hi') }
29
27
 
30
28
  # Create check
31
- check = Nanoc::Extra::Checking::Checks::InternalLinks.new(site)
29
+ check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
32
30
 
33
31
  # Test
34
32
  assert check.send(:valid?, 'foo', 'output/origin')
@@ -45,7 +43,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
45
43
  FileUtils.mkdir_p('output/stuff')
46
44
  File.open('output/stuff/right', 'w') { |io| io.write('hi') }
47
45
 
48
- check = Nanoc::Extra::Checking::Checks::InternalLinks.new(site)
46
+ check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
49
47
 
50
48
  assert check.send(:valid?, 'stuff/right?foo=123', 'output/origin')
51
49
  refute check.send(:valid?, 'stuff/wrong?foo=123', 'output/origin')
@@ -55,7 +53,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
55
53
  def test_exclude
56
54
  with_site do |site|
57
55
  # Create check
58
- check = Nanoc::Extra::Checking::Checks::InternalLinks.new(site)
56
+ check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
59
57
  site.config.update({ checks: { internal_links: { exclude: ['^/excluded\d+'] } } })
60
58
 
61
59
  # Test
@@ -70,7 +68,7 @@ class Nanoc::Extra::Checking::Checks::InternalLinksTest < Nanoc::TestCase
70
68
  FileUtils.mkdir_p('output/stuff')
71
69
  File.open('output/stuff/right foo', 'w') { |io| io.write('hi') }
72
70
 
73
- check = Nanoc::Extra::Checking::Checks::InternalLinks.new(site)
71
+ check = Nanoc::Extra::Checking::Checks::InternalLinks.create(site)
74
72
 
75
73
  assert check.send(:valid?, 'stuff/right%20foo', 'output/origin')
76
74
  refute check.send(:valid?, 'stuff/wrong%20foo', 'output/origin')
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
4
2
  def create_output_file(name, lines)
5
3
  FileUtils.mkdir_p('output')
@@ -24,7 +22,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
24
22
  '<audio src="https://nanoc.ws/theme-song.flac"></audio>',
25
23
  '<video src="https://nanoc.ws/screen-cast.mkv"></video>'
26
24
  ])
27
- check = Nanoc::Extra::Checking::Checks::MixedContent.new(site)
25
+ check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
28
26
  check.run
29
27
 
30
28
  assert check.issues.empty?
@@ -42,7 +40,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
42
40
  '<audio src="/theme-song.flac"></audio>',
43
41
  '<video src="/screen-cast.mkv"></video>'
44
42
  ])
45
- check = Nanoc::Extra::Checking::Checks::MixedContent.new(site)
43
+ check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
46
44
  check.run
47
45
 
48
46
  assert check.issues.empty?
@@ -60,7 +58,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
60
58
  '<audio src="//nanoc.ws/theme-song.flac"></audio>',
61
59
  '<video src="//nanoc.ws/screen-cast.mkv"></video>'
62
60
  ])
63
- check = Nanoc::Extra::Checking::Checks::MixedContent.new(site)
61
+ check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
64
62
  check.run
65
63
 
66
64
  assert check.issues.empty?
@@ -78,7 +76,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
78
76
  '<audio src="theme-song.flac"></audio>',
79
77
  '<video src="screen-cast.mkv"></video>'
80
78
  ])
81
- check = Nanoc::Extra::Checking::Checks::MixedContent.new(site)
79
+ check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
82
80
  check.run
83
81
 
84
82
  assert check.issues.empty?
@@ -96,7 +94,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
96
94
  '<audio src="?query-string"></audio>',
97
95
  '<video src="?query-string"></video>'
98
96
  ])
99
- check = Nanoc::Extra::Checking::Checks::MixedContent.new(site)
97
+ check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
100
98
  check.run
101
99
 
102
100
  assert check.issues.empty?
@@ -114,7 +112,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
114
112
  '<audio src="#fragment"></audio>',
115
113
  '<video src="#fragment"></video>'
116
114
  ])
117
- check = Nanoc::Extra::Checking::Checks::MixedContent.new(site)
115
+ check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
118
116
  check.run
119
117
 
120
118
  assert check.issues.empty?
@@ -133,7 +131,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
133
131
  '<audio src="http://nanoc.ws/theme-song.flac"></audio>',
134
132
  '<video src="http://nanoc.ws/screencast.mkv"></video>'
135
133
  ])
136
- check = Nanoc::Extra::Checking::Checks::MixedContent.new(site)
134
+ check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
137
135
  check.run
138
136
 
139
137
  issues = check.issues.to_a
@@ -179,7 +177,7 @@ class Nanoc::Extra::Checking::Checks::MixedContentTest < Nanoc::TestCase
179
177
  '<video target="http://nanoc.ws/screen-cast.mkv"></video>',
180
178
  '<p>http://nanoc.ws/harmless-text</p>'
181
179
  ])
182
- check = Nanoc::Extra::Checking::Checks::MixedContent.new(site)
180
+ check = Nanoc::Extra::Checking::Checks::MixedContent.create(site)
183
181
  check.run
184
182
 
185
183
  assert check.issues.empty?
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::Checks::StaleTest < Nanoc::TestCase
4
2
  def check_class
5
3
  Nanoc::Extra::Checking::Checks::Stale
@@ -7,7 +5,7 @@ class Nanoc::Extra::Checking::Checks::StaleTest < Nanoc::TestCase
7
5
 
8
6
  def calc_issues
9
7
  site = Nanoc::Int::Site.new('.')
10
- check = check_class.new(site)
8
+ check = check_class.create(site)
11
9
  check.run
12
10
  check.issues
13
11
  end
@@ -1,11 +1,8 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::CheckTest < Nanoc::TestCase
4
2
  def test_output_filenames
5
3
  with_site do |site|
6
- check = Nanoc::Extra::Checking::Check.new(site)
7
- assert check.output_filenames.empty?
8
4
  File.open('output/foo.html', 'w') { |io| io.write 'hello' }
5
+ check = Nanoc::Extra::Checking::Check.create(site)
9
6
  assert_equal ['output/foo.html'], check.output_filenames
10
7
  end
11
8
  end
@@ -13,9 +10,8 @@ class Nanoc::Extra::Checking::CheckTest < Nanoc::TestCase
13
10
  def test_no_output_dir
14
11
  with_site do |site|
15
12
  site.config[:output_dir] = 'non-existent'
16
- check = Nanoc::Extra::Checking::Check.new(site)
17
13
  assert_raises Nanoc::Extra::Checking::OutputDirNotFoundError do
18
- check.output_filenames
14
+ Nanoc::Extra::Checking::Check.create(site)
19
15
  end
20
16
  end
21
17
  end
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::DSLTest < Nanoc::TestCase
4
2
  def test_from_file
5
3
  with_site do |_site|
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::Checking::RunnerTest < Nanoc::TestCase
4
2
  def test_run_specific
5
3
  with_site do |site|
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::Extra::CoreExtPathnameTest < Nanoc::TestCase
4
2
  def test_components
5
3
  assert_equal %w( / a bb ccc dd e ), Pathname.new('/a/bb/ccc/dd/e').__nanoc_components
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  class Nanoc::ExtraCoreExtTimeTest < Nanoc::TestCase
4
2
  def test___nanoc_to_iso8601_date
5
3
  assert_equal('2008-05-19', Time.utc(2008, 5, 19, 14, 20, 0, 0).__nanoc_to_iso8601_date)