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
@@ -0,0 +1,20 @@
1
+ class Nanoc::Filters::ColorizeSyntax::SimonTest < Nanoc::TestCase
2
+ def test_simon_highlight
3
+ if_have 'nokogiri' do
4
+ skip_unless_have_command 'highlight'
5
+
6
+ # Create filter
7
+ filter = ::Nanoc::Filters::ColorizeSyntax.new
8
+
9
+ # Get input and expected output
10
+ input = %(<pre title="moo"><code class="language-ruby">
11
+ # comment
12
+ </code></pre>)
13
+ expected_output = '<pre title="moo"><code class="language-ruby"><span class="hl slc"># comment</span></code></pre>'
14
+
15
+ # Run filter
16
+ actual_output = filter.setup_and_run(input, default_colorizer: :simon_highlight)
17
+ assert_equal(expected_output, actual_output)
18
+ end
19
+ end
20
+ end
@@ -55,61 +55,6 @@ class Nanoc::Filters::LessTest < Nanoc::TestCase
55
55
  end
56
56
  end
57
57
 
58
- def test_recompile_includes
59
- if_have 'less' do
60
- with_site do |site|
61
- # Create two less files
62
- Dir['content/*'].each { |i| FileUtils.rm(i) }
63
- File.open('content/a.less', 'w') do |io|
64
- io.write('@import "b.less";')
65
- end
66
- File.open('content/b.less', 'w') do |io|
67
- io.write('p { color: red; }')
68
- end
69
-
70
- # Update rules
71
- File.open('Rules', 'w') do |io|
72
- io.write "compile '*' do\n"
73
- io.write " filter :less\n"
74
- io.write "end\n"
75
- io.write "\n"
76
- io.write "route '/a/' do\n"
77
- io.write " item.identifier.chop + '.css'\n"
78
- io.write "end\n"
79
- io.write "\n"
80
- io.write "route '/b/' do\n"
81
- io.write " nil\n"
82
- io.write "end\n"
83
- end
84
-
85
- # Compile
86
- site = Nanoc::Int::SiteLoader.new.new_from_cwd
87
- site.compile
88
-
89
- # Check
90
- assert Dir['output/*'].size == 1
91
- assert File.file?('output/a.css')
92
- refute File.file?('output/b.css')
93
- assert_match(/^p\s*\{\s*color:\s*red;?\s*\}/, File.read('output/a.css'))
94
-
95
- # Update included file
96
- File.open('content/b.less', 'w') do |io|
97
- io.write('p { color: blue; }')
98
- end
99
-
100
- # Recompile
101
- site = Nanoc::Int::SiteLoader.new.new_from_cwd
102
- site.compile
103
-
104
- # Recheck
105
- assert Dir['output/*'].size == 1
106
- assert File.file?('output/a.css')
107
- refute File.file?('output/b.css')
108
- assert_match(/^p\s*\{\s*color:\s*blue;?\s*\}/, File.read('output/a.css'))
109
- end
110
- end
111
- end
112
-
113
58
  def test_compression
114
59
  if_have 'less' do
115
60
  # Create item
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.3.7
4
+ version: 4.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-29 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri
@@ -86,6 +86,20 @@ dependencies:
86
86
  - - "<"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '2.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: appraisal
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '2.1'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '2.1'
89
103
  description: Nanoc is a static-site generator focused on flexibility. It transforms
90
104
  content from a format such as Markdown or AsciiDoc into another format, usually
91
105
  HTML, and lays out pages consistently to retain the site’s look and feel throughout.
@@ -95,12 +109,11 @@ executables:
95
109
  - nanoc
96
110
  extensions: []
97
111
  extra_rdoc_files:
98
- - ChangeLog
99
112
  - LICENSE
100
113
  - README.md
101
114
  - NEWS.md
102
115
  files:
103
- - ChangeLog
116
+ - Appraisals
104
117
  - Gemfile
105
118
  - Gemfile.lock
106
119
  - Guardfile
@@ -109,8 +122,6 @@ files:
109
122
  - README.md
110
123
  - Rakefile
111
124
  - bin/nanoc
112
- - doc/yardoc_handlers/identifier.rb
113
- - doc/yardoc_templates/default/layout/html/footer.erb
114
125
  - lib/nanoc.rb
115
126
  - lib/nanoc/base.rb
116
127
  - lib/nanoc/base/checksummer.rb
@@ -171,6 +182,7 @@ files:
171
182
  - lib/nanoc/base/services/item_rep_selector.rb
172
183
  - lib/nanoc/base/services/item_rep_writer.rb
173
184
  - lib/nanoc/base/services/notification_center.rb
185
+ - lib/nanoc/base/services/pruner.rb
174
186
  - lib/nanoc/base/services/temp_filename_factory.rb
175
187
  - lib/nanoc/base/views.rb
176
188
  - lib/nanoc/base/views/config_view.rb
@@ -198,6 +210,19 @@ files:
198
210
  - lib/nanoc/base/views/post_compile_item_view.rb
199
211
  - lib/nanoc/base/views/view.rb
200
212
  - lib/nanoc/base/views/view_context.rb
213
+ - lib/nanoc/checking.rb
214
+ - lib/nanoc/checking/check.rb
215
+ - lib/nanoc/checking/checks.rb
216
+ - lib/nanoc/checking/checks/css.rb
217
+ - lib/nanoc/checking/checks/external_links.rb
218
+ - lib/nanoc/checking/checks/html.rb
219
+ - lib/nanoc/checking/checks/internal_links.rb
220
+ - lib/nanoc/checking/checks/mixed_content.rb
221
+ - lib/nanoc/checking/checks/stale.rb
222
+ - lib/nanoc/checking/checks/w3c_validator.rb
223
+ - lib/nanoc/checking/dsl.rb
224
+ - lib/nanoc/checking/issue.rb
225
+ - lib/nanoc/checking/runner.rb
201
226
  - lib/nanoc/cli.rb
202
227
  - lib/nanoc/cli/ansi_string_colorizer.rb
203
228
  - lib/nanoc/cli/cleaning_stream.rb
@@ -221,32 +246,19 @@ files:
221
246
  - lib/nanoc/cli/stream_cleaners/utf8.rb
222
247
  - lib/nanoc/data_sources.rb
223
248
  - lib/nanoc/data_sources/filesystem.rb
249
+ - lib/nanoc/data_sources/filesystem/tools.rb
250
+ - lib/nanoc/deploying.rb
251
+ - lib/nanoc/deploying/deployer.rb
252
+ - lib/nanoc/deploying/deployers.rb
253
+ - lib/nanoc/deploying/deployers/fog.rb
254
+ - lib/nanoc/deploying/deployers/rsync.rb
224
255
  - lib/nanoc/extra.rb
225
- - lib/nanoc/extra/checking.rb
226
- - lib/nanoc/extra/checking/check.rb
227
- - lib/nanoc/extra/checking/checks.rb
228
- - lib/nanoc/extra/checking/checks/css.rb
229
- - lib/nanoc/extra/checking/checks/external_links.rb
230
- - lib/nanoc/extra/checking/checks/html.rb
231
- - lib/nanoc/extra/checking/checks/internal_links.rb
232
- - lib/nanoc/extra/checking/checks/mixed_content.rb
233
- - lib/nanoc/extra/checking/checks/stale.rb
234
- - lib/nanoc/extra/checking/checks/w3c_validator.rb
235
- - lib/nanoc/extra/checking/dsl.rb
236
- - lib/nanoc/extra/checking/issue.rb
237
- - lib/nanoc/extra/checking/runner.rb
238
256
  - lib/nanoc/extra/core_ext.rb
239
257
  - lib/nanoc/extra/core_ext/pathname.rb
240
258
  - lib/nanoc/extra/core_ext/time.rb
241
- - lib/nanoc/extra/deployer.rb
242
- - lib/nanoc/extra/deployers.rb
243
- - lib/nanoc/extra/deployers/fog.rb
244
- - lib/nanoc/extra/deployers/rsync.rb
245
- - lib/nanoc/extra/filesystem_tools.rb
246
259
  - lib/nanoc/extra/jruby_nokogiri_warner.rb
247
260
  - lib/nanoc/extra/link_collector.rb
248
261
  - lib/nanoc/extra/piper.rb
249
- - lib/nanoc/extra/pruner.rb
250
262
  - lib/nanoc/filters.rb
251
263
  - lib/nanoc/filters/asciidoc.rb
252
264
  - lib/nanoc/filters/bluecloth.rb
@@ -300,14 +312,10 @@ files:
300
312
  - lib/nanoc/spec.rb
301
313
  - lib/nanoc/version.rb
302
314
  - nanoc.gemspec
303
- - tasks/doc.rake
304
- - tasks/rubocop.rake
305
- - tasks/test.rake
306
315
  - test/base/core_ext/array_spec.rb
307
316
  - test/base/core_ext/hash_spec.rb
308
317
  - test/base/core_ext/pathname_spec.rb
309
318
  - test/base/core_ext/string_spec.rb
310
- - test/base/temp_filename_factory_spec.rb
311
319
  - test/base/test_checksum_store.rb
312
320
  - test/base/test_code_snippet.rb
313
321
  - test/base/test_compiler.rb
@@ -326,6 +334,15 @@ files:
326
334
  - test/base/test_plugin.rb
327
335
  - test/base/test_site.rb
328
336
  - test/base/test_store.rb
337
+ - test/checking/checks/test_css.rb
338
+ - test/checking/checks/test_external_links.rb
339
+ - test/checking/checks/test_html.rb
340
+ - test/checking/checks/test_internal_links.rb
341
+ - test/checking/checks/test_mixed_content.rb
342
+ - test/checking/checks/test_stale.rb
343
+ - test/checking/test_check.rb
344
+ - test/checking/test_dsl.rb
345
+ - test/checking/test_runner.rb
329
346
  - test/cli/commands/test_check.rb
330
347
  - test/cli/commands/test_compile.rb
331
348
  - test/cli/commands/test_create_site.rb
@@ -337,26 +354,21 @@ files:
337
354
  - test/cli/test_error_handler.rb
338
355
  - test/cli/test_logger.rb
339
356
  - test/data_sources/test_filesystem.rb
340
- - test/extra/checking/checks/test_css.rb
341
- - test/extra/checking/checks/test_external_links.rb
342
- - test/extra/checking/checks/test_html.rb
343
- - test/extra/checking/checks/test_internal_links.rb
344
- - test/extra/checking/checks/test_mixed_content.rb
345
- - test/extra/checking/checks/test_stale.rb
346
- - test/extra/checking/test_check.rb
347
- - test/extra/checking/test_dsl.rb
348
- - test/extra/checking/test_runner.rb
357
+ - test/data_sources/test_filesystem_tools.rb
358
+ - test/deploying/test_fog.rb
359
+ - test/deploying/test_rsync.rb
349
360
  - test/extra/core_ext/test_pathname.rb
350
361
  - test/extra/core_ext/test_time.rb
351
- - test/extra/deployers/test_fog.rb
352
- - test/extra/deployers/test_rsync.rb
353
- - test/extra/test_filesystem_tools.rb
354
362
  - test/extra/test_link_collector.rb
355
363
  - test/extra/test_piper.rb
364
+ - test/filters/colorize_syntax/test_coderay.rb
365
+ - test/filters/colorize_syntax/test_common.rb
366
+ - test/filters/colorize_syntax/test_pygmentize.rb
367
+ - test/filters/colorize_syntax/test_pygments.rb
368
+ - test/filters/colorize_syntax/test_simon.rb
356
369
  - test/filters/test_asciidoc.rb
357
370
  - test/filters/test_bluecloth.rb
358
371
  - test/filters/test_coffeescript.rb
359
- - test/filters/test_colorize_syntax.rb
360
372
  - test/filters/test_erb.rb
361
373
  - test/filters/test_erubis.rb
362
374
  - test/filters/test_haml.rb
@@ -417,7 +429,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
417
429
  version: '0'
418
430
  requirements: []
419
431
  rubyforge_project:
420
- rubygems_version: 2.6.7
432
+ rubygems_version: 2.6.8
421
433
  signing_key:
422
434
  specification_version: 4
423
435
  summary: A static-site generator with a focus on flexibility.
data/ChangeLog DELETED
@@ -1,3 +0,0 @@
1
- For a list of all changes, please see the changelog on the project repository
2
- instead (https://github.com/nanoc/nanoc). For release notes, please see the
3
- NEWS file.
@@ -1,30 +0,0 @@
1
- class NanocIdentifierHandler < ::YARD::Handlers::Ruby::AttributeHandler
2
- # e.g. identifier :foo, :bar
3
-
4
- handles method_call(:identifier), method_call(:identifiers)
5
- namespace_only
6
-
7
- def process
8
- identifiers = statement.parameters(false).map { |param| param.jump(:ident)[0] }
9
- namespace['nanoc_identifiers'] = identifiers
10
- end
11
- end
12
-
13
- class NanocRegisterFilterHandler < ::YARD::Handlers::Ruby::AttributeHandler
14
- # e.g. Nanoc::Filter.register '::Nanoc::Filters::AsciiDoc', :asciidoc
15
-
16
- handles method_call(:register)
17
- namespace_only
18
-
19
- def process
20
- target = statement.jump(:const_path_ref)
21
- return if target != s(:const_path_ref, s(:var_ref, s(:const, 'Nanoc')), s(:const, 'Filter'))
22
-
23
- class_name = statement.jump(:string_literal).jump(:tstring_content)[0]
24
- identifier = statement.jump(:symbol_literal).jump(:ident)[0]
25
-
26
- obj = YARD::Registry.at(class_name.sub(/^::/, ''))
27
- obj['nanoc_identifiers'] ||= []
28
- obj['nanoc_identifiers'] << identifier
29
- end
30
- end
@@ -1,19 +0,0 @@
1
- <%= superb %>
2
- <script type="text/javascript">
3
- var _gaq = _gaq || [];
4
- var pluginUrl = '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
5
- _gaq.push(['_require', 'inpage_linkid', pluginUrl]);
6
- _gaq.push(['_setAccount', 'UA-15639968-1']);
7
- _gaq.push(['_setDomainName', 'nanoc.ws']);
8
- _gaq.push(['_setAllowLinker', true]);
9
- _gaq.push(['_trackPageview']);
10
-
11
- (function() {
12
- var ga = document.createElement('script');
13
- ga.type = 'text/javascript';
14
- ga.async = true;
15
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
16
- var s = document.getElementsByTagName('script')[0];
17
- s.parentNode.insertBefore(ga, s);
18
- })();
19
- </script>
@@ -1,11 +0,0 @@
1
- module Nanoc::Extra
2
- # @api private
3
- module Checking
4
- autoload 'Check', 'nanoc/extra/checking/check'
5
- autoload 'DSL', 'nanoc/extra/checking/dsl'
6
- autoload 'Runner', 'nanoc/extra/checking/runner.rb'
7
- autoload 'Issue', 'nanoc/extra/checking/issue'
8
- end
9
- end
10
-
11
- require 'nanoc/extra/checking/checks'
@@ -1,20 +0,0 @@
1
- require_relative 'checks/w3c_validator'
2
-
3
- # @api private
4
- module Nanoc::Extra::Checking::Checks
5
- autoload 'CSS', 'nanoc/extra/checking/checks/css'
6
- autoload 'ExternalLinks', 'nanoc/extra/checking/checks/external_links'
7
- autoload 'HTML', 'nanoc/extra/checking/checks/html'
8
- autoload 'InternalLinks', 'nanoc/extra/checking/checks/internal_links'
9
- autoload 'Stale', 'nanoc/extra/checking/checks/stale'
10
- autoload 'MixedContent', 'nanoc/extra/checking/checks/mixed_content'
11
-
12
- Nanoc::Extra::Checking::Check.register '::Nanoc::Extra::Checking::Checks::CSS', :css
13
- Nanoc::Extra::Checking::Check.register '::Nanoc::Extra::Checking::Checks::ExternalLinks', :external_links
14
- Nanoc::Extra::Checking::Check.register '::Nanoc::Extra::Checking::Checks::ExternalLinks', :elinks
15
- Nanoc::Extra::Checking::Check.register '::Nanoc::Extra::Checking::Checks::HTML', :html
16
- Nanoc::Extra::Checking::Check.register '::Nanoc::Extra::Checking::Checks::InternalLinks', :internal_links
17
- Nanoc::Extra::Checking::Check.register '::Nanoc::Extra::Checking::Checks::InternalLinks', :ilinks
18
- Nanoc::Extra::Checking::Check.register '::Nanoc::Extra::Checking::Checks::Stale', :stale
19
- Nanoc::Extra::Checking::Check.register '::Nanoc::Extra::Checking::Checks::MixedContent', :mixed_content
20
- end
@@ -1,10 +0,0 @@
1
- module Nanoc::Extra
2
- # @api private
3
- module Deployers
4
- autoload 'Fog', 'nanoc/extra/deployers/fog'
5
- autoload 'Rsync', 'nanoc/extra/deployers/rsync'
6
-
7
- Nanoc::Extra::Deployer.register '::Nanoc::Extra::Deployers::Fog', :fog
8
- Nanoc::Extra::Deployer.register '::Nanoc::Extra::Deployers::Rsync', :rsync
9
- end
10
- end
@@ -1,16 +0,0 @@
1
- require 'yard'
2
-
3
- YARD::Rake::YardocTask.new(:doc) do |yard|
4
- yard.files = Dir['lib/**/*.rb']
5
- yard.options = [
6
- '--markup', 'markdown',
7
- '--markup-provider', 'kramdown',
8
- '--charset', 'utf-8',
9
- '--readme', 'README.md',
10
- '--files', 'NEWS.md,LICENSE',
11
- '--output-dir', 'doc/yardoc',
12
- '--template-path', 'doc/yardoc_templates',
13
- '--load', 'doc/yardoc_handlers/identifier.rb',
14
- '--query', '@api.text != "private"'
15
- ]
16
- end
@@ -1,6 +0,0 @@
1
- require 'rubocop/rake_task'
2
-
3
- RuboCop::RakeTask.new(:rubocop) do |task|
4
- task.options = %w(--display-cop-names --format simple)
5
- task.patterns = ['bin/nanoc', 'lib/**/*.rb', 'spec/**/*.rb', 'test/**/*.rb']
6
- end
@@ -1,25 +0,0 @@
1
- require 'rspec/core/rake_task'
2
- require 'rake/testtask'
3
- require 'coveralls/rake/task'
4
-
5
- Coveralls::RakeTask.new
6
-
7
- SUBDIRS = %w(* base cli data_sources extra filters helpers).freeze
8
-
9
- namespace :test do
10
- SUBDIRS.each do |dir|
11
- Rake::TestTask.new(dir == '*' ? 'all' : dir) do |t|
12
- t.test_files = Dir["test/#{dir}/**/*_spec.rb"] + Dir["test/#{dir}/**/test_*.rb"]
13
- t.libs = ['./lib', '.']
14
- t.ruby_opts = ['-r./test/helper']
15
- end
16
- end
17
- end
18
-
19
- RSpec::Core::RakeTask.new(:spec) do |t|
20
- t.rspec_opts = '-r ./spec/spec_helper.rb --format Fuubar --color'
21
- t.verbose = false
22
- end
23
-
24
- desc 'Run all tests and specs'
25
- task test: [:spec, :'test:all', :'coveralls:push']
@@ -1,66 +0,0 @@
1
- describe Nanoc::Int::TempFilenameFactory do
2
- subject do
3
- Nanoc::Int::TempFilenameFactory.new
4
- end
5
-
6
- let(:prefix) { 'foo' }
7
-
8
- describe '#create' do
9
- it 'should create unique paths' do
10
- path_a = subject.create(prefix)
11
- path_b = subject.create(prefix)
12
- path_a.wont_equal(path_b)
13
- end
14
-
15
- it 'should return absolute paths' do
16
- path = subject.create(prefix)
17
- path.must_match(/\A\//)
18
- end
19
-
20
- it 'should create the containing directory' do
21
- Dir[subject.root_dir + '/**/*'].must_equal([])
22
- path = subject.create(prefix)
23
- File.directory?(File.dirname(path)).must_equal(true)
24
- end
25
-
26
- it 'should reuse the same path after cleanup' do
27
- path_a = subject.create(prefix)
28
- subject.cleanup(prefix)
29
- path_b = subject.create(prefix)
30
- path_a.must_equal(path_b)
31
- end
32
- end
33
-
34
- describe '#cleanup' do
35
- it 'should remove generated files' do
36
- path_a = subject.create(prefix)
37
- File.file?(path_a).wont_equal(true) # not yet used
38
-
39
- File.open(path_a, 'w') { |io| io << 'hi!' }
40
- File.file?(path_a).must_equal(true)
41
-
42
- subject.cleanup(prefix)
43
- File.file?(path_a).wont_equal(true)
44
- end
45
-
46
- it 'should eventually delete the root directory' do
47
- subject.create(prefix)
48
- File.directory?(subject.root_dir).must_equal(true)
49
-
50
- subject.cleanup(prefix)
51
- File.directory?(subject.root_dir).wont_equal(true)
52
- end
53
- end
54
-
55
- describe 'other instance' do
56
- let(:other_instance) do
57
- Nanoc::Int::TempFilenameFactory.new
58
- end
59
-
60
- it 'should create unique paths across instances' do
61
- path_a = subject.create(prefix)
62
- path_b = other_instance.create(prefix)
63
- path_a.wont_equal(path_b)
64
- end
65
- end
66
- end