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,23 +1,19 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::CLI::StreamCleaners
|
4
|
-
|
5
4
|
# Superclass for all stream cleaners. Stream cleaners have a single method,
|
6
5
|
# {#clean}, that takes a string and returns a cleaned string. Stream cleaners
|
7
6
|
# can have state, so they can act as a FSM.
|
8
7
|
#
|
9
8
|
# @abstract Subclasses must implement {#clean}
|
10
9
|
class Abstract
|
11
|
-
|
12
10
|
# Returns a cleaned version of the given string.
|
13
11
|
#
|
14
12
|
# @param [String] s The string to clean
|
15
13
|
#
|
16
14
|
# @return [String] The cleaned string
|
17
|
-
def clean(
|
15
|
+
def clean(s) # rubocop:disable Lint/UnusedMethodArgument
|
18
16
|
raise NotImplementedError, 'Subclasses of Nanoc::CLI::StreamCleaners::Abstract must implement #clean'
|
19
17
|
end
|
20
|
-
|
21
18
|
end
|
22
|
-
|
23
19
|
end
|
@@ -1,15 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::CLI::StreamCleaners
|
4
|
-
|
5
4
|
# Removes ANSI color escape sequences.
|
6
5
|
class ANSIColors < Abstract
|
7
|
-
|
8
6
|
# @see Nanoc::CLI::StreamCleaners::Abstract#clean
|
9
7
|
def clean(s)
|
10
8
|
s.gsub(/\e\[.+?m/, '')
|
11
9
|
end
|
12
|
-
|
13
10
|
end
|
14
|
-
|
15
11
|
end
|
@@ -1,16 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::CLI::StreamCleaners
|
4
|
-
|
5
4
|
# Simplifies output by replacing UTF-8 characters with their ASCII decompositions.
|
6
5
|
class UTF8 < Abstract
|
7
|
-
|
8
6
|
# @see Nanoc::CLI::StreamCleaners::Abstract#clean
|
9
7
|
def clean(s)
|
10
|
-
# FIXME this decomposition is not generally usable
|
8
|
+
# FIXME: this decomposition is not generally usable
|
11
9
|
s.gsub(/“|”/, '"').gsub(/‘|’/, '\'').gsub('…', '...').gsub('©', '(c)')
|
12
10
|
end
|
13
|
-
|
14
11
|
end
|
15
|
-
|
16
12
|
end
|
data/lib/nanoc/data_sources.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::DataSources
|
4
|
-
|
5
4
|
autoload 'Filesystem', 'nanoc/data_sources/filesystem'
|
6
5
|
autoload 'FilesystemUnified', 'nanoc/data_sources/filesystem_unified'
|
7
6
|
autoload 'FilesystemVerbose', 'nanoc/data_sources/filesystem_verbose'
|
@@ -12,7 +11,7 @@ module Nanoc::DataSources
|
|
12
11
|
Nanoc::DataSource.register '::Nanoc::DataSources::Static', :static
|
13
12
|
|
14
13
|
# Deprecated; fetch data from online data sources manually instead
|
15
|
-
# TODO [in nanoc 4.0] remove me
|
14
|
+
# TODO: [in nanoc 4.0] remove me
|
16
15
|
autoload 'Delicious', 'nanoc/data_sources/deprecated/delicious'
|
17
16
|
autoload 'LastFM', 'nanoc/data_sources/deprecated/last_fm'
|
18
17
|
autoload 'Twitter', 'nanoc/data_sources/deprecated/twitter'
|
@@ -21,11 +20,10 @@ module Nanoc::DataSources
|
|
21
20
|
Nanoc::DataSource.register '::Nanoc::DataSources::Twitter', :twitter
|
22
21
|
|
23
22
|
# Deprecated; use `filesystem_verbose` or `filesystem_unified` instead
|
24
|
-
# TODO [in nanoc 4.0] remove me
|
23
|
+
# TODO: [in nanoc 4.0] remove me
|
25
24
|
Nanoc::DataSource.register '::Nanoc::DataSources::FilesystemVerbose', :filesystem
|
26
25
|
Nanoc::DataSource.register '::Nanoc::DataSources::FilesystemUnified', :filesystem_combined
|
27
26
|
Nanoc::DataSource.register '::Nanoc::DataSources::FilesystemUnified', :filesystem_compact
|
28
27
|
FilesystemCombined = FilesystemUnified
|
29
28
|
FilesystemCompact = FilesystemUnified
|
30
|
-
|
31
29
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::DataSources
|
4
|
-
|
5
4
|
# @deprecated Fetch data from online data sources manually instead
|
6
5
|
class Delicious < Nanoc::DataSource
|
7
|
-
|
8
6
|
def items
|
9
7
|
@items ||= begin
|
10
8
|
require 'json'
|
@@ -21,12 +19,12 @@ module Nanoc::DataSources
|
|
21
19
|
# Get data
|
22
20
|
content = raw_item['n']
|
23
21
|
attributes = {
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
22
|
+
url: raw_item['u'],
|
23
|
+
description: raw_item['d'],
|
24
|
+
tags: raw_item['t'],
|
25
|
+
date: Time.parse(raw_item['dt']),
|
26
|
+
note: raw_item['n'],
|
27
|
+
author: raw_item['a']
|
30
28
|
}
|
31
29
|
identifier = "/#{i}/"
|
32
30
|
mtime = nil
|
@@ -36,7 +34,5 @@ module Nanoc::DataSources
|
|
36
34
|
end
|
37
35
|
end
|
38
36
|
end
|
39
|
-
|
40
37
|
end
|
41
|
-
|
42
38
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::DataSources
|
4
|
-
|
5
4
|
# @deprecated Fetch data from online data sources manually instead
|
6
5
|
class LastFM < Nanoc::DataSource
|
7
|
-
|
8
6
|
def items
|
9
7
|
@items ||= begin
|
10
8
|
require 'json'
|
@@ -66,14 +64,14 @@ module Nanoc::DataSources
|
|
66
64
|
end
|
67
65
|
|
68
66
|
attributes = {
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
67
|
+
name: raw_item['name'],
|
68
|
+
artist: {
|
69
|
+
name: raw_artist_info['name'],
|
70
|
+
url: raw_artist_info['url']
|
73
71
|
},
|
74
|
-
:
|
75
|
-
:
|
76
|
-
:
|
72
|
+
url: raw_item['url'],
|
73
|
+
played_at: track_played_at,
|
74
|
+
now_playing: now_playing
|
77
75
|
}
|
78
76
|
identifier = "/#{i}/"
|
79
77
|
mtime = nil
|
@@ -83,7 +81,5 @@ module Nanoc::DataSources
|
|
83
81
|
end
|
84
82
|
end
|
85
83
|
end
|
86
|
-
|
87
84
|
end
|
88
|
-
|
89
85
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::DataSources
|
4
|
-
|
5
4
|
# @deprecated Fetch data from online data sources manually instead
|
6
5
|
class Twitter < Nanoc::DataSource
|
7
|
-
|
8
6
|
def items
|
9
7
|
@item ||= begin
|
10
8
|
require 'json'
|
@@ -21,8 +19,8 @@ module Nanoc::DataSources
|
|
21
19
|
# Get data
|
22
20
|
content = raw_item['text']
|
23
21
|
attributes = {
|
24
|
-
:
|
25
|
-
:
|
22
|
+
created_at: raw_item['created_at'],
|
23
|
+
source: raw_item['source']
|
26
24
|
}
|
27
25
|
identifier = "/#{raw_item['id']}/"
|
28
26
|
mtime = Time.parse(raw_item['created_at'])
|
@@ -32,7 +30,5 @@ module Nanoc::DataSources
|
|
32
30
|
end
|
33
31
|
end
|
34
32
|
end
|
35
|
-
|
36
33
|
end
|
37
|
-
|
38
34
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::DataSources
|
4
|
-
|
5
4
|
# Provides functionality common across all filesystem data sources.
|
6
5
|
module Filesystem
|
7
|
-
|
8
6
|
# The VCS that will be called when adding, deleting and moving files. If
|
9
7
|
# no VCS has been set, or if the VCS has been set to `nil`, a dummy VCS
|
10
8
|
# will be returned.
|
@@ -101,14 +99,14 @@ module Nanoc::DataSources
|
|
101
99
|
|
102
100
|
# Get attributes
|
103
101
|
attributes = {
|
104
|
-
:
|
105
|
-
:
|
106
|
-
:
|
107
|
-
:
|
102
|
+
filename: content_filename,
|
103
|
+
content_filename: content_filename,
|
104
|
+
meta_filename: meta_filename,
|
105
|
+
extension: content_filename ? ext_of(content_filename)[1..-1] : nil,
|
108
106
|
# WARNING :file is deprecated; please create a File object manually
|
109
107
|
# using the :content_filename or :meta_filename attributes.
|
110
|
-
# TODO [in nanoc 4.0] remove me
|
111
|
-
:
|
108
|
+
# TODO: [in nanoc 4.0] remove me
|
109
|
+
file: content_filename ? Nanoc::Extra::FileProxy.new(content_filename) : nil
|
112
110
|
}.merge(meta)
|
113
111
|
|
114
112
|
# Get identifier
|
@@ -136,7 +134,7 @@ module Nanoc::DataSources
|
|
136
134
|
# Create layout object
|
137
135
|
klass.new(
|
138
136
|
content_or_filename, attributes, identifier,
|
139
|
-
:
|
137
|
+
binary: is_binary, mtime: mtime
|
140
138
|
)
|
141
139
|
end
|
142
140
|
end
|
@@ -153,7 +151,8 @@ module Nanoc::DataSources
|
|
153
151
|
# 'content/qux' => [ nil, 'html' ]
|
154
152
|
# }
|
155
153
|
def all_split_files_in(dir_name)
|
156
|
-
grouped_filenames =
|
154
|
+
grouped_filenames =
|
155
|
+
all_files_in(dir_name)
|
157
156
|
.reject { |fn| fn =~ /(~|\.orig|\.rej|\.bak)$/ }
|
158
157
|
.group_by { |fn| basename_of(fn) }
|
159
158
|
|
@@ -180,7 +179,7 @@ module Nanoc::DataSources
|
|
180
179
|
|
181
180
|
# Returns all files in the given directory and directories below it.
|
182
181
|
def all_files_in(dir_name)
|
183
|
-
Nanoc::Extra::FilesystemTools.all_files_in(dir_name)
|
182
|
+
Nanoc::Extra::FilesystemTools.all_files_in(dir_name, config[:extra_files])
|
184
183
|
end
|
185
184
|
|
186
185
|
# Returns the filename for the given base filename and the extension.
|
@@ -318,7 +317,5 @@ module Nanoc::DataSources
|
|
318
317
|
def raise_encoding_error(filename, encoding)
|
319
318
|
raise RuntimeError.new("Could not read #{filename} because the file is not valid #{encoding}.")
|
320
319
|
end
|
321
|
-
|
322
320
|
end
|
323
|
-
|
324
321
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::DataSources
|
4
|
-
|
5
4
|
# The filesystem_unified data source stores its items and layouts in nested
|
6
5
|
# directories. Items and layouts are represented by one or two files; if it
|
7
6
|
# is represented using one file, the metadata can be contained in this file.
|
@@ -68,7 +67,6 @@ module Nanoc::DataSources
|
|
68
67
|
# understood by Ruby’s `Encoding`. If no encoding is set in the configuration,
|
69
68
|
# one will be inferred from the environment.
|
70
69
|
class FilesystemUnified < Nanoc::DataSource
|
71
|
-
|
72
70
|
include Nanoc::DataSources::Filesystem
|
73
71
|
|
74
72
|
private
|
@@ -121,7 +119,5 @@ module Nanoc::DataSources
|
|
121
119
|
end
|
122
120
|
filename.sub(regex, '').cleaned_identifier
|
123
121
|
end
|
124
|
-
|
125
122
|
end
|
126
|
-
|
127
123
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::DataSources
|
4
|
-
|
5
4
|
# The filesystem_verbose data source is the old data source for a new nanoc
|
6
5
|
# site. It stores all data as files on the hard disk.
|
7
6
|
#
|
@@ -40,7 +39,6 @@ module Nanoc::DataSources
|
|
40
39
|
# understood by Ruby’s `Encoding`. If no encoding is set in the configuration,
|
41
40
|
# one will be inferred from the environment.
|
42
41
|
class FilesystemVerbose < Nanoc::DataSource
|
43
|
-
|
44
42
|
include Nanoc::DataSources::Filesystem
|
45
43
|
|
46
44
|
private
|
@@ -84,7 +82,5 @@ module Nanoc::DataSources
|
|
84
82
|
def identifier_for_filename(filename)
|
85
83
|
filename.sub(/[^\/]+\.yaml$/, '')
|
86
84
|
end
|
87
|
-
|
88
85
|
end
|
89
|
-
|
90
86
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::DataSources
|
4
|
-
|
5
4
|
# The static data source provides items from a single directory. Unlike the
|
6
5
|
# filesystem data sources, static provides no additional item metadata. In
|
7
6
|
# addition, all items are treated as 'binary', regardless of their extension
|
@@ -26,7 +25,6 @@ module Nanoc::DataSources
|
|
26
25
|
# exclude them from the Blogging helper's atom feed generator, among other
|
27
26
|
# things.
|
28
27
|
class Static < Nanoc::DataSource
|
29
|
-
|
30
28
|
identifier :static
|
31
29
|
|
32
30
|
def items
|
@@ -36,8 +34,8 @@ module Nanoc::DataSources
|
|
36
34
|
# Convert filenames to items
|
37
35
|
all_files_in(prefix).map do |filename|
|
38
36
|
attributes = {
|
39
|
-
:
|
40
|
-
:
|
37
|
+
extension: File.extname(filename)[1..-1],
|
38
|
+
filename: filename,
|
41
39
|
}
|
42
40
|
attributes[:is_hidden] = true unless config[:hide_items] == false
|
43
41
|
identifier = filename[(prefix.length + 1)..-1] + '/'
|
@@ -48,7 +46,7 @@ module Nanoc::DataSources
|
|
48
46
|
filename,
|
49
47
|
attributes,
|
50
48
|
identifier,
|
51
|
-
:
|
49
|
+
binary: true, mtime: mtime, checksum: checksum
|
52
50
|
)
|
53
51
|
end
|
54
52
|
end
|
@@ -56,9 +54,7 @@ module Nanoc::DataSources
|
|
56
54
|
protected
|
57
55
|
|
58
56
|
def all_files_in(dir_name)
|
59
|
-
Nanoc::Extra::FilesystemTools.all_files_in(dir_name)
|
57
|
+
Nanoc::Extra::FilesystemTools.all_files_in(dir_name, config[:extra_files])
|
60
58
|
end
|
61
|
-
|
62
59
|
end
|
63
|
-
|
64
60
|
end
|
data/lib/nanoc/extra.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Extra
|
4
|
-
|
5
4
|
autoload 'AutoCompiler', 'nanoc/extra/auto_compiler'
|
6
5
|
autoload 'Checking', 'nanoc/extra/checking'
|
7
6
|
autoload 'CHiCk', 'nanoc/extra/chick'
|
@@ -13,13 +12,12 @@ module Nanoc::Extra
|
|
13
12
|
autoload 'JRubyNokogiriWarner', 'nanoc/extra/jruby_nokogiri_warner'
|
14
13
|
|
15
14
|
# Deprecated; use {Nanoc::Context} instead
|
16
|
-
# TODO [in nanoc 4.0] remove me
|
15
|
+
# TODO: [in nanoc 4.0] remove me
|
17
16
|
Context = ::Nanoc::Context
|
18
17
|
|
19
18
|
# Deprecated
|
20
|
-
# TODO [in nanoc 4.0] remove me
|
19
|
+
# TODO: [in nanoc 4.0] remove me
|
21
20
|
autoload 'FileProxy', 'nanoc/extra/file_proxy'
|
22
|
-
|
23
21
|
end
|
24
22
|
|
25
23
|
require 'nanoc/extra/core_ext'
|
@@ -1,11 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Extra
|
4
|
-
|
5
4
|
# A web server that will automatically compile items as they are requested.
|
6
5
|
# It also serves static files such as stylesheets and images.
|
7
6
|
class AutoCompiler
|
8
|
-
|
9
7
|
# @return [Nanoc::Site] The site this autocompiler belongs to
|
10
8
|
attr_reader :site
|
11
9
|
|
@@ -38,10 +36,10 @@ module Nanoc::Extra
|
|
38
36
|
|
39
37
|
# Find rep
|
40
38
|
path = Rack::Utils.unescape(env['PATH_INFO'])
|
41
|
-
reps = site.items.map
|
39
|
+
reps = site.items.map(&:reps).flatten
|
42
40
|
rep = reps.find do |r|
|
43
41
|
r.path == path ||
|
44
|
-
|
42
|
+
r.raw_path == site.config[:output_dir] + path
|
45
43
|
end
|
46
44
|
|
47
45
|
# Recompile
|
@@ -97,7 +95,5 @@ module Nanoc::Extra
|
|
97
95
|
def stack
|
98
96
|
site.compiler.stack
|
99
97
|
end
|
100
|
-
|
101
98
|
end
|
102
|
-
|
103
99
|
end
|
data/lib/nanoc/extra/checking.rb
CHANGED
@@ -1,16 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Extra
|
4
|
-
|
5
4
|
module Checking
|
6
|
-
|
7
5
|
autoload 'Check', 'nanoc/extra/checking/check'
|
8
6
|
autoload 'DSL', 'nanoc/extra/checking/dsl'
|
9
7
|
autoload 'Runner', 'nanoc/extra/checking/runner.rb'
|
10
8
|
autoload 'Issue', 'nanoc/extra/checking/issue'
|
11
|
-
|
12
9
|
end
|
13
|
-
|
14
10
|
end
|
15
11
|
|
16
12
|
require 'nanoc/extra/checking/checks'
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
module Nanoc::Extra::Checking
|
4
|
-
|
5
4
|
class OutputDirNotFoundError < Nanoc::Errors::Generic
|
6
5
|
def initialize(directory_path)
|
7
6
|
super("Unable to run check against output directory at “#{directory_path}”: directory does not exist.")
|
@@ -9,7 +8,6 @@ module Nanoc::Extra::Checking
|
|
9
8
|
end
|
10
9
|
|
11
10
|
class Check
|
12
|
-
|
13
11
|
extend Nanoc::PluginRegistry::PluginMethods
|
14
12
|
|
15
13
|
attr_reader :site
|
@@ -37,7 +35,5 @@ module Nanoc::Extra::Checking
|
|
37
35
|
end
|
38
36
|
Dir[output_dir + '/**/*'].select { |f| File.file?(f) }
|
39
37
|
end
|
40
|
-
|
41
38
|
end
|
42
|
-
|
43
39
|
end
|