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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 271aacd59754102c8bd997df253a98ca21f7fac3
|
4
|
+
data.tar.gz: 37db9384d0b9dbcbc80bb22714d856766fa9af42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b38d502d8dc8d17401312089add955515c7807e1b85bf7c9993fa68350cf9201b859eb305425fa69e2cb13b40d10d2ac2487150d0a3678f444883fb069e0ad0
|
7
|
+
data.tar.gz: a468ae8a49f2d3a025f0946aae7a58ee8e4328b3f188c5052e6d64a91751fb55c41077e64d025adff3bac3dfa40c886ca2a77a33f9baa7489249158808e52a09
|
data/Gemfile
CHANGED
@@ -1,45 +1,46 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
# FIXME we may be missing some mswin dependencies here
|
6
|
-
all_rubies = Bundler::Dependency::PLATFORM_MAP.keys
|
7
|
-
ruby_19_plus = [:ruby_19, :ruby_20, :ruby_21, :jruby] & all_rubies
|
8
|
-
ruby_19_plus_without_jruby = [:ruby_19, :ruby_20, :ruby_21] & all_rubies
|
5
|
+
# FIXME: we may be missing some mswin dependencies here
|
9
6
|
|
10
7
|
gem 'adsf'
|
11
|
-
gem 'bluecloth', :
|
8
|
+
gem 'bluecloth', platforms: :ruby
|
12
9
|
gem 'builder'
|
13
10
|
gem 'coderay'
|
14
11
|
gem 'compass'
|
15
12
|
gem 'coffee-script'
|
16
|
-
gem 'coveralls', :
|
13
|
+
gem 'coveralls', require: false
|
17
14
|
gem 'erubis'
|
18
|
-
gem 'fog'
|
15
|
+
gem 'fog'
|
19
16
|
gem 'haml'
|
20
|
-
gem 'handlebars', :
|
17
|
+
gem 'handlebars', platforms: :ruby
|
21
18
|
gem 'kramdown'
|
22
|
-
gem 'less', '~> 2.0', :
|
23
|
-
gem 'listen'
|
19
|
+
gem 'less', '~> 2.0', platforms: :ruby
|
20
|
+
gem 'listen'
|
24
21
|
gem 'markaby'
|
25
22
|
gem 'maruku'
|
26
|
-
gem 'mime-types'
|
23
|
+
gem 'mime-types'
|
27
24
|
gem 'minitest', '~> 4.0'
|
28
25
|
gem 'mocha'
|
29
|
-
|
26
|
+
if RUBY_VERSION >= '2.0.0'
|
27
|
+
gem 'mustache', '~> 1.0'
|
28
|
+
else
|
29
|
+
gem 'mustache', '~> 0.99'
|
30
|
+
end
|
30
31
|
gem 'nokogiri', '~> 1.6'
|
31
32
|
gem 'pandoc-ruby'
|
32
33
|
gem 'pry'
|
33
|
-
gem 'pygments.rb', :
|
34
|
+
gem 'pygments.rb', platforms: [:ruby, :mswin]
|
34
35
|
gem 'rack'
|
35
36
|
gem 'rake'
|
36
37
|
gem 'rainpress'
|
37
|
-
gem 'rdiscount', :
|
38
|
+
gem 'rdiscount', platforms: [:ruby, :mswin]
|
38
39
|
gem 'rdoc'
|
39
|
-
gem 'redcarpet', :
|
40
|
+
gem 'redcarpet', platforms: [:ruby, :mswin]
|
40
41
|
gem 'RedCloth'
|
41
42
|
gem 'rouge'
|
42
|
-
gem 'rubocop'
|
43
|
+
gem 'rubocop'
|
43
44
|
gem 'rubypants'
|
44
45
|
gem 'sass', '~> 3.2.2'
|
45
46
|
gem 'slim'
|
@@ -48,5 +49,5 @@ gem 'uglifier'
|
|
48
49
|
gem 'vcr'
|
49
50
|
gem 'w3c_validators'
|
50
51
|
gem 'webmock'
|
51
|
-
gem 'yuicompressor'
|
52
|
+
gem 'yuicompressor'
|
52
53
|
gem 'yard'
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2007-
|
1
|
+
Copyright (c) 2007-2015 Denis Defreyne and contributors
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
data/NEWS.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# nanoc news
|
2
2
|
|
3
|
+
## 3.7.5 (2015-01-12)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
* Allowed extra patterns to be specified in the data source configuration, so that dotfiles are no longer necessary ignored (e.g. `extra_files: ['.htaccess']`) (#492, #498) [Andy Drop, Michal Papis]
|
8
|
+
* Removed Ruby 1.8.x support ([details](https://groups.google.com/forum/#!topic/nanoc/pSL1i15EFz8)) (#517)
|
9
|
+
* Improved CSS and HTML error messages (#484, #504)
|
10
|
+
* Let kramdown filter print warnings (#459, #519)
|
11
|
+
|
12
|
+
Fixes:
|
13
|
+
|
14
|
+
* Fixed HTML class names for recent Rouge versions (#502)
|
15
|
+
* Fixed crash when using items or layouts in attributes (#469, #518)
|
16
|
+
|
3
17
|
## 3.7.4 (2014-11-23)
|
4
18
|
|
5
19
|
Enhancements:
|
data/Rakefile
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
class NanocIdentifierHandler < ::YARD::Handlers::Ruby::AttributeHandler
|
2
|
-
|
3
2
|
# e.g. identifier :foo, :bar
|
4
3
|
|
5
4
|
handles method_call(:identifier), method_call(:identifiers)
|
@@ -9,11 +8,9 @@ class NanocIdentifierHandler < ::YARD::Handlers::Ruby::AttributeHandler
|
|
9
8
|
identifiers = statement.parameters(false).map { |param| param.jump(:ident)[0] }
|
10
9
|
namespace['nanoc_identifiers'] = identifiers
|
11
10
|
end
|
12
|
-
|
13
11
|
end
|
14
12
|
|
15
13
|
class NanocRegisterFilterHandler < ::YARD::Handlers::Ruby::AttributeHandler
|
16
|
-
|
17
14
|
# e.g. Nanoc::Filter.register '::Nanoc::Filters::AsciiDoc', :asciidoc
|
18
15
|
|
19
16
|
handles method_call(:register)
|
@@ -21,7 +18,7 @@ class NanocRegisterFilterHandler < ::YARD::Handlers::Ruby::AttributeHandler
|
|
21
18
|
|
22
19
|
def process
|
23
20
|
target = statement.jump(:const_path_ref)
|
24
|
-
return if target != s(:const_path_ref, s(:var_ref, s(:const,
|
21
|
+
return if target != s(:const_path_ref, s(:var_ref, s(:const, 'Nanoc')), s(:const, 'Filter'))
|
25
22
|
|
26
23
|
class_name = statement.jump(:string_literal).jump(:tstring_content)[0]
|
27
24
|
identifier = statement.jump(:symbol_literal).jump(:ident)[0]
|
@@ -30,5 +27,4 @@ class NanocRegisterFilterHandler < ::YARD::Handlers::Ruby::AttributeHandler
|
|
30
27
|
obj['nanoc_identifiers'] ||= []
|
31
28
|
obj['nanoc_identifiers'] << identifier
|
32
29
|
end
|
33
|
-
|
34
30
|
end
|
data/lib/nanoc.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc
|
4
|
-
|
5
4
|
# @return [String] A string containing information about this nanoc version
|
6
5
|
# and its environment (Ruby engine and version, Rubygems version if any).
|
7
6
|
def self.version_information
|
8
7
|
gem_info = defined?(Gem) ? "with RubyGems #{Gem::VERSION}" : 'without RubyGems'
|
9
8
|
engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
|
10
9
|
res = ''
|
11
|
-
res << "nanoc #{Nanoc::VERSION} © 2007-
|
10
|
+
res << "nanoc #{Nanoc::VERSION} © 2007-2015 Denis Defreyne.\n"
|
12
11
|
res << "Running #{engine} #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) on #{RUBY_PLATFORM} #{gem_info}.\n"
|
13
12
|
res
|
14
13
|
end
|
@@ -17,7 +16,6 @@ module Nanoc
|
|
17
16
|
def self.on_windows?
|
18
17
|
RUBY_PLATFORM =~ /windows|bccwin|cygwin|djgpp|mingw|mswin|wince/i
|
19
18
|
end
|
20
|
-
|
21
19
|
end
|
22
20
|
|
23
21
|
Nanoc3 = Nanoc
|
data/lib/nanoc/base.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc
|
4
|
-
|
5
4
|
require 'nanoc/base/core_ext'
|
6
|
-
require 'nanoc/base/ordered_hash'
|
7
5
|
|
8
6
|
# Load helper classes
|
9
7
|
autoload 'Context', 'nanoc/base/context'
|
@@ -46,7 +44,6 @@ module Nanoc
|
|
46
44
|
autoload 'RulesCollection', 'nanoc/base/compilation/rules_collection'
|
47
45
|
|
48
46
|
# Deprecated; use PluginRepository instead
|
49
|
-
# TODO [in nanoc 4.0] remove me
|
47
|
+
# TODO: [in nanoc 4.0] remove me
|
50
48
|
autoload 'Plugin', 'nanoc/base/plugin_registry'
|
51
|
-
|
52
49
|
end
|
@@ -1,15 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc
|
4
|
-
|
5
4
|
# Creates checksums for given objects.
|
6
5
|
#
|
7
6
|
# A checksum is a string, such as “mL+TaqNsEeiPkWloPgCtAofT1yg=”, that is used
|
8
7
|
# to determine whether a piece of data has changed.
|
9
8
|
class Checksummer
|
10
|
-
|
11
9
|
class << self
|
12
|
-
|
13
10
|
# @param obj The object to create a checksum for
|
14
11
|
#
|
15
12
|
# @return [String] The digest
|
@@ -21,23 +18,28 @@ module Nanoc
|
|
21
18
|
|
22
19
|
private
|
23
20
|
|
24
|
-
def update(obj, digest)
|
21
|
+
def update(obj, digest, visited = Set.new)
|
25
22
|
digest.update(obj.class.to_s)
|
26
23
|
|
24
|
+
if visited.include?(obj)
|
25
|
+
digest.update('recur')
|
26
|
+
return
|
27
|
+
end
|
28
|
+
|
27
29
|
case obj
|
28
30
|
when String
|
29
31
|
digest.update(obj)
|
30
32
|
when Array
|
31
33
|
obj.each do |el|
|
32
34
|
digest.update('elem')
|
33
|
-
update(el, digest)
|
35
|
+
update(el, digest, visited + [obj])
|
34
36
|
end
|
35
37
|
when Hash
|
36
38
|
obj.each do |key, value|
|
37
39
|
digest.update('key')
|
38
|
-
update(key, digest)
|
40
|
+
update(key, digest, visited + [obj])
|
39
41
|
digest.update('value')
|
40
|
-
update(value, digest)
|
42
|
+
update(value, digest, visited + [obj])
|
41
43
|
end
|
42
44
|
when Pathname
|
43
45
|
filename = obj.to_s
|
@@ -62,7 +64,7 @@ module Nanoc
|
|
62
64
|
digest.update('attributes')
|
63
65
|
attributes = obj.attributes.dup
|
64
66
|
attributes.delete(:file)
|
65
|
-
update(attributes, digest)
|
67
|
+
update(attributes, digest, visited + [obj])
|
66
68
|
else
|
67
69
|
data = begin
|
68
70
|
Marshal.dump(obj)
|
@@ -72,11 +74,7 @@ module Nanoc
|
|
72
74
|
|
73
75
|
digest.update(data)
|
74
76
|
end
|
75
|
-
|
76
77
|
end
|
77
|
-
|
78
78
|
end
|
79
|
-
|
80
79
|
end
|
81
|
-
|
82
80
|
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc
|
4
|
-
|
5
4
|
# Stores checksums for objects in order to be able to detect whether a file
|
6
5
|
# has changed since the last site compilation.
|
7
6
|
#
|
8
7
|
# @api private
|
9
8
|
class ChecksumStore < ::Nanoc::Store
|
10
|
-
|
11
9
|
# @option params [Nanoc::Site] site The site where this checksum store
|
12
10
|
# belongs to
|
13
11
|
def initialize(params = {})
|
@@ -51,7 +49,5 @@ module Nanoc
|
|
51
49
|
def data=(new_data)
|
52
50
|
@checksums = new_data
|
53
51
|
end
|
54
|
-
|
55
52
|
end
|
56
|
-
|
57
53
|
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc
|
4
|
-
|
5
4
|
# Represents a cache than can be used to store already compiled content,
|
6
5
|
# to prevent it from being needlessly recompiled.
|
7
6
|
#
|
8
7
|
# @api private
|
9
8
|
class CompiledContentCache < ::Nanoc::Store
|
10
|
-
|
11
9
|
def initialize
|
12
10
|
super('tmp/compiled_content', 1)
|
13
11
|
|
@@ -56,7 +54,5 @@ module Nanoc
|
|
56
54
|
def data=(new_data)
|
57
55
|
@cache = new_data
|
58
56
|
end
|
59
|
-
|
60
57
|
end
|
61
|
-
|
62
58
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc
|
4
|
-
|
5
4
|
# Responsible for compiling a site’s item representations.
|
6
5
|
#
|
7
6
|
# The compilation process makes use of notifications (see
|
@@ -39,7 +38,6 @@ module Nanoc
|
|
39
38
|
# * `processing_ended` — indicates that the compiler has finished processing
|
40
39
|
# the specified object.
|
41
40
|
class Compiler
|
42
|
-
|
43
41
|
extend Nanoc::Memoization
|
44
42
|
|
45
43
|
# @group Accessors
|
@@ -125,7 +123,7 @@ module Nanoc
|
|
125
123
|
route_reps
|
126
124
|
|
127
125
|
# Load auxiliary stores
|
128
|
-
stores.each
|
126
|
+
stores.each(&:load)
|
129
127
|
|
130
128
|
@loaded = true
|
131
129
|
rescue => e
|
@@ -144,7 +142,7 @@ module Nanoc
|
|
144
142
|
return if @unloading
|
145
143
|
@unloading = true
|
146
144
|
|
147
|
-
stores.each
|
145
|
+
stores.each(&:unload)
|
148
146
|
|
149
147
|
@stack = []
|
150
148
|
|
@@ -175,7 +173,7 @@ module Nanoc
|
|
175
173
|
end
|
176
174
|
|
177
175
|
# Store
|
178
|
-
stores.each
|
176
|
+
stores.each(&:store)
|
179
177
|
end
|
180
178
|
|
181
179
|
# Returns the dependency tracker for this site, creating it first if it
|
@@ -220,7 +218,7 @@ module Nanoc
|
|
220
218
|
raise Nanoc::Errors::NoMatchingCompilationRuleFound.new(item) if matching_rules.empty?
|
221
219
|
|
222
220
|
# Create reps
|
223
|
-
rep_names = matching_rules.map
|
221
|
+
rep_names = matching_rules.map(&:rep_name).uniq
|
224
222
|
rep_names.each do |rep_name|
|
225
223
|
item.reps << ItemRep.new(item, rep_name)
|
226
224
|
end
|
@@ -238,7 +236,7 @@ module Nanoc
|
|
238
236
|
|
239
237
|
rules.each_pair do |snapshot, rule|
|
240
238
|
# Get basic path by applying matching rule
|
241
|
-
basic_path = rule.apply_to(rep, :
|
239
|
+
basic_path = rule.apply_to(rep, compiler: self)
|
242
240
|
next if basic_path.nil?
|
243
241
|
if basic_path !~ %r{^/}
|
244
242
|
raise "The path returned for the #{rep.inspect} item representation, “#{basic_path}”, does not start with a slash. Please ensure that all routing rules return a path that starts with a slash."
|
@@ -270,28 +268,28 @@ module Nanoc
|
|
270
268
|
# @api private
|
271
269
|
def assigns_for(rep)
|
272
270
|
if rep.binary?
|
273
|
-
content_or_filename_assigns = { :
|
271
|
+
content_or_filename_assigns = { filename: rep.temporary_filenames[:last] }
|
274
272
|
else
|
275
|
-
content_or_filename_assigns = { :
|
273
|
+
content_or_filename_assigns = { content: rep.content[:last] }
|
276
274
|
end
|
277
275
|
|
278
276
|
content_or_filename_assigns.merge({
|
279
|
-
:
|
280
|
-
:
|
281
|
-
:
|
282
|
-
:
|
283
|
-
:
|
284
|
-
:
|
285
|
-
:
|
277
|
+
item: rep.item,
|
278
|
+
rep: rep,
|
279
|
+
item_rep: rep,
|
280
|
+
items: site.items,
|
281
|
+
layouts: site.layouts,
|
282
|
+
config: site.config,
|
283
|
+
site: site
|
286
284
|
})
|
287
285
|
end
|
288
286
|
|
289
287
|
# @return [Nanoc::OutdatednessChecker] The outdatedness checker
|
290
288
|
def outdatedness_checker
|
291
289
|
Nanoc::OutdatednessChecker.new(
|
292
|
-
:
|
293
|
-
:
|
294
|
-
:
|
290
|
+
site: @site,
|
291
|
+
checksum_store: checksum_store,
|
292
|
+
dependency_tracker: dependency_tracker)
|
295
293
|
end
|
296
294
|
memoize :outdatedness_checker
|
297
295
|
|
@@ -305,7 +303,7 @@ module Nanoc
|
|
305
303
|
|
306
304
|
# @return [Array<Nanoc::ItemRep>] The site’s item representations
|
307
305
|
def reps
|
308
|
-
items.map
|
306
|
+
items.map(&:reps).flatten
|
309
307
|
end
|
310
308
|
memoize :reps
|
311
309
|
|
@@ -383,8 +381,8 @@ module Nanoc
|
|
383
381
|
else
|
384
382
|
# Recalculate content
|
385
383
|
rep.snapshot(:raw)
|
386
|
-
rep.snapshot(:pre, :
|
387
|
-
rules_collection.compilation_rule_for(rep).apply_to(rep, :
|
384
|
+
rep.snapshot(:pre, final: false)
|
385
|
+
rules_collection.compilation_rule_for(rep).apply_to(rep, compiler: self)
|
388
386
|
rep.snapshot(:post) if rep.has_snapshot?(:post)
|
389
387
|
rep.snapshot(:last)
|
390
388
|
end
|
@@ -419,10 +417,10 @@ module Nanoc
|
|
419
417
|
# Returns a preprocessor context, creating one if none exists yet.
|
420
418
|
def preprocessor_context
|
421
419
|
Nanoc::Context.new({
|
422
|
-
:
|
423
|
-
:
|
424
|
-
:
|
425
|
-
:
|
420
|
+
site: @site,
|
421
|
+
config: @site.config,
|
422
|
+
items: @site.items,
|
423
|
+
layouts: @site.layouts
|
426
424
|
})
|
427
425
|
end
|
428
426
|
memoize :preprocessor_context
|
@@ -435,19 +433,19 @@ module Nanoc
|
|
435
433
|
|
436
434
|
# @return [ChecksumStore] The checksum store
|
437
435
|
def checksum_store
|
438
|
-
Nanoc::ChecksumStore.new(:
|
436
|
+
Nanoc::ChecksumStore.new(site: @site)
|
439
437
|
end
|
440
438
|
memoize :checksum_store
|
441
439
|
|
442
440
|
# @return [RuleMemoryStore] The rule memory store
|
443
441
|
def rule_memory_store
|
444
|
-
Nanoc::RuleMemoryStore.new(:
|
442
|
+
Nanoc::RuleMemoryStore.new(site: @site)
|
445
443
|
end
|
446
444
|
memoize :rule_memory_store
|
447
445
|
|
448
446
|
# @return [RuleMemoryCalculator] The rule memory calculator
|
449
447
|
def rule_memory_calculator
|
450
|
-
Nanoc::RuleMemoryCalculator.new(:
|
448
|
+
Nanoc::RuleMemoryCalculator.new(rules_collection: rules_collection)
|
451
449
|
end
|
452
450
|
memoize :rule_memory_calculator
|
453
451
|
|
@@ -461,7 +459,5 @@ module Nanoc
|
|
461
459
|
rule_memory_store
|
462
460
|
]
|
463
461
|
end
|
464
|
-
|
465
462
|
end
|
466
|
-
|
467
463
|
end
|