nanoc 3.7.4 → 3.7.5
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.
- checksums.yaml +4 -4
- data/Gemfile +19 -18
- data/LICENSE +1 -1
- data/NEWS.md +14 -0
- data/Rakefile +1 -1
- data/doc/yardoc_handlers/identifier.rb +1 -5
- data/lib/nanoc.rb +1 -3
- data/lib/nanoc/base.rb +1 -4
- data/lib/nanoc/base/checksummer.rb +10 -12
- data/lib/nanoc/base/compilation/checksum_store.rb +0 -4
- data/lib/nanoc/base/compilation/compiled_content_cache.rb +0 -4
- data/lib/nanoc/base/compilation/compiler.rb +27 -31
- data/lib/nanoc/base/compilation/compiler_dsl.rb +3 -7
- data/lib/nanoc/base/compilation/dependency_tracker.rb +2 -6
- data/lib/nanoc/base/compilation/filter.rb +1 -7
- data/lib/nanoc/base/compilation/item_rep_proxy.rb +0 -4
- data/lib/nanoc/base/compilation/item_rep_recorder_proxy.rb +0 -4
- data/lib/nanoc/base/compilation/outdatedness_checker.rb +0 -4
- data/lib/nanoc/base/compilation/outdatedness_reasons.rb +0 -6
- data/lib/nanoc/base/compilation/rule.rb +1 -5
- data/lib/nanoc/base/compilation/rule_context.rb +7 -11
- data/lib/nanoc/base/compilation/rule_memory_calculator.rb +0 -4
- data/lib/nanoc/base/compilation/rule_memory_store.rb +0 -4
- data/lib/nanoc/base/compilation/rules_collection.rb +5 -9
- data/lib/nanoc/base/context.rb +0 -3
- data/lib/nanoc/base/core_ext.rb +0 -1
- data/lib/nanoc/base/core_ext/array.rb +0 -2
- data/lib/nanoc/base/core_ext/hash.rb +0 -2
- data/lib/nanoc/base/core_ext/pathname.rb +0 -2
- data/lib/nanoc/base/core_ext/string.rb +0 -2
- data/lib/nanoc/base/directed_graph.rb +0 -4
- data/lib/nanoc/base/errors.rb +1 -39
- data/lib/nanoc/base/memoization.rb +0 -4
- data/lib/nanoc/base/notification_center.rb +1 -7
- data/lib/nanoc/base/plugin_registry.rb +4 -10
- data/lib/nanoc/base/result_data/item_rep.rb +8 -16
- data/lib/nanoc/base/source_data/code_snippet.rb +1 -5
- data/lib/nanoc/base/source_data/configuration.rb +0 -4
- data/lib/nanoc/base/source_data/data_source.rb +2 -5
- data/lib/nanoc/base/source_data/item.rb +3 -7
- data/lib/nanoc/base/source_data/item_array.rb +1 -5
- data/lib/nanoc/base/source_data/layout.rb +2 -6
- data/lib/nanoc/base/source_data/site.rb +20 -23
- data/lib/nanoc/base/store.rb +1 -5
- data/lib/nanoc/base/temp_filename_factory.rb +0 -4
- data/lib/nanoc/cli.rb +3 -5
- data/lib/nanoc/cli/ansi_string_colorizer.rb +6 -10
- data/lib/nanoc/cli/cleaning_stream.rb +2 -6
- data/lib/nanoc/cli/command_runner.rb +1 -5
- data/lib/nanoc/cli/commands/autocompile.rb +2 -6
- data/lib/nanoc/cli/commands/check.rb +0 -4
- data/lib/nanoc/cli/commands/compile.rb +12 -27
- data/lib/nanoc/cli/commands/create-item.rb +1 -5
- data/lib/nanoc/cli/commands/create-layout.rb +0 -4
- data/lib/nanoc/cli/commands/create-site.rb +2 -8
- data/lib/nanoc/cli/commands/deploy.rb +3 -7
- data/lib/nanoc/cli/commands/prune.rb +2 -6
- data/lib/nanoc/cli/commands/shell.rb +4 -8
- data/lib/nanoc/cli/commands/show-data.rb +3 -7
- data/lib/nanoc/cli/commands/show-plugins.rb +3 -7
- data/lib/nanoc/cli/commands/show-rules.rb +11 -15
- data/lib/nanoc/cli/commands/sync.rb +0 -4
- data/lib/nanoc/cli/commands/update.rb +1 -7
- data/lib/nanoc/cli/commands/validate-css.rb +0 -4
- data/lib/nanoc/cli/commands/validate-html.rb +0 -4
- data/lib/nanoc/cli/commands/validate-links.rb +0 -4
- data/lib/nanoc/cli/commands/view.rb +3 -7
- data/lib/nanoc/cli/commands/watch.rb +4 -10
- data/lib/nanoc/cli/error_handler.rb +9 -13
- data/lib/nanoc/cli/logger.rb +8 -12
- data/lib/nanoc/cli/stream_cleaners.rb +0 -4
- data/lib/nanoc/cli/stream_cleaners/abstract.rb +1 -5
- data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +0 -4
- data/lib/nanoc/cli/stream_cleaners/utf8.rb +1 -5
- data/lib/nanoc/data_sources.rb +2 -4
- data/lib/nanoc/data_sources/deprecated/delicious.rb +6 -10
- data/lib/nanoc/data_sources/deprecated/last_fm.rb +7 -11
- data/lib/nanoc/data_sources/deprecated/twitter.rb +2 -6
- data/lib/nanoc/data_sources/filesystem.rb +10 -13
- data/lib/nanoc/data_sources/filesystem_unified.rb +0 -4
- data/lib/nanoc/data_sources/filesystem_verbose.rb +0 -4
- data/lib/nanoc/data_sources/static.rb +4 -8
- data/lib/nanoc/extra.rb +2 -4
- data/lib/nanoc/extra/auto_compiler.rb +2 -6
- data/lib/nanoc/extra/checking.rb +0 -4
- data/lib/nanoc/extra/checking/check.rb +0 -4
- data/lib/nanoc/extra/checking/checks.rb +0 -2
- data/lib/nanoc/extra/checking/checks/css.rb +6 -6
- data/lib/nanoc/extra/checking/checks/external_links.rb +3 -11
- data/lib/nanoc/extra/checking/checks/html.rb +6 -6
- data/lib/nanoc/extra/checking/checks/internal_links.rb +3 -7
- data/lib/nanoc/extra/checking/checks/stale.rb +3 -7
- data/lib/nanoc/extra/checking/dsl.rb +0 -4
- data/lib/nanoc/extra/checking/issue.rb +0 -4
- data/lib/nanoc/extra/checking/runner.rb +4 -7
- data/lib/nanoc/extra/chick.rb +7 -17
- data/lib/nanoc/extra/core_ext.rb +0 -1
- data/lib/nanoc/extra/core_ext/pathname.rb +0 -4
- data/lib/nanoc/extra/core_ext/time.rb +0 -2
- data/lib/nanoc/extra/deployer.rb +0 -4
- data/lib/nanoc/extra/deployers.rb +0 -4
- data/lib/nanoc/extra/deployers/fog.rb +7 -11
- data/lib/nanoc/extra/deployers/rsync.rb +1 -5
- data/lib/nanoc/extra/file_proxy.rb +1 -5
- data/lib/nanoc/extra/filesystem_tools.rb +37 -12
- data/lib/nanoc/extra/jruby_nokogiri_warner.rb +0 -4
- data/lib/nanoc/extra/link_collector.rb +3 -7
- data/lib/nanoc/extra/piper.rb +0 -6
- data/lib/nanoc/extra/pruner.rb +1 -7
- data/lib/nanoc/extra/validators.rb +0 -4
- data/lib/nanoc/extra/validators/links.rb +0 -4
- data/lib/nanoc/extra/validators/w3c.rb +0 -4
- data/lib/nanoc/extra/vcs.rb +3 -7
- data/lib/nanoc/extra/vcses.rb +0 -2
- data/lib/nanoc/extra/vcses/bazaar.rb +0 -4
- data/lib/nanoc/extra/vcses/dummy.rb +0 -4
- data/lib/nanoc/extra/vcses/git.rb +0 -4
- data/lib/nanoc/extra/vcses/mercurial.rb +0 -4
- data/lib/nanoc/extra/vcses/subversion.rb +0 -4
- data/lib/nanoc/filters.rb +0 -2
- data/lib/nanoc/filters/asciidoc.rb +1 -5
- data/lib/nanoc/filters/bluecloth.rb +0 -2
- data/lib/nanoc/filters/coderay.rb +0 -2
- data/lib/nanoc/filters/coffeescript.rb +0 -4
- data/lib/nanoc/filters/colorize_syntax.rb +17 -15
- data/lib/nanoc/filters/erb.rb +1 -3
- data/lib/nanoc/filters/erubis.rb +2 -4
- data/lib/nanoc/filters/haml.rb +2 -4
- data/lib/nanoc/filters/handlebars.rb +0 -4
- data/lib/nanoc/filters/kramdown.rb +7 -4
- data/lib/nanoc/filters/less.rb +1 -3
- data/lib/nanoc/filters/markaby.rb +0 -2
- data/lib/nanoc/filters/maruku.rb +0 -2
- data/lib/nanoc/filters/mustache.rb +1 -5
- data/lib/nanoc/filters/pandoc.rb +0 -2
- data/lib/nanoc/filters/rainpress.rb +0 -2
- data/lib/nanoc/filters/rdiscount.rb +0 -2
- data/lib/nanoc/filters/rdoc.rb +0 -2
- data/lib/nanoc/filters/redcarpet.rb +0 -4
- data/lib/nanoc/filters/redcloth.rb +0 -2
- data/lib/nanoc/filters/relativize_paths.rb +2 -4
- data/lib/nanoc/filters/rubypants.rb +0 -2
- data/lib/nanoc/filters/sass.rb +2 -4
- data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +0 -2
- data/lib/nanoc/filters/slim.rb +2 -6
- data/lib/nanoc/filters/typogruby.rb +0 -4
- data/lib/nanoc/filters/uglify_js.rb +0 -2
- data/lib/nanoc/filters/xsl.rb +1 -5
- data/lib/nanoc/filters/yui_compressor.rb +0 -4
- data/lib/nanoc/helpers.rb +0 -2
- data/lib/nanoc/helpers/blogging.rb +12 -20
- data/lib/nanoc/helpers/breadcrumbs.rb +0 -4
- data/lib/nanoc/helpers/capturing.rb +2 -10
- data/lib/nanoc/helpers/filtering.rb +0 -4
- data/lib/nanoc/helpers/html_escape.rb +3 -7
- data/lib/nanoc/helpers/link_to.rb +0 -4
- data/lib/nanoc/helpers/rendering.rb +8 -12
- data/lib/nanoc/helpers/tagging.rb +0 -4
- data/lib/nanoc/helpers/text.rb +1 -5
- data/lib/nanoc/helpers/xml_sitemap.rb +3 -7
- data/lib/nanoc/tasks/clean.rb +1 -7
- data/lib/nanoc/tasks/deploy/rsync.rake +0 -2
- data/lib/nanoc/tasks/validate.rake +0 -4
- data/lib/nanoc/version.rb +1 -3
- data/nanoc.gemspec +12 -9
- data/tasks/rubocop.rake +1 -1
- data/tasks/test.rake +6 -7
- data/test/base/checksummer_spec.rb +28 -44
- data/test/base/core_ext/array_spec.rb +1 -9
- data/test/base/core_ext/hash_spec.rb +7 -19
- data/test/base/core_ext/pathname_spec.rb +2 -4
- data/test/base/core_ext/string_spec.rb +0 -4
- data/test/base/temp_filename_factory_spec.rb +0 -8
- data/test/base/test_checksum_store.rb +0 -2
- data/test/base/test_code_snippet.rb +0 -2
- data/test/base/test_compiler.rb +15 -17
- data/test/base/test_compiler_dsl.rb +7 -9
- data/test/base/test_context.rb +2 -4
- data/test/base/test_data_source.rb +0 -2
- data/test/base/test_dependency_tracker.rb +0 -2
- data/test/base/test_directed_graph.rb +2 -4
- data/test/base/test_filter.rb +5 -7
- data/test/base/test_item.rb +17 -13
- data/test/base/test_item_array.rb +2 -4
- data/test/base/test_item_rep.rb +79 -73
- data/test/base/test_layout.rb +3 -5
- data/test/base/test_memoization.rb +13 -21
- data/test/base/test_notification_center.rb +0 -2
- data/test/base/test_outdatedness_checker.rb +34 -36
- data/test/base/test_plugin.rb +0 -2
- data/test/base/test_rule.rb +3 -5
- data/test/base/test_rule_context.rb +4 -6
- data/test/base/test_site.rb +9 -17
- data/test/base/test_store.rb +2 -6
- data/test/cli/commands/test_check.rb +1 -3
- data/test/cli/commands/test_compile.rb +24 -15
- data/test/cli/commands/test_create_item.rb +1 -3
- data/test/cli/commands/test_create_layout.rb +0 -2
- data/test/cli/commands/test_create_site.rb +0 -3
- data/test/cli/commands/test_deploy.rb +9 -11
- data/test/cli/commands/test_help.rb +0 -2
- data/test/cli/commands/test_info.rb +0 -2
- data/test/cli/commands/test_prune.rb +6 -8
- data/test/cli/commands/test_sync.rb +0 -2
- data/test/cli/commands/test_update.rb +0 -2
- data/test/cli/commands/test_watch.rb +4 -6
- data/test/cli/test_cleaning_stream.rb +4 -6
- data/test/cli/test_cli.rb +9 -5
- data/test/cli/test_error_handler.rb +9 -7
- data/test/cli/test_logger.rb +0 -2
- data/test/data_sources/test_filesystem.rb +8 -10
- data/test/data_sources/test_filesystem_unified.rb +35 -34
- data/test/data_sources/test_filesystem_verbose.rb +31 -33
- data/test/data_sources/test_static.rb +20 -21
- data/test/extra/checking/checks/test_css.rb +23 -2
- data/test/extra/checking/checks/test_external_links.rb +2 -4
- data/test/extra/checking/checks/test_html.rb +4 -3
- data/test/extra/checking/checks/test_internal_links.rb +1 -3
- data/test/extra/checking/checks/test_stale.rb +4 -6
- data/test/extra/checking/test_check.rb +0 -2
- data/test/extra/checking/test_dsl.rb +1 -3
- data/test/extra/checking/test_runner.rb +0 -2
- data/test/extra/core_ext/test_pathname.rb +0 -3
- data/test/extra/core_ext/test_time.rb +0 -2
- data/test/extra/deployers/test_fog.rb +13 -15
- data/test/extra/deployers/test_rsync.rb +4 -6
- data/test/extra/test_auto_compiler.rb +47 -25
- data/test/extra/test_file_proxy.rb +1 -3
- data/test/extra/test_filesystem_tools.rb +47 -7
- data/test/extra/test_link_collector.rb +0 -2
- data/test/extra/test_piper.rb +3 -5
- data/test/extra/test_vcs.rb +0 -2
- data/test/extra/validators/test_links.rb +0 -1
- data/test/extra/validators/test_w3c.rb +2 -4
- data/test/filters/test_asciidoc.rb +0 -2
- data/test/filters/test_bluecloth.rb +0 -2
- data/test/filters/test_coderay.rb +2 -4
- data/test/filters/test_coffeescript.rb +0 -2
- data/test/filters/test_colorize_syntax.rb +16 -18
- data/test/filters/test_erb.rb +12 -14
- data/test/filters/test_erubis.rb +4 -6
- data/test/filters/test_haml.rb +7 -9
- data/test/filters/test_handlebars.rb +10 -12
- data/test/filters/test_kramdown.rb +13 -1
- data/test/filters/test_less.rb +9 -11
- data/test/filters/test_markaby.rb +0 -2
- data/test/filters/test_maruku.rb +0 -2
- data/test/filters/test_mustache.rb +4 -6
- data/test/filters/test_pandoc.rb +1 -3
- data/test/filters/test_rainpress.rb +1 -3
- data/test/filters/test_rdiscount.rb +1 -3
- data/test/filters/test_rdoc.rb +0 -2
- data/test/filters/test_redcarpet.rb +6 -8
- data/test/filters/test_redcloth.rb +1 -3
- data/test/filters/test_relativize_paths.rb +29 -34
- data/test/filters/test_rubypants.rb +0 -2
- data/test/filters/test_sass.rb +8 -10
- data/test/filters/test_slim.rb +2 -4
- data/test/filters/test_typogruby.rb +0 -3
- data/test/filters/test_uglify_js.rb +2 -4
- data/test/filters/test_xsl.rb +16 -18
- data/test/filters/test_yui_compressor.rb +3 -5
- data/test/fixtures/vcr_cassettes/css_run_parse_error.yml +65 -0
- data/test/gem_loader.rb +1 -1
- data/test/helper.rb +11 -15
- data/test/helpers/test_blogging.rb +61 -63
- data/test/helpers/test_breadcrumbs.rb +0 -2
- data/test/helpers/test_capturing.rb +4 -6
- data/test/helpers/test_filtering.rb +2 -4
- data/test/helpers/test_html_escape.rb +0 -2
- data/test/helpers/test_link_to.rb +5 -6
- data/test/helpers/test_rendering.rb +2 -4
- data/test/helpers/test_tagging.rb +9 -11
- data/test/helpers/test_text.rb +6 -8
- data/test/helpers/test_xml_sitemap.rb +11 -13
- data/test/tasks/test_clean.rb +0 -2
- data/test/test_gem.rb +1 -3
- metadata +15 -14
- data/Gemfile.lock +0 -252
- data/lib/nanoc/base/core_ext/date.rb +0 -29
- data/lib/nanoc/base/ordered_hash.rb +0 -228
- data/lib/nanoc/extra/core_ext/enumerable.rb +0 -33
- data/test/base/core_ext/date_spec.rb +0 -15
- data/test/extra/core_ext/test_enumerable.rb +0 -28
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
class Nanoc::Extra::Checking::RunnerTest < Nanoc::TestCase
|
|
4
|
-
|
|
5
4
|
def test_run_specific
|
|
6
5
|
with_site do |site|
|
|
7
6
|
File.open('output/blah', 'w') { |io| io.write('I am stale! Haha!') }
|
|
@@ -41,5 +40,4 @@ class Nanoc::Extra::Checking::RunnerTest < Nanoc::TestCase
|
|
|
41
40
|
assert ios[:stderr].empty?
|
|
42
41
|
end
|
|
43
42
|
end
|
|
44
|
-
|
|
45
43
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
class Nanoc::Extra::CoreExtPathnameTest < Nanoc::TestCase
|
|
4
|
-
|
|
5
4
|
def test_components
|
|
6
5
|
assert_equal %w( / a bb ccc dd e ), Pathname.new('/a/bb/ccc/dd/e').components
|
|
7
6
|
end
|
|
@@ -10,6 +9,4 @@ class Nanoc::Extra::CoreExtPathnameTest < Nanoc::TestCase
|
|
|
10
9
|
assert Pathname.new('/home/ddfreyne/').include_component?('ddfreyne')
|
|
11
10
|
refute Pathname.new('/home/ddfreyne/').include_component?('acid')
|
|
12
11
|
end
|
|
13
|
-
|
|
14
12
|
end
|
|
15
|
-
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
class Nanoc::ExtraCoreExtTimeTest < Nanoc::TestCase
|
|
4
|
-
|
|
5
4
|
def test_to_iso8601_date
|
|
6
5
|
assert_equal('2008-05-19', Time.utc(2008, 5, 19, 14, 20, 0, 0).to_iso8601_date)
|
|
7
6
|
end
|
|
@@ -9,5 +8,4 @@ class Nanoc::ExtraCoreExtTimeTest < Nanoc::TestCase
|
|
|
9
8
|
def test_to_iso8601_time
|
|
10
9
|
assert_equal('2008-05-19T14:20:00Z', Time.utc(2008, 5, 19, 14, 20, 0, 0).to_iso8601_time)
|
|
11
10
|
end
|
|
12
|
-
|
|
13
11
|
end
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
class Nanoc::Extra::Deployers::FogTest < Nanoc::TestCase
|
|
4
|
-
|
|
5
4
|
def test_run
|
|
6
5
|
if_have 'fog' do
|
|
7
6
|
# Create deployer
|
|
8
7
|
fog = Nanoc::Extra::Deployers::Fog.new(
|
|
9
8
|
'output/',
|
|
10
9
|
{
|
|
11
|
-
:
|
|
12
|
-
:
|
|
13
|
-
:
|
|
10
|
+
bucket: 'mybucket',
|
|
11
|
+
provider: 'local',
|
|
12
|
+
local_root: 'mylocalcloud' })
|
|
14
13
|
|
|
15
14
|
# Create site
|
|
16
15
|
FileUtils.mkdir_p('output')
|
|
@@ -38,12 +37,12 @@ class Nanoc::Extra::Deployers::FogTest < Nanoc::TestCase
|
|
|
38
37
|
fog = Nanoc::Extra::Deployers::Fog.new(
|
|
39
38
|
'output/',
|
|
40
39
|
{
|
|
41
|
-
:
|
|
42
|
-
# FIXME bucket is necessary for deployer but fog doesn't like it
|
|
43
|
-
:
|
|
44
|
-
:
|
|
45
|
-
:
|
|
46
|
-
:
|
|
40
|
+
provider: 'aws',
|
|
41
|
+
# FIXME: bucket is necessary for deployer but fog doesn't like it
|
|
42
|
+
bucket_name: 'doesntmatter',
|
|
43
|
+
aws_access_key_id: 'meh',
|
|
44
|
+
aws_secret_access_key: 'dontcare' },
|
|
45
|
+
dry_run: true)
|
|
47
46
|
|
|
48
47
|
# Create site
|
|
49
48
|
FileUtils.mkdir_p('output')
|
|
@@ -56,7 +55,7 @@ class Nanoc::Extra::Deployers::FogTest < Nanoc::TestCase
|
|
|
56
55
|
# Run
|
|
57
56
|
fog.run
|
|
58
57
|
ensure
|
|
59
|
-
#
|
|
58
|
+
# FIXME: ugly hack
|
|
60
59
|
::Fog.instance_eval { @mocking = false }
|
|
61
60
|
end
|
|
62
61
|
end
|
|
@@ -68,9 +67,9 @@ class Nanoc::Extra::Deployers::FogTest < Nanoc::TestCase
|
|
|
68
67
|
fog = Nanoc::Extra::Deployers::Fog.new(
|
|
69
68
|
'output/',
|
|
70
69
|
{
|
|
71
|
-
:
|
|
72
|
-
:
|
|
73
|
-
:
|
|
70
|
+
bucket: 'mybucket',
|
|
71
|
+
provider: 'local',
|
|
72
|
+
local_root: 'mylocalcloud' })
|
|
74
73
|
|
|
75
74
|
# Setup fake local cloud
|
|
76
75
|
FileUtils.mkdir_p('mylocalcloud/mybucket')
|
|
@@ -97,5 +96,4 @@ class Nanoc::Extra::Deployers::FogTest < Nanoc::TestCase
|
|
|
97
96
|
assert_equal 'I am a dog!', File.read('mylocalcloud/mybucket/bark')
|
|
98
97
|
end
|
|
99
98
|
end
|
|
100
|
-
|
|
101
99
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
class Nanoc::Extra::Deployers::RsyncTest < Nanoc::TestCase
|
|
4
|
-
|
|
5
4
|
def test_run_without_dst
|
|
6
5
|
# Create deployer
|
|
7
6
|
rsync = Nanoc::Extra::Deployers::Rsync.new(
|
|
@@ -26,7 +25,7 @@ class Nanoc::Extra::Deployers::RsyncTest < Nanoc::TestCase
|
|
|
26
25
|
# Create deployer
|
|
27
26
|
rsync = Nanoc::Extra::Deployers::Rsync.new(
|
|
28
27
|
'output/',
|
|
29
|
-
{ :
|
|
28
|
+
{ dst: 'asdf/' })
|
|
30
29
|
|
|
31
30
|
# Mock run_shell_cmd
|
|
32
31
|
def rsync.run_shell_cmd(args)
|
|
@@ -46,7 +45,7 @@ class Nanoc::Extra::Deployers::RsyncTest < Nanoc::TestCase
|
|
|
46
45
|
# Create deployer
|
|
47
46
|
rsync = Nanoc::Extra::Deployers::Rsync.new(
|
|
48
47
|
'output',
|
|
49
|
-
{ :
|
|
48
|
+
{ dst: 'asdf' })
|
|
50
49
|
|
|
51
50
|
# Mock run_shell_cmd
|
|
52
51
|
def rsync.run_shell_cmd(args)
|
|
@@ -68,8 +67,8 @@ class Nanoc::Extra::Deployers::RsyncTest < Nanoc::TestCase
|
|
|
68
67
|
# Create deployer
|
|
69
68
|
rsync = Nanoc::Extra::Deployers::Rsync.new(
|
|
70
69
|
'output',
|
|
71
|
-
{ :
|
|
72
|
-
:
|
|
70
|
+
{ dst: 'asdf' },
|
|
71
|
+
dry_run: true)
|
|
73
72
|
|
|
74
73
|
# Mock run_shell_cmd
|
|
75
74
|
def rsync.run_shell_cmd(args)
|
|
@@ -86,5 +85,4 @@ class Nanoc::Extra::Deployers::RsyncTest < Nanoc::TestCase
|
|
|
86
85
|
rsync.instance_eval { @shell_cms_args }
|
|
87
86
|
)
|
|
88
87
|
end
|
|
89
|
-
|
|
90
88
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
4
|
-
|
|
5
4
|
def test_handle_request_with_item_rep_with_index_filename
|
|
6
5
|
if_have 'mime/types', 'rack' do
|
|
7
6
|
# Create site
|
|
@@ -77,13 +76,17 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
77
76
|
@expected_path_info = 'somefile.txt'
|
|
78
77
|
@actual_path_info = env['PATH_INFO']
|
|
79
78
|
end
|
|
80
|
-
def file_server.expected_path_info
|
|
81
|
-
|
|
79
|
+
def file_server.expected_path_info
|
|
80
|
+
@expected_path_info
|
|
81
|
+
end
|
|
82
|
+
def file_server.actual_path_info
|
|
83
|
+
@actual_path_info
|
|
84
|
+
end
|
|
82
85
|
|
|
83
86
|
# Create site
|
|
84
87
|
site = mock
|
|
85
88
|
site.expects(:items).returns([])
|
|
86
|
-
site.expects(:config).returns({ :
|
|
89
|
+
site.expects(:config).returns({ output_dir: 'out', index_filenames: ['index.html'] })
|
|
87
90
|
|
|
88
91
|
# Create autocompiler
|
|
89
92
|
autocompiler = Nanoc::Extra::AutoCompiler.new('.')
|
|
@@ -111,13 +114,17 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
111
114
|
@expected_path_info = '/foo/bar/index.html'
|
|
112
115
|
@actual_path_info = env['PATH_INFO']
|
|
113
116
|
end
|
|
114
|
-
def file_server.expected_path_info
|
|
115
|
-
|
|
117
|
+
def file_server.expected_path_info
|
|
118
|
+
@expected_path_info
|
|
119
|
+
end
|
|
120
|
+
def file_server.actual_path_info
|
|
121
|
+
@actual_path_info
|
|
122
|
+
end
|
|
116
123
|
|
|
117
124
|
# Create site
|
|
118
125
|
site = mock
|
|
119
126
|
site.expects(:items).returns([])
|
|
120
|
-
site.expects(:config).at_least_once.returns({ :
|
|
127
|
+
site.expects(:config).at_least_once.returns({ output_dir: 'out', index_filenames: ['index.html'] })
|
|
121
128
|
|
|
122
129
|
# Create autocompiler
|
|
123
130
|
autocompiler = Nanoc::Extra::AutoCompiler.new('.')
|
|
@@ -145,13 +152,17 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
145
152
|
@expected_path_info = 'foo/bar/'
|
|
146
153
|
@actual_path_info = env['PATH_INFO']
|
|
147
154
|
end
|
|
148
|
-
def file_server.expected_path_info
|
|
149
|
-
|
|
155
|
+
def file_server.expected_path_info
|
|
156
|
+
@expected_path_info
|
|
157
|
+
end
|
|
158
|
+
def file_server.actual_path_info
|
|
159
|
+
@actual_path_info
|
|
160
|
+
end
|
|
150
161
|
|
|
151
162
|
# Create site
|
|
152
163
|
site = mock
|
|
153
164
|
site.expects(:items).returns([])
|
|
154
|
-
site.expects(:config).at_least_once.returns({ :
|
|
165
|
+
site.expects(:config).at_least_once.returns({ output_dir: 'out', index_filenames: ['index.html'] })
|
|
155
166
|
|
|
156
167
|
# Create autocompiler
|
|
157
168
|
autocompiler = Nanoc::Extra::AutoCompiler.new('.')
|
|
@@ -179,13 +190,17 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
179
190
|
@expected_path_info = 'foo/bar'
|
|
180
191
|
@actual_path_info = env['PATH_INFO']
|
|
181
192
|
end
|
|
182
|
-
def file_server.expected_path_info
|
|
183
|
-
|
|
193
|
+
def file_server.expected_path_info
|
|
194
|
+
@expected_path_info
|
|
195
|
+
end
|
|
196
|
+
def file_server.actual_path_info
|
|
197
|
+
@actual_path_info
|
|
198
|
+
end
|
|
184
199
|
|
|
185
200
|
# Create site
|
|
186
201
|
site = mock
|
|
187
202
|
site.expects(:items).returns([])
|
|
188
|
-
site.expects(:config).at_least_once.returns({ :
|
|
203
|
+
site.expects(:config).at_least_once.returns({ output_dir: 'out', index_filenames: ['index.html'] })
|
|
189
204
|
|
|
190
205
|
# Create autocompiler
|
|
191
206
|
autocompiler = Nanoc::Extra::AutoCompiler.new('.')
|
|
@@ -213,13 +228,17 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
213
228
|
@expected_path_info = 'foo/bar'
|
|
214
229
|
@actual_path_info = env['PATH_INFO']
|
|
215
230
|
end
|
|
216
|
-
def file_server.expected_path_info
|
|
217
|
-
|
|
231
|
+
def file_server.expected_path_info
|
|
232
|
+
@expected_path_info
|
|
233
|
+
end
|
|
234
|
+
def file_server.actual_path_info
|
|
235
|
+
@actual_path_info
|
|
236
|
+
end
|
|
218
237
|
|
|
219
238
|
# Create site
|
|
220
239
|
site = mock
|
|
221
240
|
site.expects(:items).returns([])
|
|
222
|
-
site.expects(:config).at_least_once.returns({ :
|
|
241
|
+
site.expects(:config).at_least_once.returns({ output_dir: 'out', index_filenames: ['index.html'] })
|
|
223
242
|
|
|
224
243
|
# Create autocompiler
|
|
225
244
|
autocompiler = Nanoc::Extra::AutoCompiler.new('.')
|
|
@@ -243,13 +262,17 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
243
262
|
@expected_path_info = 'four-oh-four.txt'
|
|
244
263
|
@actual_path_info = env['PATH_INFO']
|
|
245
264
|
end
|
|
246
|
-
def file_server.expected_path_info
|
|
247
|
-
|
|
265
|
+
def file_server.expected_path_info
|
|
266
|
+
@expected_path_info
|
|
267
|
+
end
|
|
268
|
+
def file_server.actual_path_info
|
|
269
|
+
@actual_path_info
|
|
270
|
+
end
|
|
248
271
|
|
|
249
272
|
# Create site
|
|
250
273
|
site = mock
|
|
251
274
|
site.expects(:items).returns([])
|
|
252
|
-
site.expects(:config).at_least_once.returns({ :
|
|
275
|
+
site.expects(:config).at_least_once.returns({ output_dir: 'out', index_filenames: ['index.html'] })
|
|
253
276
|
|
|
254
277
|
# Create autocompiler
|
|
255
278
|
autocompiler = Nanoc::Extra::AutoCompiler.new('.')
|
|
@@ -370,10 +393,10 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
370
393
|
File.open('nanoc.yaml', 'w') do |io|
|
|
371
394
|
io.write 'value: Foo'
|
|
372
395
|
end
|
|
373
|
-
File.utime(Time.now+5, Time.now+5, 'nanoc.yaml')
|
|
396
|
+
File.utime(Time.now + 5, Time.now + 5, 'nanoc.yaml')
|
|
374
397
|
|
|
375
398
|
# Check
|
|
376
|
-
|
|
399
|
+
_status, _headers, body = autocompiler.call('REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/')
|
|
377
400
|
body.each do |b|
|
|
378
401
|
assert_match(/The Grand Value of Configuration is Foo!/, b)
|
|
379
402
|
end
|
|
@@ -382,10 +405,10 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
382
405
|
File.open('nanoc.yaml', 'w') do |io|
|
|
383
406
|
io.write 'value: Bar'
|
|
384
407
|
end
|
|
385
|
-
File.utime(Time.now+5, Time.now+5, 'nanoc.yaml')
|
|
408
|
+
File.utime(Time.now + 5, Time.now + 5, 'nanoc.yaml')
|
|
386
409
|
|
|
387
410
|
# Check
|
|
388
|
-
|
|
411
|
+
_status, _headers, body = autocompiler.call('REQUEST_METHOD' => 'GET', 'PATH_INFO' => '/')
|
|
389
412
|
body.each do |b|
|
|
390
413
|
assert_match(/The Grand Value of Configuration is Bar!/, b)
|
|
391
414
|
end
|
|
@@ -400,7 +423,7 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
400
423
|
|
|
401
424
|
# Mock dependencies
|
|
402
425
|
site = mock
|
|
403
|
-
site.stubs(:config).returns({ :
|
|
426
|
+
site.stubs(:config).returns({ output_dir: 'output/' })
|
|
404
427
|
site.stubs(:items).returns([])
|
|
405
428
|
autocompiler.stubs(:build_site)
|
|
406
429
|
autocompiler.stubs(:site).returns(site)
|
|
@@ -411,5 +434,4 @@ class Nanoc::Extra::AutoCompilerTest < Nanoc::TestCase
|
|
|
411
434
|
assert_match("File not found: /software\n", result[2][0])
|
|
412
435
|
end
|
|
413
436
|
end
|
|
414
|
-
|
|
415
437
|
end
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
class Nanoc::Extra::FileProxyTest < Nanoc::TestCase
|
|
4
|
-
|
|
5
4
|
def test_create_many
|
|
6
5
|
if_implemented do
|
|
7
6
|
# Create test file
|
|
8
|
-
File.open('test.txt', 'w') { |
|
|
7
|
+
File.open('test.txt', 'w') { |_io| }
|
|
9
8
|
|
|
10
9
|
# Create lots of file proxies
|
|
11
10
|
count = Process.getrlimit(Process::RLIMIT_NOFILE)[0] + 5
|
|
@@ -13,5 +12,4 @@ class Nanoc::Extra::FileProxyTest < Nanoc::TestCase
|
|
|
13
12
|
count.times { file_proxies << Nanoc::Extra::FileProxy.new('test.txt') }
|
|
14
13
|
end
|
|
15
14
|
end
|
|
16
|
-
|
|
17
15
|
end
|
|
@@ -13,7 +13,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
|
|
|
13
13
|
File.open("dir#{i}/foo.md", 'w') { |io| io.write('o hai') }
|
|
14
14
|
end
|
|
15
15
|
(1..10).each do |i|
|
|
16
|
-
File.symlink("../dir#{i}", "dir#{i-1}/sub")
|
|
16
|
+
File.symlink("../dir#{i}", "dir#{i - 1}/sub")
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
# Check
|
|
@@ -32,7 +32,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
|
|
|
32
32
|
'dir0/sub/sub/sub/sub/sub/sub/sub/sub/sub/foo.md',
|
|
33
33
|
'dir0/sub/sub/sub/sub/sub/sub/sub/sub/sub/sub/foo.md'
|
|
34
34
|
]
|
|
35
|
-
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir0').sort
|
|
35
|
+
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir0', nil).sort
|
|
36
36
|
assert_equal expected_files, actual_files
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -43,11 +43,11 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
|
|
|
43
43
|
File.open("dir#{i}/foo.md", 'w') { |io| io.write('o hai') }
|
|
44
44
|
end
|
|
45
45
|
(1..15).each do |i|
|
|
46
|
-
File.symlink("../dir#{i}", "dir#{i-1}/sub")
|
|
46
|
+
File.symlink("../dir#{i}", "dir#{i - 1}/sub")
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
assert_raises Nanoc::Extra::FilesystemTools::MaxSymlinkDepthExceededError do
|
|
50
|
-
Nanoc::Extra::FilesystemTools.all_files_in('dir0')
|
|
50
|
+
Nanoc::Extra::FilesystemTools.all_files_in('dir0', nil)
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
@@ -61,7 +61,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
|
|
|
61
61
|
File.symlink('../bar', 'foo/barlink')
|
|
62
62
|
|
|
63
63
|
expected_files = ['foo/barlink/y.md', 'foo/x.md']
|
|
64
|
-
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('foo').sort
|
|
64
|
+
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('foo', nil).sort
|
|
65
65
|
assert_equal expected_files, actual_files
|
|
66
66
|
end
|
|
67
67
|
|
|
@@ -74,7 +74,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
|
|
|
74
74
|
|
|
75
75
|
# Check
|
|
76
76
|
expected_files = ['dir/bar-link', 'dir/foo']
|
|
77
|
-
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir').sort
|
|
77
|
+
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir', nil).sort
|
|
78
78
|
assert_equal expected_files, actual_files
|
|
79
79
|
end
|
|
80
80
|
|
|
@@ -93,7 +93,7 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
|
|
|
93
93
|
File.open('foo', 'w') { |io| io.write('o hai') }
|
|
94
94
|
File.symlink('foo', 'symlin-0')
|
|
95
95
|
(1..7).each do |i|
|
|
96
|
-
File.symlink("symlink-#{i-1}", "symlink-#{i}")
|
|
96
|
+
File.symlink("symlink-#{i - 1}", "symlink-#{i}")
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
assert_raises Nanoc::Extra::FilesystemTools::MaxSymlinkDepthExceededError do
|
|
@@ -101,4 +101,44 @@ class Nanoc::Extra::FilesystemToolsTest < Nanoc::TestCase
|
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
+
def test_unwanted_dotfiles_not_found
|
|
105
|
+
# Write sample files
|
|
106
|
+
FileUtils.mkdir_p('dir')
|
|
107
|
+
File.open('dir/.DS_Store', 'w') { |io| io.write('o hai') }
|
|
108
|
+
File.open('dir/.htaccess', 'w') { |io| io.write('o hai') }
|
|
109
|
+
|
|
110
|
+
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir', nil).sort
|
|
111
|
+
assert_equal [], actual_files
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def test_user_dotfiles_are_valid_items
|
|
115
|
+
# Write sample files
|
|
116
|
+
FileUtils.mkdir_p('dir')
|
|
117
|
+
File.open('dir/.other', 'w') { |io| io.write('o hai') }
|
|
118
|
+
|
|
119
|
+
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir', '**/.other').sort
|
|
120
|
+
assert_equal ['dir/.other'], actual_files
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def test_multiple_user_dotfiles_are_valid_items
|
|
124
|
+
# Write sample files
|
|
125
|
+
FileUtils.mkdir_p('dir')
|
|
126
|
+
File.open('dir/.other', 'w') { |io| io.write('o hai') }
|
|
127
|
+
File.open('dir/.DS_Store', 'w') { |io| io.write('o hai') }
|
|
128
|
+
|
|
129
|
+
actual_files = Nanoc::Extra::FilesystemTools.all_files_in('dir', ['**/.other', '**/.DS_Store']).sort
|
|
130
|
+
assert_equal ['dir/.other', 'dir/.DS_Store'].sort, actual_files.sort
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def test_unknown_pattern
|
|
134
|
+
# Write sample files
|
|
135
|
+
FileUtils.mkdir_p('dir')
|
|
136
|
+
File.open('dir/.other', 'w') { |io| io.write('o hai') }
|
|
137
|
+
|
|
138
|
+
pattern = { dotfiles: '**/.other' }
|
|
139
|
+
|
|
140
|
+
assert_raises Nanoc::Errors::GenericTrivial, "Do not know how to handle extra_files: #{pattern.inspect}" do
|
|
141
|
+
Nanoc::Extra::FilesystemTools.all_files_in('dir0', pattern)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
104
144
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
class Nanoc::Extra::LinkCollectorTest < Nanoc::TestCase
|
|
4
|
-
|
|
5
4
|
def test_all
|
|
6
5
|
# Create dummy data
|
|
7
6
|
File.open('file-a.html', 'w') do |io|
|
|
@@ -106,5 +105,4 @@ class Nanoc::Extra::LinkCollectorTest < Nanoc::TestCase
|
|
|
106
105
|
assert_includes hrefs, '../stuff'
|
|
107
106
|
assert_includes hrefs, '/stuff'
|
|
108
107
|
end
|
|
109
|
-
|
|
110
108
|
end
|