nanoc 4.1.1 → 4.1.2
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/Gemfile.lock +16 -20
- data/LICENSE +1 -1
- data/NEWS.md +11 -0
- data/lib/nanoc.rb +1 -1
- data/lib/nanoc/base/compilation/compiler.rb +6 -5
- data/lib/nanoc/base/compilation/filter.rb +1 -1
- data/lib/nanoc/base/compilation/outdatedness_checker.rb +10 -2
- data/lib/nanoc/base/core_ext/array.rb +1 -1
- data/lib/nanoc/base/core_ext/hash.rb +1 -1
- data/lib/nanoc/base/entities/configuration.rb +5 -4
- data/lib/nanoc/base/entities/document.rb +1 -1
- data/lib/nanoc/base/entities/identifiable_collection.rb +2 -1
- data/lib/nanoc/base/entities/identifier.rb +1 -1
- data/lib/nanoc/base/entities/item_rep.rb +5 -5
- data/lib/nanoc/base/entities/rule_memory_action.rb +1 -1
- data/lib/nanoc/base/entities/rule_memory_actions/snapshot.rb +1 -1
- data/lib/nanoc/base/entities/site.rb +4 -3
- data/lib/nanoc/base/repos/site_loader.rb +5 -5
- data/lib/nanoc/base/services/executor.rb +6 -5
- data/lib/nanoc/base/services/item_rep_writer.rb +1 -1
- data/lib/nanoc/base/views/config_view.rb +1 -1
- data/lib/nanoc/base/views/item_rep_view.rb +1 -1
- data/lib/nanoc/base/views/item_without_reps_view.rb +1 -1
- data/lib/nanoc/base/views/mixins/document_view_mixin.rb +7 -9
- data/lib/nanoc/base/views/view.rb +14 -0
- data/lib/nanoc/cli.rb +2 -2
- data/lib/nanoc/cli/ansi_string_colorizer.rb +1 -1
- data/lib/nanoc/cli/cleaning_stream.rb +1 -1
- data/lib/nanoc/cli/command_runner.rb +7 -14
- data/lib/nanoc/cli/commands/check.rb +1 -1
- data/lib/nanoc/cli/commands/create-site.rb +5 -5
- data/lib/nanoc/cli/commands/shell.rb +1 -1
- data/lib/nanoc/cli/commands/show-plugins.rb +2 -2
- data/lib/nanoc/cli/commands/show-rules.rb +1 -1
- data/lib/nanoc/cli/commands/view.rb +1 -1
- data/lib/nanoc/cli/error_handler.rb +3 -11
- data/lib/nanoc/cli/logger.rb +2 -2
- data/lib/nanoc/data_sources/filesystem_unified.rb +6 -5
- data/lib/nanoc/extra/checking/checks/external_links.rb +7 -6
- data/lib/nanoc/extra/checking/checks/internal_links.rb +7 -6
- data/lib/nanoc/extra/checking/checks/mixed_content.rb +1 -1
- data/lib/nanoc/extra/checking/runner.rb +8 -7
- data/lib/nanoc/extra/deployer.rb +1 -1
- data/lib/nanoc/extra/deployers/fog.rb +2 -2
- data/lib/nanoc/extra/deployers/rsync.rb +1 -1
- data/lib/nanoc/extra/jruby_nokogiri_warner.rb +1 -1
- data/lib/nanoc/extra/link_collector.rb +1 -1
- data/lib/nanoc/filters/colorize_syntax.rb +3 -3
- data/lib/nanoc/filters/less.rb +1 -1
- data/lib/nanoc/filters/redcarpet.rb +6 -5
- data/lib/nanoc/filters/relativize_paths.rb +2 -2
- data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +1 -1
- data/lib/nanoc/helpers/capturing.rb +1 -1
- data/lib/nanoc/helpers/html_escape.rb +3 -2
- data/lib/nanoc/helpers/link_to.rb +7 -6
- data/lib/nanoc/rule_dsl/compiler_dsl.rb +1 -1
- data/lib/nanoc/version.rb +1 -1
- data/nanoc.gemspec +3 -3
- data/tasks/test.rake +1 -1
- data/test/cli/test_cli.rb +2 -2
- data/test/extra/checking/checks/test_mixed_content.rb +7 -7
- data/test/filters/test_colorize_syntax.rb +2 -2
- data/test/filters/test_redcarpet.rb +6 -5
- data/test/filters/test_redcloth.rb +1 -1
- data/test/filters/test_xsl.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd86fc55ceec9ba602815f93e624bd54c07d40fe
|
4
|
+
data.tar.gz: 112408b4eeb610c80a18acecd4ed9c2216cbb084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00c8461d90463a7c21225138a56f3a5ef2bd8f682f105a0319353cdea1d021a4c8b04116011ea865cf1847b4a26870e1d67f84b51fc7786e561c5ddfc124a580
|
7
|
+
data.tar.gz: 3a82634d317ddd970232ba19460e5c48d2046e41ab61925990b0e833cdc736c8b1dada7d0e8dcf183e1cfe6a2fa54933ff826d7d58f77c673fe2e59521773fcd
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nanoc (4.1.
|
4
|
+
nanoc (4.1.2)
|
5
5
|
cri (~> 2.3)
|
6
6
|
|
7
7
|
GEM
|
@@ -13,8 +13,6 @@ GEM
|
|
13
13
|
adsf (1.2.0)
|
14
14
|
rack (>= 1.0.0)
|
15
15
|
ast (2.2.0)
|
16
|
-
astrolabe (1.3.1)
|
17
|
-
parser (~> 2.2)
|
18
16
|
bluecloth (2.2.0)
|
19
17
|
builder (3.2.2)
|
20
18
|
chunky_png (1.3.5)
|
@@ -92,7 +90,7 @@ GEM
|
|
92
90
|
fog-atmos (0.1.0)
|
93
91
|
fog-core
|
94
92
|
fog-xml
|
95
|
-
fog-aws (0.
|
93
|
+
fog-aws (0.8.1)
|
96
94
|
fog-core (~> 1.27)
|
97
95
|
fog-json (~> 1.0)
|
98
96
|
fog-xml (~> 0.1)
|
@@ -129,7 +127,7 @@ GEM
|
|
129
127
|
fog-core
|
130
128
|
fog-xml
|
131
129
|
nokogiri
|
132
|
-
fog-radosgw (0.0.
|
130
|
+
fog-radosgw (0.0.5)
|
133
131
|
fog-core (>= 1.21.0)
|
134
132
|
fog-json
|
135
133
|
fog-xml (>= 0.0.1)
|
@@ -143,7 +141,7 @@ GEM
|
|
143
141
|
fog-serverlove (0.1.2)
|
144
142
|
fog-core
|
145
143
|
fog-json
|
146
|
-
fog-softlayer (1.0.
|
144
|
+
fog-softlayer (1.0.3)
|
147
145
|
fog-core
|
148
146
|
fog-json
|
149
147
|
fog-storm_on_demand (0.1.1)
|
@@ -161,7 +159,7 @@ GEM
|
|
161
159
|
fog-vsphere (0.4.0)
|
162
160
|
fog-core
|
163
161
|
rbvmomi (~> 1.8)
|
164
|
-
fog-xenserver (0.2.
|
162
|
+
fog-xenserver (0.2.3)
|
165
163
|
fog-core
|
166
164
|
fog-xml
|
167
165
|
fog-xml (0.1.2)
|
@@ -190,7 +188,7 @@ GEM
|
|
190
188
|
http-cookie (1.0.2)
|
191
189
|
domain_name (~> 0.5)
|
192
190
|
inflecto (0.0.2)
|
193
|
-
ipaddress (0.8.
|
191
|
+
ipaddress (0.8.2)
|
194
192
|
json (1.8.3)
|
195
193
|
kramdown (1.9.0)
|
196
194
|
less (2.6.0)
|
@@ -199,7 +197,7 @@ GEM
|
|
199
197
|
listen (3.0.5)
|
200
198
|
rb-fsevent (>= 0.9.3)
|
201
199
|
rb-inotify (>= 0.9)
|
202
|
-
lumberjack (1.0.
|
200
|
+
lumberjack (1.0.10)
|
203
201
|
markaby (0.8.0)
|
204
202
|
builder
|
205
203
|
maruku (0.7.2)
|
@@ -220,8 +218,8 @@ GEM
|
|
220
218
|
nenv (~> 0.1)
|
221
219
|
shellany (~> 0.0)
|
222
220
|
pandoc-ruby (1.0.0)
|
223
|
-
parser (2.
|
224
|
-
ast (
|
221
|
+
parser (2.3.0.1)
|
222
|
+
ast (~> 2.2)
|
225
223
|
posix-spawn (0.3.11)
|
226
224
|
powerpack (0.1.1)
|
227
225
|
pry (0.10.3)
|
@@ -234,7 +232,7 @@ GEM
|
|
234
232
|
rack (1.6.4)
|
235
233
|
rainbow (2.0.0)
|
236
234
|
rainpress (1.0)
|
237
|
-
rake (10.
|
235
|
+
rake (10.5.0)
|
238
236
|
rb-fsevent (0.9.7)
|
239
237
|
rb-inotify (0.9.5)
|
240
238
|
ffi (>= 0.5.0)
|
@@ -260,21 +258,19 @@ GEM
|
|
260
258
|
rspec-expectations (3.4.0)
|
261
259
|
diff-lcs (>= 1.2.0, < 2.0)
|
262
260
|
rspec-support (~> 3.4.0)
|
263
|
-
rspec-mocks (3.4.
|
261
|
+
rspec-mocks (3.4.1)
|
264
262
|
diff-lcs (>= 1.2.0, < 2.0)
|
265
263
|
rspec-support (~> 3.4.0)
|
266
264
|
rspec-support (3.4.1)
|
267
|
-
rubocop (0.
|
268
|
-
|
269
|
-
parser (>= 2.2.3.0, < 3.0)
|
265
|
+
rubocop (0.36.0)
|
266
|
+
parser (>= 2.3.0.0, < 3.0)
|
270
267
|
powerpack (~> 0.1)
|
271
268
|
rainbow (>= 1.99.1, < 3.0)
|
272
269
|
ruby-progressbar (~> 1.7)
|
273
|
-
tins (<= 1.6.0)
|
274
270
|
ruby-progressbar (1.7.5)
|
275
271
|
rubypants (0.2.0)
|
276
272
|
safe_yaml (1.0.4)
|
277
|
-
sass (3.4.
|
273
|
+
sass (3.4.21)
|
278
274
|
shellany (0.0.1)
|
279
275
|
simplecov (0.11.1)
|
280
276
|
docile (~> 1.1.0)
|
@@ -292,7 +288,7 @@ GEM
|
|
292
288
|
libv8 (~> 3.16.14.0)
|
293
289
|
ref
|
294
290
|
thor (0.19.1)
|
295
|
-
tilt (2.0.
|
291
|
+
tilt (2.0.2)
|
296
292
|
tins (1.6.0)
|
297
293
|
trollop (2.1.2)
|
298
294
|
typogruby (1.0.18)
|
@@ -307,7 +303,7 @@ GEM
|
|
307
303
|
w3c_validators (1.2)
|
308
304
|
json
|
309
305
|
nokogiri
|
310
|
-
webmock (1.22.
|
306
|
+
webmock (1.22.6)
|
311
307
|
addressable (>= 2.3.6)
|
312
308
|
crack (>= 0.3.2)
|
313
309
|
hashdiff
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2007-
|
1
|
+
Copyright (c) 2007-2016 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,16 @@
|
|
1
1
|
# Nanoc news
|
2
2
|
|
3
|
+
## 4.1.2 (2016-01-16)
|
4
|
+
|
5
|
+
Fixes:
|
6
|
+
|
7
|
+
* Made @-variables (e.g. `@items`) report their frozenness properly, so that optimisations based on frozenness work once again (#795, #797)
|
8
|
+
* Removed environment from `crash.log` to prevent leaking sensitive information (#798, #800)
|
9
|
+
|
10
|
+
Enhancements:
|
11
|
+
|
12
|
+
* Removed redundant checksum calculation (#789) [Ruben Verborgh]
|
13
|
+
|
3
14
|
## 4.1.1 (2015-12-30)
|
4
15
|
|
5
16
|
Fixes:
|
data/lib/nanoc.rb
CHANGED
@@ -7,7 +7,7 @@ module Nanoc
|
|
7
7
|
gem_info = defined?(Gem) ? "with RubyGems #{Gem::VERSION}" : 'without RubyGems'
|
8
8
|
engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
|
9
9
|
res = ''
|
10
|
-
res << "Nanoc #{Nanoc::VERSION} © 2007-
|
10
|
+
res << "Nanoc #{Nanoc::VERSION} © 2007-2016 Denis Defreyne.\n"
|
11
11
|
res << "Running #{engine} #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) on #{RUBY_PLATFORM} #{gem_info}.\n"
|
12
12
|
res
|
13
13
|
end
|
@@ -148,11 +148,12 @@ module Nanoc::Int
|
|
148
148
|
#
|
149
149
|
# @api private
|
150
150
|
def assigns_for(rep)
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
151
|
+
content_or_filename_assigns =
|
152
|
+
if rep.binary?
|
153
|
+
{ filename: rep.snapshot_contents[:last].filename }
|
154
|
+
else
|
155
|
+
{ content: rep.snapshot_contents[:last].string }
|
156
|
+
end
|
156
157
|
|
157
158
|
view_context = create_view_context
|
158
159
|
|
@@ -25,7 +25,7 @@ module Nanoc
|
|
25
25
|
# @abstract Subclass and override {#run} to implement a custom filter.
|
26
26
|
class Filter < Nanoc::Int::Context
|
27
27
|
# @api private
|
28
|
-
TMP_BINARY_ITEMS_DIR = 'binary_items'
|
28
|
+
TMP_BINARY_ITEMS_DIR = 'binary_items'.freeze
|
29
29
|
|
30
30
|
# A hash containing variables that will be made available during
|
31
31
|
# filtering.
|
@@ -172,12 +172,20 @@ module Nanoc::Int
|
|
172
172
|
end
|
173
173
|
memoize :rule_memory_differs_for
|
174
174
|
|
175
|
+
# @param obj The object to create a checksum for
|
176
|
+
#
|
177
|
+
# @return [String] The digest
|
178
|
+
def calc_checksum(obj)
|
179
|
+
Nanoc::Int::Checksummer.calc(obj)
|
180
|
+
end
|
181
|
+
memoize :calc_checksum
|
182
|
+
|
175
183
|
# @param obj
|
176
184
|
#
|
177
185
|
# @return [Boolean] false if either the new or the old checksum for the
|
178
186
|
# given object is not available, true if both checksums are available
|
179
187
|
def checksums_available?(obj)
|
180
|
-
checksum_store[obj] &&
|
188
|
+
checksum_store[obj] && calc_checksum(obj)
|
181
189
|
end
|
182
190
|
memoize :checksums_available?
|
183
191
|
|
@@ -186,7 +194,7 @@ module Nanoc::Int
|
|
186
194
|
# @return [Boolean] false if the old and new checksums for the given
|
187
195
|
# object differ, true if they are identical
|
188
196
|
def checksums_identical?(obj)
|
189
|
-
checksum_store[obj] ==
|
197
|
+
checksum_store[obj] == calc_checksum(obj)
|
190
198
|
end
|
191
199
|
memoize :checksums_identical?
|
192
200
|
|
@@ -3,7 +3,7 @@ module Nanoc::Int
|
|
3
3
|
#
|
4
4
|
# @api private
|
5
5
|
class Configuration
|
6
|
-
NONE = Object.new
|
6
|
+
NONE = Object.new.freeze
|
7
7
|
|
8
8
|
# The default configuration for a data source. A data source's
|
9
9
|
# configuration overrides these options.
|
@@ -13,7 +13,7 @@ module Nanoc::Int
|
|
13
13
|
layouts_root: '/',
|
14
14
|
config: {},
|
15
15
|
identifier_type: 'full',
|
16
|
-
}
|
16
|
+
}.freeze
|
17
17
|
|
18
18
|
# The default configuration for a site. A site's configuration overrides
|
19
19
|
# these options: when a {Nanoc::Int::Site} is created with a configuration
|
@@ -29,7 +29,7 @@ module Nanoc::Int
|
|
29
29
|
enable_output_diff: false,
|
30
30
|
prune: { auto_prune: false, exclude: ['.git', '.hg', '.svn', 'CVS'] },
|
31
31
|
string_pattern_type: 'glob',
|
32
|
-
}
|
32
|
+
}.freeze
|
33
33
|
|
34
34
|
# Creates a new configuration with the given hash.
|
35
35
|
#
|
@@ -88,7 +88,8 @@ module Nanoc::Int
|
|
88
88
|
self
|
89
89
|
end
|
90
90
|
|
91
|
-
def
|
91
|
+
def freeze
|
92
|
+
super
|
92
93
|
@wrapped.__nanoc_freeze_recursively
|
93
94
|
end
|
94
95
|
|
@@ -18,6 +18,7 @@ module Nanoc::Int
|
|
18
18
|
|
19
19
|
def freeze
|
20
20
|
@objects.freeze
|
21
|
+
@objects.each(&:freeze)
|
21
22
|
build_mapping
|
22
23
|
super
|
23
24
|
end
|
@@ -50,7 +51,7 @@ module Nanoc::Int
|
|
50
51
|
protected
|
51
52
|
|
52
53
|
def object_with_identifier(identifier)
|
53
|
-
if
|
54
|
+
if frozen?
|
54
55
|
@mapping[identifier.to_s]
|
55
56
|
else
|
56
57
|
@objects.find { |i| i.identifier == identifier }
|
@@ -6,7 +6,7 @@ module Nanoc::Int
|
|
6
6
|
|
7
7
|
# @return [Boolean]
|
8
8
|
attr_accessor :compiled
|
9
|
-
|
9
|
+
alias compiled? compiled
|
10
10
|
|
11
11
|
# @return [Hash<Symbol,String>]
|
12
12
|
attr_accessor :raw_paths
|
@@ -25,7 +25,7 @@ module Nanoc::Int
|
|
25
25
|
|
26
26
|
# @return [Boolean]
|
27
27
|
attr_accessor :modified
|
28
|
-
|
28
|
+
alias modified? modified
|
29
29
|
|
30
30
|
# @param [Nanoc::Int::Item] item
|
31
31
|
#
|
@@ -82,7 +82,7 @@ module Nanoc::Int
|
|
82
82
|
when :pre
|
83
83
|
snapshot_def.nil? || !snapshot_def.final?
|
84
84
|
end
|
85
|
-
is_usable_snapshot = @snapshot_contents[snapshot_name] && (
|
85
|
+
is_usable_snapshot = @snapshot_contents[snapshot_name] && (compiled? || !is_still_moving)
|
86
86
|
unless is_usable_snapshot
|
87
87
|
raise Nanoc::Int::Errors::UnmetDependency.new(self)
|
88
88
|
end
|
@@ -99,7 +99,7 @@ module Nanoc::Int
|
|
99
99
|
def snapshot?(snapshot_name)
|
100
100
|
!@snapshot_contents[snapshot_name].nil?
|
101
101
|
end
|
102
|
-
|
102
|
+
alias has_snapshot? snapshot?
|
103
103
|
|
104
104
|
# Returns the item rep’s raw path. It includes the path to the output
|
105
105
|
# directory and the full filename.
|
@@ -145,7 +145,7 @@ module Nanoc::Int
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def inspect
|
148
|
-
"<#{self.class} name=\"#{name}\" binary=#{
|
148
|
+
"<#{self.class} name=\"#{name}\" binary=#{binary?} raw_path=\"#{raw_path}\" item.identifier=\"#{item.identifier}\">"
|
149
149
|
end
|
150
150
|
|
151
151
|
private
|
@@ -41,9 +41,10 @@ module Nanoc::Int
|
|
41
41
|
#
|
42
42
|
# @return [void]
|
43
43
|
def freeze
|
44
|
-
config.
|
45
|
-
items.
|
46
|
-
layouts.
|
44
|
+
config.freeze
|
45
|
+
items.freeze
|
46
|
+
layouts.freeze
|
47
|
+
code_snippets.__nanoc_freeze_recursively
|
47
48
|
end
|
48
49
|
|
49
50
|
def ensure_identifier_uniqueness(objects, type)
|
@@ -12,6 +12,11 @@ module Nanoc::Int
|
|
12
12
|
site_from_config(Nanoc::Int::ConfigLoader.new.new_from_cwd)
|
13
13
|
end
|
14
14
|
|
15
|
+
# @return [Boolean]
|
16
|
+
def self.cwd_is_nanoc_site?
|
17
|
+
Nanoc::Int::ConfigLoader.cwd_is_nanoc_site?
|
18
|
+
end
|
19
|
+
|
15
20
|
private
|
16
21
|
|
17
22
|
def site_from_config(config)
|
@@ -42,11 +47,6 @@ module Nanoc::Int
|
|
42
47
|
)
|
43
48
|
end
|
44
49
|
|
45
|
-
# @return [Boolean]
|
46
|
-
def self.cwd_is_nanoc_site?
|
47
|
-
Nanoc::Int::ConfigLoader.cwd_is_nanoc_site?
|
48
|
-
end
|
49
|
-
|
50
50
|
def with_data_sources(config, &_block)
|
51
51
|
data_sources = create_data_sources(config)
|
52
52
|
|
@@ -34,11 +34,12 @@ module Nanoc
|
|
34
34
|
last = rep.snapshot_contents[:last]
|
35
35
|
source = rep.binary? ? last.filename : last.string
|
36
36
|
result = filter.setup_and_run(source, filter_args)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
rep.snapshot_contents[:last] =
|
38
|
+
if klass.to_binary?
|
39
|
+
Nanoc::Int::BinaryContent.new(filter.output_filename).tap(&:freeze)
|
40
|
+
else
|
41
|
+
Nanoc::Int::TextualContent.new(result).tap(&:freeze)
|
42
|
+
end
|
42
43
|
|
43
44
|
# Check whether file was written
|
44
45
|
if klass.to_binary? && !File.file?(filter.output_filename)
|