nanoc 4.4.7 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -7
- data/NEWS.md +6 -0
- data/lib/nanoc.rb +1 -0
- data/lib/nanoc/base.rb +0 -1
- data/lib/nanoc/base/feature.rb +1 -1
- data/lib/nanoc/base/repos/data_source.rb +1 -1
- data/lib/nanoc/base/repos/site_loader.rb +1 -1
- data/lib/nanoc/base/services/action_provider.rb +1 -1
- data/lib/nanoc/base/services/filter.rb +1 -1
- data/lib/nanoc/checking.rb +7 -9
- data/lib/nanoc/checking/check.rb +1 -1
- data/lib/nanoc/checking/checks.rb +9 -17
- data/lib/nanoc/checking/checks/internal_links.rb +2 -0
- data/lib/nanoc/checking/checks/mixed_content.rb +2 -0
- data/lib/nanoc/checking/checks/stale.rb +2 -0
- data/lib/nanoc/checking/runner.rb +2 -2
- data/lib/nanoc/cli.rb +9 -6
- data/lib/nanoc/cli/commands/deploy.rb +4 -4
- data/lib/nanoc/cli/commands/show-plugins.rb +12 -12
- data/lib/nanoc/cli/stream_cleaners.rb +7 -7
- data/lib/nanoc/data_sources.rb +0 -3
- data/lib/nanoc/data_sources/filesystem.rb +2 -0
- data/lib/nanoc/deploying/deployer.rb +1 -1
- data/lib/nanoc/deploying/deployers.rb +6 -9
- data/lib/nanoc/deploying/deployers/fog.rb +2 -0
- data/lib/nanoc/deploying/deployers/git.rb +118 -0
- data/lib/nanoc/deploying/deployers/rsync.rb +2 -0
- data/lib/nanoc/extra.rb +5 -6
- data/lib/nanoc/filters.rb +28 -55
- data/lib/nanoc/filters/asciidoc.rb +2 -0
- data/lib/nanoc/filters/bluecloth.rb +2 -0
- data/lib/nanoc/filters/coffeescript.rb +2 -0
- data/lib/nanoc/filters/colorize_syntax.rb +2 -0
- data/lib/nanoc/filters/erb.rb +2 -0
- data/lib/nanoc/filters/erubis.rb +9 -8
- data/lib/nanoc/filters/haml.rb +2 -0
- data/lib/nanoc/filters/handlebars.rb +2 -0
- data/lib/nanoc/filters/kramdown.rb +2 -0
- data/lib/nanoc/filters/less.rb +2 -0
- data/lib/nanoc/filters/markaby.rb +2 -0
- data/lib/nanoc/filters/maruku.rb +2 -0
- data/lib/nanoc/filters/mustache.rb +2 -0
- data/lib/nanoc/filters/pandoc.rb +2 -0
- data/lib/nanoc/filters/rainpress.rb +2 -0
- data/lib/nanoc/filters/rdiscount.rb +2 -0
- data/lib/nanoc/filters/rdoc.rb +2 -0
- data/lib/nanoc/filters/redcarpet.rb +2 -0
- data/lib/nanoc/filters/redcloth.rb +2 -0
- data/lib/nanoc/filters/relativize_paths.rb +2 -0
- data/lib/nanoc/filters/rubypants.rb +2 -0
- data/lib/nanoc/filters/sass.rb +2 -0
- data/lib/nanoc/filters/slim.rb +2 -0
- data/lib/nanoc/filters/typogruby.rb +2 -0
- data/lib/nanoc/filters/uglify_js.rb +2 -0
- data/lib/nanoc/filters/xsl.rb +2 -0
- data/lib/nanoc/filters/yui_compressor.rb +2 -0
- data/lib/nanoc/helpers.rb +12 -11
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.gemspec +1 -0
- data/spec/nanoc/base/filter_spec.rb +2 -2
- data/spec/nanoc/cli/commands/deploy_spec.rb +2 -2
- data/spec/nanoc/cli/commands/show_plugins_spec.rb +18 -0
- data/spec/nanoc/deploying/git_spec.rb +302 -0
- data/spec/spec_helper.rb +2 -0
- data/test/deploying/test_git.rb +261 -0
- metadata +20 -5
- data/lib/nanoc/base/plugin_registry.rb +0 -219
- data/spec/nanoc/base/plugin_registry_spec.rb +0 -29
- data/test/base/test_plugin.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9fe24df25829104e02f16485e69acb439b50860
|
4
|
+
data.tar.gz: fd6c49bc1c0bf21d94cfd0a74b436a70ead571d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ec49097ecfdc9ad9de7e70fe52368d13c5a6ddcc1ffa4a6894ce26de86a94385c4dc173c4e0f5051a89046ecdd6df782d1fc9c85b20feda26414d92a2daee14
|
7
|
+
data.tar.gz: 0d05e92cab7232aa0fb057d0e3ed2159cdb25309f884e372271e2123baf7d4b67ddaa159791d7a62ee4e040ea261cbd4b572b7f96d008d52f5830747f2e10201
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git://github.com/bbatsov/rubocop.git
|
3
|
-
revision:
|
3
|
+
revision: 1121924ee2ebe09053b7ca95b50aac03e01acada
|
4
4
|
specs:
|
5
5
|
rubocop (0.46.0)
|
6
6
|
parser (>= 2.3.3.1, < 3.0)
|
@@ -11,7 +11,7 @@ GIT
|
|
11
11
|
|
12
12
|
GIT
|
13
13
|
remote: git://github.com/cowboyd/therubyracer.git
|
14
|
-
revision:
|
14
|
+
revision: 466a1f0d4f696acfe971899272359623ec0a7a97
|
15
15
|
specs:
|
16
16
|
therubyracer (0.12.3)
|
17
17
|
libv8 (~> 3.16.14.15)
|
@@ -27,8 +27,9 @@ GIT
|
|
27
27
|
PATH
|
28
28
|
remote: .
|
29
29
|
specs:
|
30
|
-
nanoc (4.
|
30
|
+
nanoc (4.5.0)
|
31
31
|
cri (~> 2.3)
|
32
|
+
ddplugin (~> 1.0)
|
32
33
|
hamster (~> 3.0)
|
33
34
|
ref (~> 2.0)
|
34
35
|
|
@@ -80,6 +81,7 @@ GEM
|
|
80
81
|
safe_yaml (~> 1.0.0)
|
81
82
|
cri (2.7.1)
|
82
83
|
colored (~> 1.2)
|
84
|
+
ddplugin (1.0.0)
|
83
85
|
diff-lcs (1.2.5)
|
84
86
|
docile (1.1.5)
|
85
87
|
erubis (2.7.0)
|
@@ -159,7 +161,7 @@ GEM
|
|
159
161
|
multi_json (~> 1.10)
|
160
162
|
fog-local (0.3.1)
|
161
163
|
fog-core (~> 1.27)
|
162
|
-
fog-openstack (0.1.
|
164
|
+
fog-openstack (0.1.19)
|
163
165
|
fog-core (>= 1.40)
|
164
166
|
fog-json (>= 1.0)
|
165
167
|
ipaddress (>= 0.8)
|
@@ -170,7 +172,7 @@ GEM
|
|
170
172
|
fog-profitbricks (3.0.0)
|
171
173
|
fog-core (~> 1.42)
|
172
174
|
fog-json (~> 1.0)
|
173
|
-
fog-rackspace (0.1.
|
175
|
+
fog-rackspace (0.1.3)
|
174
176
|
fog-core (>= 1.35)
|
175
177
|
fog-json (>= 1.0)
|
176
178
|
fog-xml (>= 0.1)
|
@@ -241,7 +243,7 @@ GEM
|
|
241
243
|
inflecto (0.0.2)
|
242
244
|
ipaddress (0.8.3)
|
243
245
|
json (2.0.2)
|
244
|
-
kramdown (1.13.
|
246
|
+
kramdown (1.13.2)
|
245
247
|
less (2.6.0)
|
246
248
|
commonjs (~> 0.2.7)
|
247
249
|
libv8 (3.16.14.17)
|
@@ -352,7 +354,7 @@ GEM
|
|
352
354
|
crack (>= 0.3.2)
|
353
355
|
hashdiff
|
354
356
|
xml-simple (1.1.5)
|
355
|
-
yard (0.9.
|
357
|
+
yard (0.9.6)
|
356
358
|
yard-contracts (0.1.5)
|
357
359
|
contracts (~> 0.7)
|
358
360
|
yard (~> 0.8)
|
data/NEWS.md
CHANGED
data/lib/nanoc.rb
CHANGED
data/lib/nanoc/base.rb
CHANGED
data/lib/nanoc/base/feature.rb
CHANGED
@@ -27,7 +27,7 @@ module Nanoc
|
|
27
27
|
# online data sources could contain authentication details.
|
28
28
|
attr_reader :config
|
29
29
|
|
30
|
-
extend
|
30
|
+
extend DDPlugin::Plugin
|
31
31
|
|
32
32
|
def initialize(site_config, items_root, layouts_root, config)
|
33
33
|
@site_config = site_config
|
@@ -61,7 +61,7 @@ module Nanoc::Int
|
|
61
61
|
def create_data_sources(config)
|
62
62
|
config[:data_sources].map do |data_source_hash|
|
63
63
|
# Get data source class
|
64
|
-
data_source_class = Nanoc::DataSource.named(data_source_hash[:type])
|
64
|
+
data_source_class = Nanoc::DataSource.named(data_source_hash[:type].to_sym)
|
65
65
|
if data_source_class.nil?
|
66
66
|
raise Nanoc::Int::Errors::UnknownDataSource.new(data_source_hash[:type])
|
67
67
|
end
|
data/lib/nanoc/checking.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module Checking
|
4
|
-
autoload 'Check', 'nanoc/checking/check'
|
5
|
-
autoload 'DSL', 'nanoc/checking/dsl'
|
6
|
-
autoload 'Runner', 'nanoc/checking/runner.rb'
|
7
|
-
autoload 'Issue', 'nanoc/checking/issue'
|
8
|
-
end
|
1
|
+
# @api private
|
2
|
+
module Nanoc::Checking
|
9
3
|
end
|
10
4
|
|
11
|
-
|
5
|
+
require_relative 'checking/check'
|
6
|
+
require_relative 'checking/checks'
|
7
|
+
require_relative 'checking/dsl'
|
8
|
+
require_relative 'checking/runner.rb'
|
9
|
+
require_relative 'checking/issue'
|
data/lib/nanoc/checking/check.rb
CHANGED
@@ -1,20 +1,12 @@
|
|
1
|
-
require_relative 'checks/w3c_validator'
|
2
|
-
|
3
1
|
# @api private
|
4
2
|
module Nanoc::Checking::Checks
|
5
|
-
autoload 'CSS', 'nanoc/checking/checks/css'
|
6
|
-
autoload 'ExternalLinks', 'nanoc/checking/checks/external_links'
|
7
|
-
autoload 'HTML', 'nanoc/checking/checks/html'
|
8
|
-
autoload 'InternalLinks', 'nanoc/checking/checks/internal_links'
|
9
|
-
autoload 'Stale', 'nanoc/checking/checks/stale'
|
10
|
-
autoload 'MixedContent', 'nanoc/checking/checks/mixed_content'
|
11
|
-
|
12
|
-
Nanoc::Checking::Check.register '::Nanoc::Checking::Checks::CSS', :css
|
13
|
-
Nanoc::Checking::Check.register '::Nanoc::Checking::Checks::ExternalLinks', :external_links
|
14
|
-
Nanoc::Checking::Check.register '::Nanoc::Checking::Checks::ExternalLinks', :elinks
|
15
|
-
Nanoc::Checking::Check.register '::Nanoc::Checking::Checks::HTML', :html
|
16
|
-
Nanoc::Checking::Check.register '::Nanoc::Checking::Checks::InternalLinks', :internal_links
|
17
|
-
Nanoc::Checking::Check.register '::Nanoc::Checking::Checks::InternalLinks', :ilinks
|
18
|
-
Nanoc::Checking::Check.register '::Nanoc::Checking::Checks::Stale', :stale
|
19
|
-
Nanoc::Checking::Check.register '::Nanoc::Checking::Checks::MixedContent', :mixed_content
|
20
3
|
end
|
4
|
+
|
5
|
+
require_relative 'checks/w3c_validator'
|
6
|
+
|
7
|
+
require_relative 'checks/css'
|
8
|
+
require_relative 'checks/external_links'
|
9
|
+
require_relative 'checks/html'
|
10
|
+
require_relative 'checks/internal_links'
|
11
|
+
require_relative 'checks/mixed_content'
|
12
|
+
require_relative 'checks/stale'
|
@@ -5,6 +5,8 @@ module Nanoc::Checking::Checks
|
|
5
5
|
#
|
6
6
|
# @api private
|
7
7
|
class InternalLinks < ::Nanoc::Checking::Check
|
8
|
+
identifiers :internal_links, :ilinks
|
9
|
+
|
8
10
|
# Starts the validator. The results will be printed to stdout.
|
9
11
|
#
|
10
12
|
# Internal links that match a regexp pattern in `@config[:checks][:internal_links][:exclude]` will
|
@@ -93,12 +93,12 @@ module Nanoc::Checking
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def all_check_classes
|
96
|
-
Nanoc::Checking::Check.all
|
96
|
+
Nanoc::Checking::Check.all
|
97
97
|
end
|
98
98
|
|
99
99
|
def check_classes_named(n)
|
100
100
|
n.map do |a|
|
101
|
-
klass = Nanoc::Checking::Check.named(a)
|
101
|
+
klass = Nanoc::Checking::Check.named(a.to_sym)
|
102
102
|
raise Nanoc::Int::Errors::GenericTrivial, "Unknown check: #{a}" if klass.nil?
|
103
103
|
klass
|
104
104
|
end
|
data/lib/nanoc/cli.rb
CHANGED
@@ -10,14 +10,17 @@ end
|
|
10
10
|
module Nanoc::CLI
|
11
11
|
module Commands
|
12
12
|
end
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
require_relative 'cli/ansi_string_colorizer'
|
16
|
+
require_relative 'cli/logger'
|
17
|
+
require_relative 'cli/command_runner'
|
18
|
+
require_relative 'cli/cleaning_stream'
|
19
|
+
require_relative 'cli/stream_cleaners'
|
20
|
+
require_relative 'cli/error_handler'
|
20
21
|
|
22
|
+
# @api private
|
23
|
+
module Nanoc::CLI
|
21
24
|
# @return [Boolean] true if debug output is enabled, false if not
|
22
25
|
def self.debug?
|
23
26
|
@debug || false
|
@@ -27,8 +27,8 @@ module Nanoc::CLI::Commands
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def list_deployers
|
30
|
-
deployers = Nanoc::
|
31
|
-
deployer_names = deployers.
|
30
|
+
deployers = Nanoc::Deploying::Deployer.all
|
31
|
+
deployer_names = deployers.map(&:identifier).sort
|
32
32
|
puts 'Available deployers:'
|
33
33
|
deployer_names.each do |name|
|
34
34
|
puts " #{name}"
|
@@ -105,14 +105,14 @@ module Nanoc::CLI::Commands
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def deployer_class_for_config(config)
|
108
|
-
names = Nanoc::Deploying::Deployer.all.keys
|
109
108
|
name = config.fetch(:kind) do
|
110
109
|
$stderr.puts 'Warning: The specified deploy target does not have a kind attribute. Assuming rsync.'
|
111
110
|
'rsync'
|
112
111
|
end
|
113
112
|
|
114
|
-
deployer_class = Nanoc::Deploying::Deployer.named(name)
|
113
|
+
deployer_class = Nanoc::Deploying::Deployer.named(name.to_sym)
|
115
114
|
if deployer_class.nil?
|
115
|
+
names = Nanoc::Deploying::Deployer.all.map(&:identifier)
|
116
116
|
raise Nanoc::Int::Errors::GenericTrivial, "The specified deploy target has an unrecognised kind “#{name}” (expected one of #{names.join(', ')})."
|
117
117
|
end
|
118
118
|
deployer_class
|
@@ -15,24 +15,24 @@ module Nanoc::CLI::Commands
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# Get list of plugins (before and after)
|
18
|
-
plugins_before =
|
18
|
+
plugins_before = PLUGIN_CLASSES.keys.each_with_object({}) { |c, acc| acc[c] = c.all }
|
19
19
|
site.code_snippets if site
|
20
|
-
plugins_after =
|
20
|
+
plugins_after = PLUGIN_CLASSES.keys.each_with_object({}) { |c, acc| acc[c] = c.all }
|
21
21
|
|
22
22
|
# Divide list of plugins into builtin and custom
|
23
23
|
plugins_builtin = plugins_before
|
24
|
-
plugins_custom = plugins_after
|
24
|
+
plugins_custom = plugins_after.each_with_object({}) do |(superclass, klasses), acc|
|
25
|
+
acc[superclass] = klasses - plugins_before[superclass]
|
26
|
+
end
|
25
27
|
|
26
28
|
# Find max identifiers length
|
27
|
-
|
28
|
-
|
29
|
-
end
|
30
|
-
max_identifiers_length = plugin_with_longest_identifiers[:identifiers].join(', ').size
|
29
|
+
all_identifiers = plugins_after.values.flatten.map(&:identifiers)
|
30
|
+
max_identifiers_length = all_identifiers.map(&:to_s).map(&:size).max
|
31
31
|
|
32
32
|
PLUGIN_CLASS_ORDER.each do |superclass|
|
33
33
|
plugins_with_this_superclass = {
|
34
|
-
builtin: plugins_builtin.
|
35
|
-
custom: plugins_custom.
|
34
|
+
builtin: plugins_builtin.fetch(superclass, []),
|
35
|
+
custom: plugins_custom.fetch(superclass, []),
|
36
36
|
}
|
37
37
|
|
38
38
|
# Print kind
|
@@ -53,12 +53,12 @@ module Nanoc::CLI::Commands
|
|
53
53
|
end
|
54
54
|
|
55
55
|
# Print plugins
|
56
|
-
relevant_plugins.sort_by { |k| k
|
56
|
+
relevant_plugins.sort_by { |k| k.identifiers.join(', ') }.each do |plugin|
|
57
57
|
# Display
|
58
58
|
puts format(
|
59
59
|
" %-#{max_identifiers_length}s (%s)",
|
60
|
-
plugin
|
61
|
-
plugin
|
60
|
+
plugin.identifiers.join(', '),
|
61
|
+
plugin.to_s.sub(/^::/, ''),
|
62
62
|
)
|
63
63
|
end
|
64
64
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module StreamCleaners
|
4
|
-
autoload 'Abstract', 'nanoc/cli/stream_cleaners/abstract'
|
5
|
-
autoload 'ANSIColors', 'nanoc/cli/stream_cleaners/ansi_colors'
|
6
|
-
autoload 'UTF8', 'nanoc/cli/stream_cleaners/utf8'
|
7
|
-
end
|
1
|
+
# @api private
|
2
|
+
module Nanoc::CLI::StreamCleaners
|
8
3
|
end
|
4
|
+
|
5
|
+
require_relative 'stream_cleaners/abstract'
|
6
|
+
|
7
|
+
require_relative 'stream_cleaners/ansi_colors'
|
8
|
+
require_relative 'stream_cleaners/utf8'
|
data/lib/nanoc/data_sources.rb
CHANGED
@@ -6,7 +6,7 @@ module Nanoc::Deploying
|
|
6
6
|
#
|
7
7
|
# @api private
|
8
8
|
class Deployer
|
9
|
-
extend
|
9
|
+
extend DDPlugin::Plugin
|
10
10
|
|
11
11
|
# @return [String] The path to the directory that contains the files to
|
12
12
|
# upload. It should not have a trailing slash.
|
@@ -1,10 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module Deployers
|
4
|
-
autoload 'Fog', 'nanoc/deploying/deployers/fog'
|
5
|
-
autoload 'Rsync', 'nanoc/deploying/deployers/rsync'
|
6
|
-
|
7
|
-
Nanoc::Deploying::Deployer.register '::Nanoc::Deploying::Deployers::Fog', :fog
|
8
|
-
Nanoc::Deploying::Deployer.register '::Nanoc::Deploying::Deployers::Rsync', :rsync
|
9
|
-
end
|
1
|
+
# @api private
|
2
|
+
module Nanoc::Deploying::Deployers
|
10
3
|
end
|
4
|
+
|
5
|
+
require_relative 'deployers/fog'
|
6
|
+
require_relative 'deployers/git'
|
7
|
+
require_relative 'deployers/rsync'
|