nanoc 3.7.4 → 3.7.5
Sign up to get free protection for your applications and to get access to all the features.
- 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::Helpers::BreadcrumbsTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::Breadcrumbs
|
6
5
|
|
7
6
|
def test_breadcrumbs_trail_at_root
|
@@ -39,5 +38,4 @@ class Nanoc::Helpers::BreadcrumbsTest < Nanoc::TestCase
|
|
39
38
|
|
40
39
|
assert_equal [@items[0], nil, @items[1]], breadcrumbs_trail
|
41
40
|
end
|
42
|
-
|
43
41
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::Capturing
|
6
5
|
|
7
6
|
def test_content_for
|
@@ -105,7 +104,7 @@ EOS
|
|
105
104
|
end
|
106
105
|
|
107
106
|
def test_dependencies
|
108
|
-
with_site do |
|
107
|
+
with_site do |_site|
|
109
108
|
# Prepare
|
110
109
|
File.open('lib/helpers.rb', 'w') do |io|
|
111
110
|
io.write 'include Nanoc::Helpers::Capturing'
|
@@ -135,7 +134,7 @@ EOS
|
|
135
134
|
end
|
136
135
|
|
137
136
|
def test_dependency_without_item_variable
|
138
|
-
with_site do |
|
137
|
+
with_site do |_site|
|
139
138
|
# Prepare
|
140
139
|
File.open('lib/helpers.rb', 'w') do |io|
|
141
140
|
io.write "include Nanoc::Helpers::Capturing\n"
|
@@ -170,7 +169,7 @@ EOS
|
|
170
169
|
end
|
171
170
|
|
172
171
|
def test_self
|
173
|
-
with_site do |
|
172
|
+
with_site do |_site|
|
174
173
|
File.open('lib/helpers.rb', 'w') do |io|
|
175
174
|
io.write 'include Nanoc::Helpers::Capturing'
|
176
175
|
end
|
@@ -191,7 +190,7 @@ EOS
|
|
191
190
|
end
|
192
191
|
|
193
192
|
def test_recompile_dependency
|
194
|
-
with_site do |
|
193
|
+
with_site do |_site|
|
195
194
|
# Prepare
|
196
195
|
File.open('lib/helpers.rb', 'w') do |io|
|
197
196
|
io.write 'include Nanoc::Helpers::Capturing'
|
@@ -221,5 +220,4 @@ EOS
|
|
221
220
|
assert_equal 'New-Content', File.read('output/includer/index.html')
|
222
221
|
end
|
223
222
|
end
|
224
|
-
|
225
223
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::Helpers::FilteringTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::Filtering
|
6
5
|
|
7
6
|
def test_filter_simple
|
@@ -40,8 +39,8 @@ class Nanoc::Helpers::FilteringTest < Nanoc::TestCase
|
|
40
39
|
@item_rep = mock
|
41
40
|
@item_rep.expects(:name).returns('default')
|
42
41
|
@item_rep.expects(:assigns).returns({
|
43
|
-
:
|
44
|
-
:
|
42
|
+
item: @item,
|
43
|
+
item_rep: @item_rep
|
45
44
|
})
|
46
45
|
|
47
46
|
# Evaluate content
|
@@ -120,5 +119,4 @@ class Nanoc::Helpers::FilteringTest < Nanoc::TestCase
|
|
120
119
|
assert notifications.include?(:filtering_started)
|
121
120
|
assert notifications.include?(:filtering_ended)
|
122
121
|
end
|
123
|
-
|
124
122
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::Helpers::HTMLEscapeTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::HTMLEscape
|
6
5
|
|
7
6
|
def test_html_escape_with_string
|
@@ -26,5 +25,4 @@ class Nanoc::Helpers::HTMLEscapeTest < Nanoc::TestCase
|
|
26
25
|
h
|
27
26
|
end
|
28
27
|
end
|
29
|
-
|
30
28
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::LinkTo
|
6
5
|
|
7
6
|
def test_link_to_with_path
|
@@ -40,7 +39,7 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
40
39
|
# Check
|
41
40
|
assert_equal(
|
42
41
|
'<a title="Dis mai foo!" href="/foo/">Foo</a>',
|
43
|
-
link_to('Foo', '/foo/', :
|
42
|
+
link_to('Foo', '/foo/', title: 'Dis mai foo!')
|
44
43
|
)
|
45
44
|
end
|
46
45
|
|
@@ -48,13 +47,15 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
48
47
|
# Check
|
49
48
|
assert_equal(
|
50
49
|
'<a title="Foo & Bar" href="/foo&bar/">Foo & Bar</a>',
|
51
|
-
link_to('Foo & Bar', '/foo&bar/', :
|
50
|
+
link_to('Foo & Bar', '/foo&bar/', title: 'Foo & Bar')
|
52
51
|
)
|
53
52
|
end
|
54
53
|
|
55
54
|
def test_link_to_to_nil_item_or_item_rep
|
56
55
|
obj = Object.new
|
57
|
-
def obj.path
|
56
|
+
def obj.path
|
57
|
+
nil
|
58
|
+
end
|
58
59
|
|
59
60
|
assert_raises RuntimeError do
|
60
61
|
link_to('Some Text', obj)
|
@@ -151,7 +152,6 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
151
152
|
)
|
152
153
|
end
|
153
154
|
|
154
|
-
|
155
155
|
def test_relative_path_to_item
|
156
156
|
# Mock self
|
157
157
|
@item_rep = mock
|
@@ -250,5 +250,4 @@ class Nanoc::Helpers::LinkToTest < Nanoc::TestCase
|
|
250
250
|
# Run
|
251
251
|
assert_examples_correct 'Nanoc::Helpers::LinkTo#relative_path_to'
|
252
252
|
end
|
253
|
-
|
254
253
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::Rendering
|
6
5
|
|
7
6
|
def test_render
|
@@ -38,7 +37,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
38
37
|
io.write("layout '/foo/', nil\n")
|
39
38
|
end
|
40
39
|
|
41
|
-
File.open('layouts/foo.erb', 'w').close
|
40
|
+
File.open('layouts/foo.erb', 'w').close
|
42
41
|
|
43
42
|
assert_raises(Nanoc::Errors::CannotDetermineFilter) do
|
44
43
|
render '/foo/'
|
@@ -54,7 +53,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
54
53
|
io.write("layout '/foo/', :asdf\n")
|
55
54
|
end
|
56
55
|
|
57
|
-
File.open('layouts/foo.erb', 'w').close
|
56
|
+
File.open('layouts/foo.erb', 'w').close
|
58
57
|
|
59
58
|
assert_raises(Nanoc::Errors::UnknownFilter) do
|
60
59
|
render '/foo/'
|
@@ -83,5 +82,4 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
83
82
|
assert_equal '', result
|
84
83
|
end
|
85
84
|
end
|
86
|
-
|
87
85
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::Tagging
|
6
5
|
|
7
6
|
def test_tags_for_without_tags
|
@@ -17,45 +16,45 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
|
17
16
|
|
18
17
|
def test_tags_for_with_custom_base_url
|
19
18
|
# Create item
|
20
|
-
item = Nanoc::Item.new('content', { :
|
19
|
+
item = Nanoc::Item.new('content', { tags: %w(foo bar) }, '/path/')
|
21
20
|
|
22
21
|
# Check
|
23
22
|
assert_equal(
|
24
23
|
"#{link_for_tag('foo', 'http://stoneship.org/tag/')}, " \
|
25
24
|
"#{link_for_tag('bar', 'http://stoneship.org/tag/')}",
|
26
|
-
tags_for(item, :
|
25
|
+
tags_for(item, base_url: 'http://stoneship.org/tag/')
|
27
26
|
)
|
28
27
|
end
|
29
28
|
|
30
29
|
def test_tags_for_with_custom_none_text
|
31
30
|
# Create item
|
32
|
-
item = Nanoc::Item.new('content', { :
|
31
|
+
item = Nanoc::Item.new('content', { tags: [] }, '/path/')
|
33
32
|
|
34
33
|
# Check
|
35
34
|
assert_equal(
|
36
35
|
'no tags for you, fool',
|
37
|
-
tags_for(item, :
|
36
|
+
tags_for(item, none_text: 'no tags for you, fool')
|
38
37
|
)
|
39
38
|
end
|
40
39
|
|
41
40
|
def test_tags_for_with_custom_separator
|
42
41
|
# Create item
|
43
|
-
item = Nanoc::Item.new('content', { :
|
42
|
+
item = Nanoc::Item.new('content', { tags: %w(foo bar) }, '/path/')
|
44
43
|
|
45
44
|
# Check
|
46
45
|
assert_equal(
|
47
46
|
"#{link_for_tag('foo', 'http://technorati.com/tag/')} ++ " \
|
48
47
|
"#{link_for_tag('bar', 'http://technorati.com/tag/')}",
|
49
|
-
tags_for(item, :
|
48
|
+
tags_for(item, separator: ' ++ ')
|
50
49
|
)
|
51
50
|
end
|
52
51
|
|
53
52
|
def test_items_with_tag
|
54
53
|
# Create items
|
55
54
|
@items = [
|
56
|
-
Nanoc::Item.new('item 1', { :
|
57
|
-
Nanoc::Item.new('item 2', { :
|
58
|
-
Nanoc::Item.new('item 3', { :
|
55
|
+
Nanoc::Item.new('item 1', { tags: [:foo] }, '/item1/'),
|
56
|
+
Nanoc::Item.new('item 2', { tags: [:bar] }, '/item2/'),
|
57
|
+
Nanoc::Item.new('item 3', { tags: [:foo, :bar] }, '/item3/')
|
59
58
|
]
|
60
59
|
|
61
60
|
# Find items
|
@@ -81,5 +80,4 @@ class Nanoc::Helpers::TaggingTest < Nanoc::TestCase
|
|
81
80
|
link_for_tag('foo&bar', 'http://stoneship.org/tags&stuff/')
|
82
81
|
)
|
83
82
|
end
|
84
|
-
|
85
83
|
end
|
data/test/helpers/test_text.rb
CHANGED
@@ -1,22 +1,20 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::Helpers::TextTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::Text
|
6
5
|
|
7
6
|
def test_excerpt_length
|
8
|
-
assert_equal('...', excerptize('Foo bar baz quux meow woof', :
|
9
|
-
assert_equal('Foo ...', excerptize('Foo bar baz quux meow woof', :
|
10
|
-
assert_equal('Foo bar baz quux meow woof', excerptize('Foo bar baz quux meow woof', :
|
11
|
-
assert_equal('Foo bar baz quux meow woof', excerptize('Foo bar baz quux meow woof', :
|
7
|
+
assert_equal('...', excerptize('Foo bar baz quux meow woof', length: 3))
|
8
|
+
assert_equal('Foo ...', excerptize('Foo bar baz quux meow woof', length: 7))
|
9
|
+
assert_equal('Foo bar baz quux meow woof', excerptize('Foo bar baz quux meow woof', length: 26))
|
10
|
+
assert_equal('Foo bar baz quux meow woof', excerptize('Foo bar baz quux meow woof', length: 8_623_785))
|
12
11
|
end
|
13
12
|
|
14
13
|
def test_excerpt_omission
|
15
|
-
assert_equal('Foo [continued]', excerptize('Foo bar baz quux meow woof', :
|
14
|
+
assert_equal('Foo [continued]', excerptize('Foo bar baz quux meow woof', length: 15, omission: '[continued]'))
|
16
15
|
end
|
17
16
|
|
18
17
|
def test_strip_html
|
19
|
-
# TODO implement
|
18
|
+
# TODO: implement
|
20
19
|
end
|
21
|
-
|
22
20
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
include Nanoc::Helpers::XMLSitemap
|
6
5
|
|
7
6
|
def teardown
|
@@ -23,10 +22,10 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
23
22
|
create_item_rep(@items.last, :one_b, '/item-one/b/')
|
24
23
|
|
25
24
|
# Create item 2
|
26
|
-
@items << Nanoc::Item.new('some content 2', { :
|
25
|
+
@items << Nanoc::Item.new('some content 2', { is_hidden: true }, '/item-two/')
|
27
26
|
|
28
27
|
# Create item 3
|
29
|
-
attrs = { :
|
28
|
+
attrs = { mtime: Time.parse('2004-07-12'), changefreq: 'daily', priority: 0.5 }
|
30
29
|
@items << Nanoc::Item.new('some content 3', attrs, '/item-three/')
|
31
30
|
create_item_rep(@items.last, :three_a, '/item-three/a/')
|
32
31
|
create_item_rep(@items.last, :three_b, '/item-three/b/')
|
@@ -39,7 +38,7 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
39
38
|
@item = Nanoc::Item.new('sitemap content', {}, '/sitemap/')
|
40
39
|
|
41
40
|
# Create site
|
42
|
-
@site = Nanoc::Site.new({ :
|
41
|
+
@site = Nanoc::Site.new({ base_url: 'http://example.com' })
|
43
42
|
|
44
43
|
# Build sitemap
|
45
44
|
res = xml_sitemap
|
@@ -83,10 +82,10 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
83
82
|
@item = Nanoc::Item.new('sitemap content', {}, '/sitemap/')
|
84
83
|
|
85
84
|
# Create site
|
86
|
-
@site = Nanoc::Site.new({ :
|
85
|
+
@site = Nanoc::Site.new({ base_url: 'http://example.com' })
|
87
86
|
|
88
87
|
# Build sitemap
|
89
|
-
res = xml_sitemap(:
|
88
|
+
res = xml_sitemap(items: [@items[1]])
|
90
89
|
|
91
90
|
# Check
|
92
91
|
doc = Nokogiri::XML(res)
|
@@ -116,10 +115,10 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
116
115
|
@item = Nanoc::Item.new('sitemap content', {}, '/sitemap/')
|
117
116
|
|
118
117
|
# Create site
|
119
|
-
@site = Nanoc::Site.new({ :
|
118
|
+
@site = Nanoc::Site.new({ base_url: 'http://example.com' })
|
120
119
|
|
121
120
|
# Build sitemap
|
122
|
-
res = xml_sitemap(:
|
121
|
+
res = xml_sitemap(rep_select: ->(rep) { rep.name == :one_a })
|
123
122
|
|
124
123
|
# Check
|
125
124
|
doc = Nokogiri::XML(res)
|
@@ -152,10 +151,10 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
152
151
|
@item = Nanoc::Item.new('sitemap content', {}, '/sitemap/')
|
153
152
|
|
154
153
|
# Create site
|
155
|
-
@site = Nanoc::Site.new({ :
|
154
|
+
@site = Nanoc::Site.new({ base_url: 'http://example.com' })
|
156
155
|
|
157
156
|
# Build sitemap
|
158
|
-
res = xml_sitemap(:
|
157
|
+
res = xml_sitemap(items: @items)
|
159
158
|
|
160
159
|
# Check
|
161
160
|
doc = Nokogiri::XML(res)
|
@@ -176,10 +175,9 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
176
175
|
|
177
176
|
def create_item_rep(item, name, path)
|
178
177
|
rep = Nanoc::ItemRep.new(item, name)
|
179
|
-
rep.paths = { :
|
180
|
-
rep.raw_paths = { :
|
178
|
+
rep.paths = { last: path }
|
179
|
+
rep.raw_paths = { last: path }
|
181
180
|
item.reps << rep
|
182
181
|
rep
|
183
182
|
end
|
184
|
-
|
185
183
|
end
|
data/test/tasks/test_clean.rb
CHANGED
data/test/test_gem.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
class Nanoc::GemTest < Nanoc::TestCase
|
4
|
-
|
5
4
|
def setup
|
6
5
|
super
|
7
6
|
FileUtils.cd(@orig_wd)
|
@@ -15,7 +14,7 @@ class Nanoc::GemTest < Nanoc::TestCase
|
|
15
14
|
files_before = Set.new Dir['**/*']
|
16
15
|
stdout = StringIO.new
|
17
16
|
stderr = StringIO.new
|
18
|
-
piper = Nanoc::Extra::Piper.new(:
|
17
|
+
piper = Nanoc::Extra::Piper.new(stdout: stdout, stderr: stderr)
|
19
18
|
piper.run(%w( gem build nanoc.gemspec ), nil)
|
20
19
|
files_after = Set.new Dir['**/*']
|
21
20
|
|
@@ -30,5 +29,4 @@ class Nanoc::GemTest < Nanoc::TestCase
|
|
30
29
|
ensure
|
31
30
|
Dir['nanoc-*.gem'].each { |f| FileUtils.rm(f) }
|
32
31
|
end
|
33
|
-
|
34
32
|
end
|
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: 3.7.
|
4
|
+
version: 3.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -28,16 +28,22 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.7.10
|
34
|
+
- - "<"
|
32
35
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
36
|
+
version: '2.0'
|
34
37
|
type: :development
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
43
|
+
version: 1.7.10
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2.0'
|
41
47
|
description: nanoc is a simple but very flexible static site generator written in
|
42
48
|
Ruby. It operates on local files, and therefore does not run on the server. nanoc
|
43
49
|
“compiles” the local source files into HTML (usually), by evaluating eRuby, Markdown,
|
@@ -55,7 +61,6 @@ files:
|
|
55
61
|
- CONTRIBUTING.md
|
56
62
|
- ChangeLog
|
57
63
|
- Gemfile
|
58
|
-
- Gemfile.lock
|
59
64
|
- LICENSE
|
60
65
|
- NEWS.md
|
61
66
|
- README.md
|
@@ -84,7 +89,6 @@ files:
|
|
84
89
|
- lib/nanoc/base/context.rb
|
85
90
|
- lib/nanoc/base/core_ext.rb
|
86
91
|
- lib/nanoc/base/core_ext/array.rb
|
87
|
-
- lib/nanoc/base/core_ext/date.rb
|
88
92
|
- lib/nanoc/base/core_ext/hash.rb
|
89
93
|
- lib/nanoc/base/core_ext/pathname.rb
|
90
94
|
- lib/nanoc/base/core_ext/string.rb
|
@@ -92,7 +96,6 @@ files:
|
|
92
96
|
- lib/nanoc/base/errors.rb
|
93
97
|
- lib/nanoc/base/memoization.rb
|
94
98
|
- lib/nanoc/base/notification_center.rb
|
95
|
-
- lib/nanoc/base/ordered_hash.rb
|
96
99
|
- lib/nanoc/base/plugin_registry.rb
|
97
100
|
- lib/nanoc/base/result_data/item_rep.rb
|
98
101
|
- lib/nanoc/base/source_data/code_snippet.rb
|
@@ -157,7 +160,6 @@ files:
|
|
157
160
|
- lib/nanoc/extra/checking/runner.rb
|
158
161
|
- lib/nanoc/extra/chick.rb
|
159
162
|
- lib/nanoc/extra/core_ext.rb
|
160
|
-
- lib/nanoc/extra/core_ext/enumerable.rb
|
161
163
|
- lib/nanoc/extra/core_ext/pathname.rb
|
162
164
|
- lib/nanoc/extra/core_ext/time.rb
|
163
165
|
- lib/nanoc/extra/deployer.rb
|
@@ -236,7 +238,6 @@ files:
|
|
236
238
|
- tasks/test.rake
|
237
239
|
- test/base/checksummer_spec.rb
|
238
240
|
- test/base/core_ext/array_spec.rb
|
239
|
-
- test/base/core_ext/date_spec.rb
|
240
241
|
- test/base/core_ext/hash_spec.rb
|
241
242
|
- test/base/core_ext/pathname_spec.rb
|
242
243
|
- test/base/core_ext/string_spec.rb
|
@@ -290,7 +291,6 @@ files:
|
|
290
291
|
- test/extra/checking/test_check.rb
|
291
292
|
- test/extra/checking/test_dsl.rb
|
292
293
|
- test/extra/checking/test_runner.rb
|
293
|
-
- test/extra/core_ext/test_enumerable.rb
|
294
294
|
- test/extra/core_ext/test_pathname.rb
|
295
295
|
- test/extra/core_ext/test_time.rb
|
296
296
|
- test/extra/deployers/test_fog.rb
|
@@ -333,6 +333,7 @@ files:
|
|
333
333
|
- test/filters/test_yui_compressor.rb
|
334
334
|
- test/fixtures/vcr_cassettes/css_run_error.yml
|
335
335
|
- test/fixtures/vcr_cassettes/css_run_ok.yml
|
336
|
+
- test/fixtures/vcr_cassettes/css_run_parse_error.yml
|
336
337
|
- test/fixtures/vcr_cassettes/html_run_error.yml
|
337
338
|
- test/fixtures/vcr_cassettes/html_run_ok.yml
|
338
339
|
- test/gem_loader.rb
|
@@ -363,7 +364,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
363
364
|
requirements:
|
364
365
|
- - ">="
|
365
366
|
- !ruby/object:Gem::Version
|
366
|
-
version:
|
367
|
+
version: 1.9.3
|
367
368
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
368
369
|
requirements:
|
369
370
|
- - ">="
|
@@ -371,7 +372,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
371
372
|
version: '0'
|
372
373
|
requirements: []
|
373
374
|
rubyforge_project:
|
374
|
-
rubygems_version: 2.
|
375
|
+
rubygems_version: 2.4.5
|
375
376
|
signing_key:
|
376
377
|
specification_version: 4
|
377
378
|
summary: a web publishing system written in Ruby for building small to medium-sized
|