nanoc 3.8.0 → 4.0.0a1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +322 -0
- data/NEWS.md +6 -0
- data/bin/nanoc +0 -18
- data/lib/nanoc.rb +5 -3
- data/lib/nanoc/base.rb +24 -6
- data/lib/nanoc/base/checksummer.rb +6 -4
- data/lib/nanoc/base/compilation/checksum_store.rb +4 -4
- data/lib/nanoc/base/compilation/compiled_content_cache.rb +5 -5
- data/lib/nanoc/base/compilation/compiler.rb +60 -65
- data/lib/nanoc/base/compilation/compiler_dsl.rb +11 -9
- data/lib/nanoc/base/compilation/dependency_tracker.rb +24 -38
- data/lib/nanoc/base/compilation/filter.rb +22 -7
- data/lib/nanoc/base/compilation/item_rep_proxy.rb +14 -12
- data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +8 -8
- data/lib/nanoc/base/compilation/outdatedness_checker.rb +32 -32
- data/lib/nanoc/base/compilation/outdatedness_reasons.rb +3 -1
- data/lib/nanoc/base/compilation/rule.rb +9 -7
- data/lib/nanoc/base/compilation/rule_context.rb +15 -15
- data/lib/nanoc/base/compilation/rule_memory_calculator.rb +3 -3
- data/lib/nanoc/base/compilation/rule_memory_store.rb +7 -7
- data/lib/nanoc/base/compilation/rules_collection.rb +28 -30
- data/lib/nanoc/base/context.rb +2 -2
- data/lib/nanoc/base/core_ext/array.rb +17 -25
- data/lib/nanoc/base/core_ext/hash.rb +17 -25
- data/lib/nanoc/base/core_ext/pathname.rb +4 -2
- data/lib/nanoc/base/core_ext/string.rb +5 -3
- data/lib/nanoc/base/directed_graph.rb +4 -9
- data/lib/nanoc/base/error.rb +7 -0
- data/lib/nanoc/base/errors.rb +16 -23
- data/lib/nanoc/base/memoization.rb +4 -2
- data/lib/nanoc/base/notification_center.rb +3 -1
- data/lib/nanoc/base/plugin_registry.rb +14 -21
- data/lib/nanoc/base/result_data/item_rep.rb +43 -88
- data/lib/nanoc/base/source_data/code_snippet.rb +6 -4
- data/lib/nanoc/base/source_data/configuration.rb +3 -1
- data/lib/nanoc/base/source_data/data_source.rb +12 -94
- data/lib/nanoc/base/source_data/identifier.rb +50 -0
- data/lib/nanoc/base/source_data/item.rb +24 -67
- data/lib/nanoc/base/source_data/item_array.rb +6 -4
- data/lib/nanoc/base/source_data/layout.rb +17 -28
- data/lib/nanoc/base/source_data/site.rb +33 -44
- data/lib/nanoc/base/store.rb +3 -5
- data/lib/nanoc/base/temp_filename_factory.rb +3 -2
- data/lib/nanoc/base/views/config.rb +19 -0
- data/lib/nanoc/base/views/item.rb +77 -0
- data/lib/nanoc/base/views/item_collection.rb +43 -0
- data/lib/nanoc/base/views/item_rep.rb +125 -0
- data/lib/nanoc/base/views/layout.rb +42 -0
- data/lib/nanoc/base/views/layout_collection.rb +26 -0
- data/lib/nanoc/base/views/mutable_config.rb +9 -0
- data/lib/nanoc/base/views/mutable_item.rb +9 -0
- data/lib/nanoc/base/views/mutable_item_collection.rb +18 -0
- data/lib/nanoc/base/views/mutable_layout.rb +9 -0
- data/lib/nanoc/base/views/mutable_layout_collection.rb +18 -0
- data/lib/nanoc/base/views/site.rb +35 -0
- data/lib/nanoc/cli.rb +3 -6
- data/lib/nanoc/cli/ansi_string_colorizer.rb +2 -0
- data/lib/nanoc/cli/cleaning_stream.rb +2 -0
- data/lib/nanoc/cli/command_runner.rb +8 -42
- data/lib/nanoc/cli/commands/check.rb +2 -2
- data/lib/nanoc/cli/commands/compile.rb +19 -34
- data/lib/nanoc/cli/commands/create-site.rb +46 -83
- data/lib/nanoc/cli/commands/deploy.rb +4 -4
- data/lib/nanoc/cli/commands/shell.rb +1 -1
- data/lib/nanoc/cli/commands/show-plugins.rb +4 -6
- data/lib/nanoc/cli/error_handler.rb +4 -14
- data/lib/nanoc/cli/logger.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners.rb +1 -0
- data/lib/nanoc/cli/stream_cleaners/abstract.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners/utf8.rb +2 -0
- data/lib/nanoc/data_sources.rb +1 -17
- data/lib/nanoc/data_sources/filesystem.rb +6 -37
- data/lib/nanoc/data_sources/filesystem_unified.rb +5 -3
- data/lib/nanoc/data_sources/filesystem_verbose.rb +5 -3
- data/lib/nanoc/data_sources/static.rb +4 -2
- data/lib/nanoc/extra.rb +1 -13
- data/lib/nanoc/extra/checking.rb +1 -0
- data/lib/nanoc/extra/checking/check.rb +4 -2
- data/lib/nanoc/extra/checking/checks.rb +1 -0
- data/lib/nanoc/extra/checking/checks/css.rb +1 -0
- data/lib/nanoc/extra/checking/checks/external_links.rb +2 -0
- data/lib/nanoc/extra/checking/checks/html.rb +1 -0
- data/lib/nanoc/extra/checking/checks/internal_links.rb +2 -0
- data/lib/nanoc/extra/checking/checks/mixed_content.rb +2 -0
- data/lib/nanoc/extra/checking/checks/stale.rb +1 -0
- data/lib/nanoc/extra/checking/dsl.rb +1 -0
- data/lib/nanoc/extra/checking/issue.rb +1 -0
- data/lib/nanoc/extra/checking/runner.rb +3 -3
- data/lib/nanoc/extra/core_ext/pathname.rb +5 -3
- data/lib/nanoc/extra/core_ext/time.rb +4 -2
- data/lib/nanoc/extra/deployer.rb +3 -1
- data/lib/nanoc/extra/deployers.rb +1 -0
- data/lib/nanoc/extra/deployers/fog.rb +2 -0
- data/lib/nanoc/extra/deployers/rsync.rb +2 -0
- data/lib/nanoc/extra/filesystem_tools.rb +3 -7
- data/lib/nanoc/extra/jruby_nokogiri_warner.rb +1 -0
- data/lib/nanoc/extra/link_collector.rb +1 -0
- data/lib/nanoc/extra/piper.rb +2 -1
- data/lib/nanoc/extra/pruner.rb +5 -3
- data/lib/nanoc/filters.rb +1 -2
- data/lib/nanoc/filters/asciidoc.rb +2 -0
- data/lib/nanoc/filters/bluecloth.rb +1 -0
- data/lib/nanoc/filters/coffeescript.rb +2 -0
- data/lib/nanoc/filters/colorize_syntax.rb +1 -12
- data/lib/nanoc/filters/erb.rb +2 -1
- data/lib/nanoc/filters/erubis.rb +2 -1
- data/lib/nanoc/filters/haml.rb +2 -1
- data/lib/nanoc/filters/handlebars.rb +2 -0
- data/lib/nanoc/filters/kramdown.rb +1 -0
- data/lib/nanoc/filters/less.rb +1 -0
- data/lib/nanoc/filters/markaby.rb +1 -0
- data/lib/nanoc/filters/maruku.rb +1 -0
- data/lib/nanoc/filters/mustache.rb +2 -0
- data/lib/nanoc/filters/pandoc.rb +1 -0
- data/lib/nanoc/filters/rainpress.rb +1 -0
- data/lib/nanoc/filters/rdiscount.rb +1 -0
- data/lib/nanoc/filters/rdoc.rb +1 -0
- data/lib/nanoc/filters/redcarpet.rb +2 -0
- data/lib/nanoc/filters/redcloth.rb +1 -0
- data/lib/nanoc/filters/relativize_paths.rb +1 -0
- data/lib/nanoc/filters/rubypants.rb +1 -0
- data/lib/nanoc/filters/sass.rb +1 -0
- data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +2 -0
- data/lib/nanoc/filters/slim.rb +3 -1
- data/lib/nanoc/filters/typogruby.rb +2 -0
- data/lib/nanoc/filters/uglify_js.rb +1 -0
- data/lib/nanoc/filters/xsl.rb +2 -0
- data/lib/nanoc/filters/yui_compressor.rb +2 -0
- data/lib/nanoc/helpers/blogging.rb +30 -30
- data/lib/nanoc/helpers/breadcrumbs.rb +2 -2
- data/lib/nanoc/helpers/capturing.rb +6 -17
- data/lib/nanoc/helpers/filtering.rb +3 -3
- data/lib/nanoc/helpers/link_to.rb +3 -3
- data/lib/nanoc/helpers/rendering.rb +11 -11
- data/lib/nanoc/helpers/xml_sitemap.rb +3 -3
- data/lib/nanoc/tasks.rb +1 -0
- data/lib/nanoc/tasks/clean.rake +1 -1
- data/lib/nanoc/version.rb +1 -1
- data/tasks/doc.rake +2 -1
- data/tasks/test.rake +7 -1
- data/test/base/checksummer_spec.rb +15 -15
- data/test/base/core_ext/array_spec.rb +10 -10
- data/test/base/core_ext/hash_spec.rb +16 -16
- data/test/base/core_ext/pathname_spec.rb +2 -2
- data/test/base/core_ext/string_spec.rb +9 -9
- data/test/base/temp_filename_factory_spec.rb +3 -7
- data/test/base/test_checksum_store.rb +5 -5
- data/test/base/test_code_snippet.rb +3 -3
- data/test/base/test_compiler.rb +29 -29
- data/test/base/test_compiler_dsl.rb +23 -23
- data/test/base/test_context.rb +4 -4
- data/test/base/test_data_source.rb +17 -7
- data/test/base/test_dependency_tracker.rb +29 -29
- data/test/base/test_directed_graph.rb +27 -27
- data/test/base/test_item.rb +23 -21
- data/test/base/test_item_array.rb +18 -18
- data/test/base/test_item_rep.rb +76 -76
- data/test/base/test_item_rep_recorder_proxy.rb +4 -4
- data/test/base/test_layout.rb +8 -16
- data/test/base/test_memoization.rb +4 -4
- data/test/base/test_notification_center.rb +6 -6
- data/test/base/test_outdatedness_checker.rb +18 -18
- data/test/base/test_plugin.rb +1 -1
- data/test/base/test_rule.rb +2 -2
- data/test/base/test_rule_context.rb +5 -5
- data/test/base/test_site.rb +62 -38
- data/test/base/test_store.rb +2 -2
- data/test/cli/commands/test_check.rb +1 -1
- data/test/cli/commands/test_compile.rb +24 -18
- data/test/cli/commands/test_create_site.rb +5 -7
- data/test/cli/commands/test_deploy.rb +1 -1
- data/test/data_sources/test_filesystem.rb +22 -67
- data/test/data_sources/test_filesystem_unified.rb +10 -23
- data/test/data_sources/test_filesystem_verbose.rb +8 -53
- data/test/data_sources/test_static.rb +9 -9
- data/test/extra/checking/checks/test_stale.rb +1 -1
- data/test/extra/core_ext/test_pathname.rb +3 -3
- data/test/extra/core_ext/test_time.rb +4 -4
- data/test/extra/test_filesystem_tools.rb +1 -1
- data/test/filters/test_handlebars.rb +3 -3
- data/test/filters/test_less.rb +6 -6
- data/test/filters/test_mustache.rb +2 -2
- data/test/filters/test_relativize_paths.rb +81 -81
- data/test/filters/test_sass.rb +7 -7
- data/test/filters/test_xsl.rb +6 -6
- data/test/helper.rb +1 -1
- data/test/helpers/test_blogging.rb +78 -99
- data/test/helpers/test_breadcrumbs.rb +12 -12
- data/test/helpers/test_capturing.rb +10 -11
- data/test/helpers/test_filtering.rb +6 -6
- data/test/helpers/test_rendering.rb +3 -3
- data/test/helpers/test_tagging.rb +7 -7
- data/test/helpers/test_xml_sitemap.rb +34 -33
- metadata +19 -43
- data/lib/nanoc/cli/commands/autocompile.rb +0 -69
- data/lib/nanoc/cli/commands/create-item.rb +0 -55
- data/lib/nanoc/cli/commands/create-layout.rb +0 -68
- data/lib/nanoc/cli/commands/sync.rb +0 -32
- data/lib/nanoc/cli/commands/update.rb +0 -63
- data/lib/nanoc/cli/commands/validate-css.rb +0 -20
- data/lib/nanoc/cli/commands/validate-html.rb +0 -20
- data/lib/nanoc/cli/commands/validate-links.rb +0 -27
- data/lib/nanoc/cli/commands/watch.rb +0 -176
- data/lib/nanoc/data_sources/deprecated/delicious.rb +0 -38
- data/lib/nanoc/data_sources/deprecated/last_fm.rb +0 -85
- data/lib/nanoc/data_sources/deprecated/twitter.rb +0 -34
- data/lib/nanoc/extra/auto_compiler.rb +0 -99
- data/lib/nanoc/extra/chick.rb +0 -117
- data/lib/nanoc/extra/file_proxy.rb +0 -36
- data/lib/nanoc/extra/validators.rb +0 -8
- data/lib/nanoc/extra/validators/links.rb +0 -18
- data/lib/nanoc/extra/validators/w3c.rb +0 -23
- data/lib/nanoc/extra/vcs.rb +0 -62
- data/lib/nanoc/extra/vcses.rb +0 -15
- data/lib/nanoc/extra/vcses/bazaar.rb +0 -21
- data/lib/nanoc/extra/vcses/dummy.rb +0 -20
- data/lib/nanoc/extra/vcses/git.rb +0 -21
- data/lib/nanoc/extra/vcses/mercurial.rb +0 -21
- data/lib/nanoc/extra/vcses/subversion.rb +0 -21
- data/lib/nanoc/filters/coderay.rb +0 -19
- data/lib/nanoc3.rb +0 -3
- data/lib/nanoc3/cli.rb +0 -3
- data/lib/nanoc3/tasks.rb +0 -3
- data/test/cli/commands/test_create_item.rb +0 -10
- data/test/cli/commands/test_create_layout.rb +0 -24
- data/test/cli/commands/test_sync.rb +0 -27
- data/test/cli/commands/test_update.rb +0 -6
- data/test/cli/commands/test_watch.rb +0 -74
- data/test/extra/test_auto_compiler.rb +0 -437
- data/test/extra/test_vcs.rb +0 -18
- data/test/extra/validators/test_links.rb +0 -4
- data/test/extra/validators/test_w3c.rb +0 -37
- data/test/filters/test_coderay.rb +0 -40
data/test/extra/test_vcs.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
class Nanoc::Extra::VCSTest < Nanoc::TestCase
|
4
|
-
def test_named
|
5
|
-
assert_nil(Nanoc::Extra::VCS.named(:lkasjdlkfjlkasdfkj))
|
6
|
-
|
7
|
-
refute_nil(Nanoc::Extra::VCS.named(:svn))
|
8
|
-
refute_nil(Nanoc::Extra::VCS.named(:subversion))
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_not_implemented
|
12
|
-
vcs = Nanoc::Extra::VCS.new
|
13
|
-
|
14
|
-
assert_raises(NotImplementedError) { vcs.add('x') }
|
15
|
-
assert_raises(NotImplementedError) { vcs.remove('x') }
|
16
|
-
assert_raises(NotImplementedError) { vcs.move('x', 'y') }
|
17
|
-
end
|
18
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
class Nanoc::Extra::Validators::W3CTest < Nanoc::TestCase
|
4
|
-
def test_simple
|
5
|
-
if_have 'w3c_validators' do
|
6
|
-
with_site do |_site|
|
7
|
-
# Create some sample files
|
8
|
-
%w(foo bar baz).each do |filename|
|
9
|
-
%w(xxx yyy).each do |extension|
|
10
|
-
File.open("output/#{filename}.#{extension}", 'w') { |io| io.write('hello') }
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
# Create validator
|
15
|
-
w3c = Nanoc::Extra::Validators::W3C.new('.', [:html])
|
16
|
-
|
17
|
-
# Run
|
18
|
-
w3c.run
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_with_unknown_types
|
24
|
-
if_have 'w3c_validators' do
|
25
|
-
with_site do |_site|
|
26
|
-
# Create validator
|
27
|
-
w3c = Nanoc::Extra::Validators::W3C.new('.', [:foo])
|
28
|
-
|
29
|
-
# Test
|
30
|
-
exception = assert_raises Nanoc::Errors::GenericTrivial do
|
31
|
-
w3c.run
|
32
|
-
end
|
33
|
-
assert_equal 'unknown type(s) specified: foo', exception.message
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
class Nanoc::Filters::CodeRayTest < Nanoc::TestCase
|
4
|
-
def test_filter_without_language
|
5
|
-
if_have 'coderay' do
|
6
|
-
# Get filter
|
7
|
-
filter = ::Nanoc::Filters::CodeRay.new
|
8
|
-
|
9
|
-
# Run filter
|
10
|
-
code = "def some_function ; x = blah.foo ; x.bar 'xyzzy' ; end"
|
11
|
-
assert_raises(ArgumentError) do
|
12
|
-
filter.setup_and_run(code)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_filter_with_known_language
|
18
|
-
if_have 'coderay' do
|
19
|
-
# Get filter
|
20
|
-
filter = ::Nanoc::Filters::CodeRay.new
|
21
|
-
|
22
|
-
# Run filter
|
23
|
-
code = "def some_function ; x = blah.foo ; x.bar 'xyzzy' ; end"
|
24
|
-
result = filter.setup_and_run(code, language: 'ruby')
|
25
|
-
assert_match %r{^<span class="keyword">def</span> <span class="function">some_function</span>}, result
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_filter_with_unknown_language
|
30
|
-
if_have 'coderay' do
|
31
|
-
# Get filter
|
32
|
-
filter = ::Nanoc::Filters::CodeRay.new
|
33
|
-
|
34
|
-
# Run filter
|
35
|
-
code = "def some_function ; x = blah.foo ; x.bar 'xyzzy' ; end"
|
36
|
-
result = filter.setup_and_run(code, language: 'skldfhjsdhfjszfnocmluhfixfmersumulh')
|
37
|
-
assert_equal code, result
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|