nanoc 4.8.4 → 4.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/NEWS.md +7 -0
- data/lib/nanoc/checking/runner.rb +5 -4
- data/lib/nanoc/cli/commands/compile_listeners/file_action_printer.rb +6 -0
- data/lib/nanoc/cli/logger.rb +3 -2
- data/lib/nanoc/version.rb +1 -1
- data/spec/nanoc/checking/runner_spec.rb +26 -0
- data/spec/nanoc/cli/commands/compile/file_action_printer_spec.rb +36 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cafd3c0aac9622344c7d94be09957d8b616426a2
|
4
|
+
data.tar.gz: 1f239f61b0329e35bd5cb56bce1f6fe762898926
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae453f24b6d9a652a8a9c9499bc121ac3bc056f0947713b83e43e62ea413e32ae1415a0897f3ccf982c38c9deaf77a15999918f0e7337ecdfa48150fcb77338f
|
7
|
+
data.tar.gz: b1ab390568886eaf34ce69704be75396f34f32859fa50fa073dac06d46ef2ca2171d4dd31f6acc2e3d6770e491ede4e4a62ecfafcabeb4ec10cfb0e40afe9554
|
data/NEWS.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Nanoc news
|
2
2
|
|
3
|
+
## 4.8.5 (2017-09-07)
|
4
|
+
|
5
|
+
Enhancements:
|
6
|
+
|
7
|
+
* Made `nanoc check` accept hyphenated check names (e.g. `internal-links`, in addition to `internal_links`).
|
8
|
+
* `compile --verbose` now prints “cached” rather than “identical” when cached compiled content is used. (#1214)
|
9
|
+
|
3
10
|
## 4.8.4 (2017-09-03)
|
4
11
|
|
5
12
|
Fixes:
|
@@ -98,10 +98,11 @@ module Nanoc::Checking
|
|
98
98
|
Nanoc::Checking::Check.all
|
99
99
|
end
|
100
100
|
|
101
|
-
def check_classes_named(
|
102
|
-
|
103
|
-
|
104
|
-
|
101
|
+
def check_classes_named(names)
|
102
|
+
names.map do |name|
|
103
|
+
name = name.to_s.tr('-', '_').to_sym
|
104
|
+
klass = Nanoc::Checking::Check.named(name)
|
105
|
+
raise Nanoc::Int::Errors::GenericTrivial, "Unknown check: #{name}" if klass.nil?
|
105
106
|
klass
|
106
107
|
end
|
107
108
|
end
|
@@ -20,6 +20,11 @@ module Nanoc::CLI::Commands::CompileListeners
|
|
20
20
|
@acc_durations[rep] += Time.now - @start_times[rep]
|
21
21
|
end
|
22
22
|
|
23
|
+
cached_reps = Set.new
|
24
|
+
Nanoc::Int::NotificationCenter.on(:cached_content_used, self) do |rep|
|
25
|
+
cached_reps << rep
|
26
|
+
end
|
27
|
+
|
23
28
|
Nanoc::Int::NotificationCenter.on(:rep_written, self) do |rep, _binary, path, is_created, is_modified|
|
24
29
|
@acc_durations[rep] += Time.now - @start_times[rep]
|
25
30
|
duration = @acc_durations[rep]
|
@@ -27,6 +32,7 @@ module Nanoc::CLI::Commands::CompileListeners
|
|
27
32
|
action =
|
28
33
|
if is_created then :create
|
29
34
|
elsif is_modified then :update
|
35
|
+
elsif cached_reps.include?(rep) then :cached
|
30
36
|
else :identical
|
31
37
|
end
|
32
38
|
level =
|
data/lib/nanoc/cli/logger.rb
CHANGED
@@ -8,12 +8,13 @@ module Nanoc::CLI
|
|
8
8
|
#
|
9
9
|
# @api private
|
10
10
|
class Logger
|
11
|
-
# Maps actions (`:create`, `:update`, `:identical`, `:skip` and `:delete`)
|
11
|
+
# Maps actions (`:create`, `:update`, `:identical`, `:cached`, `:skip` and `:delete`)
|
12
12
|
# onto their ANSI color codes.
|
13
13
|
ACTION_COLORS = {
|
14
14
|
create: "\e[32m", # green
|
15
15
|
update: "\e[33m", # yellow
|
16
16
|
identical: '', # (nothing)
|
17
|
+
cached: '', # (nothing)
|
17
18
|
skip: '', # (nothing)
|
18
19
|
delete: "\e[31m" # red
|
19
20
|
}.freeze
|
@@ -35,7 +36,7 @@ module Nanoc::CLI
|
|
35
36
|
#
|
36
37
|
# @param [:high, :low] level The importance of this action
|
37
38
|
#
|
38
|
-
# @param [:create, :update, :identical, :skip, :delete] action The kind of file action
|
39
|
+
# @param [:create, :update, :identical, :cached, :skip, :delete] action The kind of file action
|
39
40
|
#
|
40
41
|
# @param [String] name The name of the file the action was performed on
|
41
42
|
#
|
data/lib/nanoc/version.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe Nanoc::Checking::Runner do
|
4
|
+
subject(:runner) { described_class.new(site) }
|
5
|
+
|
6
|
+
let(:site) { double(:site) }
|
7
|
+
|
8
|
+
describe '#check_classes_named' do
|
9
|
+
subject { runner.check_classes_named(names) }
|
10
|
+
|
11
|
+
context 'given one full name' do
|
12
|
+
let(:names) { %w[internal_links] }
|
13
|
+
it { is_expected.to eq([Nanoc::Checking::Checks::InternalLinks]) }
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'given one full name with dash instead of underscore' do
|
17
|
+
let(:names) { %w[internal-links] }
|
18
|
+
it { is_expected.to eq([Nanoc::Checking::Checks::InternalLinks]) }
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'given one abbreviated name' do
|
22
|
+
let(:names) { %w[ilinks] }
|
23
|
+
it { is_expected.to eq([Nanoc::Checking::Checks::InternalLinks]) }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -60,19 +60,53 @@ describe Nanoc::CLI::Commands::CompileListeners::FileActionPrinter, stdio: true
|
|
60
60
|
before { listener.start }
|
61
61
|
before { Nanoc::CLI::Logger.instance.level = :high }
|
62
62
|
|
63
|
-
it '
|
63
|
+
it 'does not print skipped (uncompiled) reps' do
|
64
64
|
expect { listener.stop }
|
65
65
|
.not_to output(/skip/).to_stdout
|
66
66
|
end
|
67
|
+
|
68
|
+
it 'prints nothing' do
|
69
|
+
Nanoc::Int::NotificationCenter.post(:compilation_started, rep)
|
70
|
+
Timecop.freeze(Time.local(2008, 9, 1, 10, 5, 1))
|
71
|
+
|
72
|
+
expect { Nanoc::Int::NotificationCenter.post(:rep_written, rep, false, '/foo.html', false, false) }
|
73
|
+
.not_to output(/identical/).to_stdout
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'prints nothing' do
|
77
|
+
Nanoc::Int::NotificationCenter.post(:compilation_started, rep)
|
78
|
+
Nanoc::Int::NotificationCenter.post(:cached_content_used, rep)
|
79
|
+
Timecop.freeze(Time.local(2008, 9, 1, 10, 5, 1))
|
80
|
+
|
81
|
+
expect { Nanoc::Int::NotificationCenter.post(:rep_written, rep, false, '/foo.html', false, false) }
|
82
|
+
.not_to output(/cached/).to_stdout
|
83
|
+
end
|
67
84
|
end
|
68
85
|
|
69
86
|
context 'log level = low' do
|
70
87
|
before { listener.start }
|
71
88
|
before { Nanoc::CLI::Logger.instance.level = :low }
|
72
89
|
|
73
|
-
it 'prints
|
90
|
+
it 'prints skipped (uncompiled) reps' do
|
74
91
|
expect { listener.stop }
|
75
92
|
.to output(/skip.*\/hi\.html/).to_stdout
|
76
93
|
end
|
94
|
+
|
95
|
+
it 'prints “identical” if not cached' do
|
96
|
+
Nanoc::Int::NotificationCenter.post(:compilation_started, rep)
|
97
|
+
Timecop.freeze(Time.local(2008, 9, 1, 10, 5, 1))
|
98
|
+
|
99
|
+
expect { Nanoc::Int::NotificationCenter.post(:rep_written, rep, false, '/foo.html', false, false) }
|
100
|
+
.to output(/identical/).to_stdout
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'prints “cached” if cached' do
|
104
|
+
Nanoc::Int::NotificationCenter.post(:compilation_started, rep)
|
105
|
+
Nanoc::Int::NotificationCenter.post(:cached_content_used, rep)
|
106
|
+
Timecop.freeze(Time.local(2008, 9, 1, 10, 5, 1))
|
107
|
+
|
108
|
+
expect { Nanoc::Int::NotificationCenter.post(:rep_written, rep, false, '/foo.html', false, false) }
|
109
|
+
.to output(/cached/).to_stdout
|
110
|
+
end
|
77
111
|
end
|
78
112
|
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: 4.8.
|
4
|
+
version: 4.8.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: 2017-09-
|
11
|
+
date: 2017-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -453,6 +453,7 @@ files:
|
|
453
453
|
- spec/nanoc/base/views/post_compile_item_rep_collection_view_spec.rb
|
454
454
|
- spec/nanoc/base/views/post_compile_item_rep_view_spec.rb
|
455
455
|
- spec/nanoc/base/views/post_compile_item_view_spec.rb
|
456
|
+
- spec/nanoc/checking/runner_spec.rb
|
456
457
|
- spec/nanoc/cli/command_runner_spec.rb
|
457
458
|
- spec/nanoc/cli/commands/compile/diff_generator_spec.rb
|
458
459
|
- spec/nanoc/cli/commands/compile/file_action_printer_spec.rb
|