nanoc 4.10.1 → 4.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +6 -0
- data/lib/nanoc/base/services/outdatedness_rules/rules_modified.rb +29 -3
- data/lib/nanoc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfb2cbc0d64311d9e3b14715a1f05d0c45d0dc49020b929fb9d528429393a4b6
|
4
|
+
data.tar.gz: 88014c7a2d2f9f48e1c616f55a10401679e1bb7f069f324ccdd13d1560f67975
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70430b8f328bbcc2b537bd02bce5b094d9060545e5e1bb70dbc34e575a01812b6845f9624ea0dbce6af0e2c7739dbe4174572c8283df0e595c7d792bdd26ee54
|
7
|
+
data.tar.gz: 92d75e7db1a2bbacc5364c449a7ef1499a88ac35f9c28fc07d58be43a5fc932e999447a4897ff0d96f6b577a3ec6c1260979e7eb83f6fd97c36b04e25c590694
|
data/NEWS.md
CHANGED
@@ -5,11 +5,37 @@ module Nanoc::Int::OutdatednessRules
|
|
5
5
|
affects_props :compiled_content, :path
|
6
6
|
|
7
7
|
def apply(obj, outdatedness_checker)
|
8
|
+
# Check rules of obj itself
|
9
|
+
if rules_modified?(obj, outdatedness_checker)
|
10
|
+
return Nanoc::Int::OutdatednessReasons::RulesModified
|
11
|
+
end
|
12
|
+
|
13
|
+
# Check rules of layouts used by obj
|
14
|
+
layouts = layouts_touched_by(obj, outdatedness_checker)
|
15
|
+
if layouts.any? { |layout| rules_modified?(layout, outdatedness_checker) }
|
16
|
+
return Nanoc::Int::OutdatednessReasons::RulesModified
|
17
|
+
end
|
18
|
+
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def rules_modified?(obj, outdatedness_checker)
|
8
25
|
seq_old = outdatedness_checker.action_sequence_store[obj]
|
9
26
|
seq_new = outdatedness_checker.action_sequence_for(obj).serialize
|
10
|
-
|
11
|
-
|
12
|
-
|
27
|
+
|
28
|
+
!seq_old.eql?(seq_new)
|
29
|
+
end
|
30
|
+
|
31
|
+
def layouts_touched_by(obj, outdatedness_checker)
|
32
|
+
actions = outdatedness_checker.action_sequence_store[obj]
|
33
|
+
layout_actions = actions.select { |a| a.first == :layout }
|
34
|
+
|
35
|
+
layout_actions.map do |layout_action|
|
36
|
+
layout_pattern = layout_action[1]
|
37
|
+
outdatedness_checker.site.layouts[layout_pattern]
|
38
|
+
end.compact
|
13
39
|
end
|
14
40
|
end
|
15
41
|
end
|
data/lib/nanoc/version.rb
CHANGED
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.10.
|
4
|
+
version: 4.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|