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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 780927fbc58c76e3906df40019201441f6675433afbd34222ae79e7daeb0f4f0
4
- data.tar.gz: 0c62c92d07ef676a555a8cf7c680226048788ae6cab56bcdd82ab2227d091794
3
+ metadata.gz: bfb2cbc0d64311d9e3b14715a1f05d0c45d0dc49020b929fb9d528429393a4b6
4
+ data.tar.gz: 88014c7a2d2f9f48e1c616f55a10401679e1bb7f069f324ccdd13d1560f67975
5
5
  SHA512:
6
- metadata.gz: 11011bf293454e1c66b644ed12864e1a8c6ab72a18548e2f770048097918cc08c5f48410968cec0bcaff85cd14f052ff4c78fc2040f19fe75232e283f949fc6d
7
- data.tar.gz: d6fbdaca866cf1b79b4bac978a1c09c3dbd36ad2b6a1d4d90e832f04b3e5133e7496e1e247bcafaff1b53baca9cf0cfd354eee69504757163115ed05c7910fd5
6
+ metadata.gz: 70430b8f328bbcc2b537bd02bce5b094d9060545e5e1bb70dbc34e575a01812b6845f9624ea0dbce6af0e2c7739dbe4174572c8283df0e595c7d792bdd26ee54
7
+ data.tar.gz: 92d75e7db1a2bbacc5364c449a7ef1499a88ac35f9c28fc07d58be43a5fc932e999447a4897ff0d96f6b577a3ec6c1260979e7eb83f6fd97c36b04e25c590694
data/NEWS.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.10.2 (2018-10-21)
4
+
5
+ Fixes:
6
+
7
+ * Fixed an issue where changing a layout rule’s parameters would not recompile items that use the layout for this layout rule (#1372, #1373)
8
+
3
9
  ## 4.10.1 (2018-10-16)
4
10
 
5
11
  Fixes:
@@ -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
- unless seq_old.eql?(seq_new)
11
- Nanoc::Int::OutdatednessReasons::RulesModified
12
- end
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Nanoc
4
4
  # The current Nanoc version.
5
- VERSION = '4.10.1'
5
+ VERSION = '4.10.2'
6
6
  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.10.1
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-16 00:00:00.000000000 Z
11
+ date: 2018-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable