nanoc 4.3.0 → 4.3.1

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
  SHA1:
3
- metadata.gz: 42d007123a8daf12e6e2a49eec0faedcde6a9bfe
4
- data.tar.gz: 6350ddff74b8837e0338e319bbb495dea5c8969b
3
+ metadata.gz: 2c17ae1096ea2748ca3eb851435e6a5f26829e1e
4
+ data.tar.gz: 4eae8aec9f2fc44b0ef889074d107d8ab17cc261
5
5
  SHA512:
6
- metadata.gz: d67dfeb6608496945aa0cf341199b39fd137d7c12f790b1ae8eeea6ec28aa6491daf4f20cb566c5d61a50a78e870fb510a4ad8642820a902708d46e7b8b67696
7
- data.tar.gz: 64a00a9a64a0b9d4b1e2e6a0953fae371b3a72e95b510b5264e9033cbda85ff877333220ef67d18c3af0dba822881251c1a8e6ade5da50dbb1f66ee4f8d18830
6
+ metadata.gz: 616d975f7cfdce6e6c5249e1d3366a0c55fa5ac49025410de95c7283869633767e1413739564ead853ca099634550c436dab249e02a7e96114b9cccb06bbfcf0
7
+ data.tar.gz: 81b97ba18790fc3755ffcc36d2ecc91c9fd0ce6f99c1f5fe26936db42b878a73021d1c8572b68297030bd3e2670bfb44b9b77474e4e4891f61e5adcd58bd1e18
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nanoc (4.3.0)
4
+ nanoc (4.3.1)
5
5
  cri (~> 2.3)
6
6
  hamster (~> 3.0)
7
7
  ref (~> 2.0)
@@ -52,7 +52,7 @@ GEM
52
52
  diff-lcs (1.2.5)
53
53
  docile (1.1.5)
54
54
  erubis (2.7.0)
55
- excon (0.51.0)
55
+ excon (0.52.0)
56
56
  execjs (2.7.0)
57
57
  ffi (1.9.14)
58
58
  fission (0.5.0)
@@ -184,8 +184,8 @@ GEM
184
184
  fog-core
185
185
  nokogiri (~> 1.5, >= 1.5.11)
186
186
  formatador (0.2.5)
187
- fuubar (2.1.1)
188
- rspec (~> 3.0)
187
+ fuubar (2.2.0)
188
+ rspec-core (~> 3.0)
189
189
  ruby-progressbar (~> 1.4)
190
190
  guard (2.14.0)
191
191
  formatador (>= 0.2.4)
@@ -261,10 +261,11 @@ GEM
261
261
  rb-fsevent (0.9.7)
262
262
  rb-inotify (0.9.7)
263
263
  ffi (>= 0.5.0)
264
- rbvmomi (1.8.2)
265
- builder
266
- nokogiri (>= 1.4.1)
267
- trollop
264
+ rbvmomi (1.9.1)
265
+ builder (~> 3.2)
266
+ json (>= 1.8)
267
+ nokogiri (~> 1.5)
268
+ trollop (~> 2.1)
268
269
  rdiscount (2.2.0.1)
269
270
  rdoc (4.2.1)
270
271
  redcarpet (3.3.4)
data/NEWS.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.3.1 (???)
4
+
5
+ Fixes:
6
+
7
+ * Fixed “outdatedness of LayoutView” error (#927, #931)
8
+ * Fixed bug causing some checks not to appear in `nanoc check --list` (#928, #930)
9
+ * Fixed `@item`, … not being accessible in filters defined with `Nanoc::Filter.define` (#932, #934)
10
+
3
11
  ## 4.3 (2016-08-21)
4
12
 
5
13
  Features:
@@ -128,7 +136,7 @@ Enhancements:
128
136
 
129
137
  * Made `#breadcrumbs_trail` explicitly fail when using full identifiers (#781, #783)
130
138
 
131
- ## 4.1.0 (2015-12-18)
139
+ ## 4.1 (2015-12-18)
132
140
 
133
141
  Fixes:
134
142
 
@@ -212,7 +220,7 @@ Enhancements:
212
220
 
213
221
  * Lowered minimum required Ruby version from 2.2 to 2.1 (#732)
214
222
 
215
- ## 4.0.0 (2015-11-07)
223
+ ## 4.0 (2015-11-07)
216
224
 
217
225
  Enhancements:
218
226
 
@@ -361,7 +369,7 @@ This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guid
361
369
 
362
370
  This release provides no new features, but streamlines the API and functionality, in order to easen future development, both for features and for optimisations.
363
371
 
364
- ## 3.8.0 (2015-05-04)
372
+ ## 3.8 (2015-05-04)
365
373
 
366
374
  Features:
367
375
 
@@ -435,7 +443,7 @@ Fixes:
435
443
 
436
444
  * Fixed bug which would cause nanoc to crash if no Gemfile is present (#447, #449)
437
445
 
438
- ## 3.7.0 (2014-06-08)
446
+ ## 3.7 (2014-06-08)
439
447
 
440
448
  New features:
441
449
 
@@ -12,11 +12,14 @@ module Nanoc::Int
12
12
  end
13
13
  end
14
14
 
15
+ include Nanoc::Int::ContractsSupport
16
+
15
17
  def initialize(dependency_store)
16
18
  @dependency_store = dependency_store
17
19
  @stack = []
18
20
  end
19
21
 
22
+ contract C::Or[Nanoc::Int::Item, Nanoc::Int::Layout] => C::Any
20
23
  def enter(obj)
21
24
  unless @stack.empty?
22
25
  Nanoc::Int::NotificationCenter.post(:dependency_created, @stack.last, obj)
@@ -26,10 +29,12 @@ module Nanoc::Int
26
29
  @stack.push(obj)
27
30
  end
28
31
 
32
+ contract C::Or[Nanoc::Int::Item, Nanoc::Int::Layout] => C::Any
29
33
  def exit(_obj)
30
34
  @stack.pop
31
35
  end
32
36
 
37
+ contract C::Or[Nanoc::Int::Item, Nanoc::Int::Layout] => C::Any
33
38
  def bounce(obj)
34
39
  enter(obj)
35
40
  exit(obj)
@@ -38,10 +38,10 @@ module Nanoc
38
38
  extend Nanoc::Int::PluginRegistry::PluginMethods
39
39
 
40
40
  class << self
41
- def define(ident)
41
+ def define(ident, &block)
42
42
  filter_class = Class.new(::Nanoc::Filter) { identifier(ident) }
43
43
  filter_class.send(:define_method, :run) do |content, params|
44
- yield(content, params)
44
+ instance_exec(content, params, &block)
45
45
  end
46
46
  end
47
47
 
@@ -24,7 +24,8 @@ module Nanoc::Int
24
24
  # @return [Array<Symbol>] The identifiers for this plugin
25
25
  def identifiers(*identifiers)
26
26
  if identifiers.empty?
27
- Nanoc::Int::PluginRegistry.instance.identifiers_of(superclass, self)
27
+ registry = Nanoc::Int::PluginRegistry.instance
28
+ registry.identifiers_of(registry.root_class_of(self), self)
28
29
  else
29
30
  register(self, *identifiers)
30
31
  end
@@ -45,7 +46,8 @@ module Nanoc::Int
45
46
  if identifier
46
47
  identifiers(identifier)
47
48
  else
48
- Nanoc::Int::PluginRegistry.instance.identifiers_of(superclass, self).first
49
+ registry = Nanoc::Int::PluginRegistry.instance
50
+ registry.identifiers_of(registry.root_class_of(self), self).first
49
51
  end
50
52
  end
51
53
 
@@ -59,13 +61,9 @@ module Nanoc::Int
59
61
  #
60
62
  # @return [void]
61
63
  def register(class_or_name, *identifiers)
62
- # Find plugin class
63
- klass = self
64
- klass = klass.superclass while klass.superclass.respond_to?(:register)
65
-
66
- # Register
67
64
  registry = Nanoc::Int::PluginRegistry.instance
68
- registry.register(klass, class_or_name, *identifiers)
65
+ root = registry.root_class_of(self)
66
+ registry.register(root, class_or_name, *identifiers)
69
67
  end
70
68
 
71
69
  # @return [Hash<Symbol, Class>] All plugins of this type, with keys
@@ -159,6 +157,17 @@ module Nanoc::Int
159
157
  res
160
158
  end
161
159
 
160
+ # @param [Class] klass
161
+ #
162
+ # @return [Class]
163
+ #
164
+ # @api private
165
+ def root_class_of(subclass)
166
+ root_class = subclass
167
+ root_class = root_class.superclass while root_class.superclass.respond_to?(:register)
168
+ root_class
169
+ end
170
+
162
171
  # Returns a list of all plugins. The returned list of plugins is an array
163
172
  # with array elements in the following format:
164
173
  #
@@ -13,9 +13,10 @@ module Nanoc::Helpers
13
13
  # @return [String, nil]
14
14
  def render(identifier, other_assigns = {}, &block)
15
15
  # Find layout
16
- layout = @layouts[identifier]
17
- layout ||= @layouts[identifier.__nanoc_cleaned_identifier]
18
- raise Nanoc::Int::Errors::UnknownLayout.new(identifier) if layout.nil?
16
+ layout_view = @layouts[identifier]
17
+ layout_view ||= @layouts[identifier.__nanoc_cleaned_identifier]
18
+ raise Nanoc::Int::Errors::UnknownLayout.new(identifier) if layout_view.nil?
19
+ layout = layout_view.unwrap
19
20
 
20
21
  # Visit
21
22
  dependency_tracker = @config._context.dependency_tracker
@@ -30,7 +31,7 @@ module Nanoc::Helpers
30
31
  item: @item,
31
32
  item_rep: @item_rep,
32
33
  items: @items,
33
- layout: layout,
34
+ layout: layout_view,
34
35
  layouts: @layouts,
35
36
  config: @config,
36
37
  }.merge(other_assigns)
@@ -51,7 +52,7 @@ module Nanoc::Helpers
51
52
  Nanoc::Int::NotificationCenter.post(:processing_started, layout)
52
53
 
53
54
  # Layout
54
- content = layout.unwrap.content
55
+ content = layout.content
55
56
  arg = content.binary? ? content.filename : content.string
56
57
  result = filter.setup_and_run(arg, filter_args)
57
58
 
data/lib/nanoc/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Nanoc
2
2
  # The current Nanoc version.
3
- VERSION = '4.3.0'.freeze
3
+ VERSION = '4.3.1'.freeze
4
4
  end
@@ -87,7 +87,10 @@ class Nanoc::Int::DependencyTrackerTest < Nanoc::TestCase
87
87
  end
88
88
 
89
89
  def test_enter_and_exit
90
- items = [mock, mock]
90
+ items = [
91
+ Nanoc::Int::Item.new('Foo', {}, '/foo.md'),
92
+ Nanoc::Int::Item.new('Bar', {}, '/bar.md'),
93
+ ]
91
94
 
92
95
  store = Nanoc::Int::DependencyStore.new(items)
93
96
  tracker = Nanoc::Int::DependencyTracker.new(store)
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.3.0
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-21 00:00:00.000000000 Z
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri