nanoc 4.11.3 → 4.11.4

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: 7e5efc6d26dd09a85227e75e05633aa88a5af1fad6a141831e7958d22777c457
4
- data.tar.gz: 53db1fb790e25df48988c9aa3c4ce08806bfd6e57217ffb44c6d35cabf6626d5
3
+ metadata.gz: f85541e423de2233c7f25fe59e834db564e8bc0e5930c1ba019dceac4a8e031b
4
+ data.tar.gz: bdb60e52d7503d860ea5e3b8056d267d7e0c13611e210988f4bc604a227c7215
5
5
  SHA512:
6
- metadata.gz: 84eada303df7cef2126c6cf0c655e4bb1053ea50162827bf14f21b308e72ab4107e90c39530c73414db9c8bf0ec2ef5d46bb872dcc650f2bef337db59ffae6fd
7
- data.tar.gz: 4db294481349814d49966c8612e780a9a789dc2c1cf74a0b92ffe9cafa42ad3db0fd3403f090043bef806d7778e33639efa64efe98af1d221b894020cd3225d9
6
+ metadata.gz: 3ce2694d3d47c3e2ed2ba3ed947cbc989b53fdacc2209ca81a555bc40e5768c8d57cb745b7ffe30dd1bf296e0428117d5be9602dd1770c85243fad4f7b923409
7
+ data.tar.gz: cee8be2b76dbb7a457454abc8bd1347422034f1c80692ebc5b3ce90d64d2a79f2981650a42858079858261b2a2767a017145278204c2bdcd0bb0da8b89ba367f
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007-2018 Denis Defreyne and contributors
1
+ Copyright (c) 2007–… 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,11 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.11.4 (2019-04-28)
4
+
5
+ Fixes:
6
+
7
+ * Fixed an issue which could cause `#compiled_content` to sometimes return compiled content that erroneously includes the layout (#1412, #1421)
8
+
3
9
  ## 4.11.3 (2019-04-27)
4
10
 
5
11
  Enhancements:
@@ -5,7 +5,6 @@ require 'addressable'
5
5
  require 'ddplugin'
6
6
  require 'json'
7
7
  require 'parallel'
8
- require 'slow_enumerator_tools'
9
8
 
10
9
  module Nanoc
11
10
  # @return [String] A string containing information about this Nanoc version
@@ -13,7 +12,7 @@ module Nanoc
13
12
  #
14
13
  # @api private
15
14
  def self.version_information
16
- "Nanoc #{Nanoc::VERSION} © 2007-2018 Denis Defreyne.\n" \
15
+ "Nanoc #{Nanoc::VERSION} © 2007–2019 Denis Defreyne.\n" \
17
16
  "Running #{RUBY_ENGINE} #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) on #{RUBY_PLATFORM} with RubyGems #{Gem::VERSION}.\n"
18
17
  end
19
18
 
@@ -16,6 +16,4 @@ require_relative 'repos/outdatedness_store'
16
16
  require_relative 'repos/action_sequence_store'
17
17
  require_relative 'repos/site_loader'
18
18
  require_relative 'repos/compiled_content_store'
19
- require_relative 'repos/in_mem_data_source'
20
- require_relative 'repos/aggregate_data_source'
21
19
  require_relative 'repos/prefixed_data_source'
@@ -44,7 +44,8 @@ module Nanoc
44
44
  contract C::KeywordArgs[rep: Nanoc::Core::ItemRep, snapshot: C::Optional[C::Maybe[Symbol]]] => Nanoc::Core::Content
45
45
  def raw_compiled_content(rep:, snapshot: nil)
46
46
  # Get name of last pre-layout snapshot
47
- snapshot_name = snapshot || (get(rep, :pre) ? :pre : :last)
47
+ has_pre = rep.snapshot_defs.any? { |sd| sd.name == :pre }
48
+ snapshot_name = snapshot || (has_pre ? :pre : :last)
48
49
 
49
50
  # Check existance of snapshot
50
51
  snapshot_def = rep.snapshot_defs.reverse.find { |sd| sd.name == snapshot_name }
@@ -20,7 +20,7 @@ module Nanoc
20
20
  end
21
21
  end
22
22
 
23
- Nanoc::Int::AggregateDataSource.new(data_sources_to_aggregate, config)
23
+ Nanoc::Core::AggregateDataSource.new(data_sources_to_aggregate, config)
24
24
  end
25
25
 
26
26
  private
@@ -16,7 +16,7 @@ module Nanoc
16
16
  return if @site.preprocessed?
17
17
 
18
18
  if @action_provider.need_preprocessing?
19
- @site.data_source = Nanoc::Int::InMemDataSource.new(@site.items, @site.layouts, @site.data_source)
19
+ @site.data_source = Nanoc::Core::InMemDataSource.new(@site.items, @site.layouts, @site.data_source)
20
20
  @action_provider.preprocess(@site)
21
21
 
22
22
  @dependency_store.items = @site.items
@@ -128,7 +128,7 @@ module Nanoc::CLI
128
128
  begin
129
129
  Bundler.require(:nanoc)
130
130
  rescue Bundler::GemfileNotFound
131
- # When running nanoc with Bundler being defined but
131
+ # When running Nanoc with Bundler being defined but
132
132
  # no gemfile being present (rubygems automatically loads
133
133
  # Bundler when executing from command line), don't crash.
134
134
  end
@@ -242,7 +242,7 @@ module Nanoc::CLI::Commands
242
242
  write('layouts/default.html', DEFAULT_LAYOUT)
243
243
  end
244
244
 
245
- puts "Created a blank nanoc site at '#{path}'. Enjoy!"
245
+ puts "Created a blank Nanoc site at '#{path}'. Enjoy!"
246
246
  end
247
247
 
248
248
  private
@@ -50,7 +50,7 @@ module Nanoc::RuleDSL
50
50
  end
51
51
 
52
52
  site.data_source =
53
- Nanoc::Int::InMemDataSource.new(ctx.items._unwrap, ctx.layouts._unwrap, site.data_source)
53
+ Nanoc::Core::InMemDataSource.new(ctx.items._unwrap, ctx.layouts._unwrap, site.data_source)
54
54
  end
55
55
 
56
56
  def postprocess(site, compiler)
@@ -211,7 +211,7 @@ module Nanoc
211
211
  Nanoc::Int::Site.new(
212
212
  config: @config,
213
213
  code_snippets: [],
214
- data_source: Nanoc::Int::InMemDataSource.new(@items, @layouts),
214
+ data_source: Nanoc::Core::InMemDataSource.new(@items, @layouts),
215
215
  )
216
216
  end
217
217
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Nanoc
4
4
  # The current Nanoc version.
5
- VERSION = '4.11.3'
5
+ VERSION = '4.11.4'
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.11.3
4
+ version: 4.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-27 00:00:00.000000000 Z
11
+ date: 2019-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 4.11.3
47
+ version: 4.11.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 4.11.3
54
+ version: 4.11.4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: parallel
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.12'
69
- - !ruby/object:Gem::Dependency
70
- name: slow_enumerator_tools
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: tomlrb
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -179,14 +165,12 @@ files:
179
165
  - lib/nanoc/base/feature.rb
180
166
  - lib/nanoc/base/repos.rb
181
167
  - lib/nanoc/base/repos/action_sequence_store.rb
182
- - lib/nanoc/base/repos/aggregate_data_source.rb
183
168
  - lib/nanoc/base/repos/binary_compiled_content_cache.rb
184
169
  - lib/nanoc/base/repos/checksum_store.rb
185
170
  - lib/nanoc/base/repos/compiled_content_cache.rb
186
171
  - lib/nanoc/base/repos/compiled_content_store.rb
187
172
  - lib/nanoc/base/repos/config_loader.rb
188
173
  - lib/nanoc/base/repos/dependency_store.rb
189
- - lib/nanoc/base/repos/in_mem_data_source.rb
190
174
  - lib/nanoc/base/repos/item_rep_repo.rb
191
175
  - lib/nanoc/base/repos/outdatedness_store.rb
192
176
  - lib/nanoc/base/repos/prefixed_data_source.rb
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Nanoc
4
- module Int
5
- class AggregateDataSource < Nanoc::DataSource
6
- def initialize(data_sources, config)
7
- super({}, '/', '/', {})
8
-
9
- @data_sources = data_sources
10
- @config = config
11
- end
12
-
13
- def items
14
- @_items ||= begin
15
- objs = @data_sources.flat_map(&:items)
16
- Nanoc::Core::ItemCollection.new(@config, objs)
17
- end
18
- end
19
-
20
- def layouts
21
- @_layouts ||= begin
22
- objs = @data_sources.flat_map(&:layouts)
23
- Nanoc::Core::LayoutCollection.new(@config, objs)
24
- end
25
- end
26
-
27
- def item_changes
28
- SlowEnumeratorTools.merge(@data_sources.map(&:item_changes))
29
- end
30
-
31
- def layout_changes
32
- SlowEnumeratorTools.merge(@data_sources.map(&:layout_changes))
33
- end
34
- end
35
- end
36
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Nanoc
4
- module Int
5
- class InMemDataSource < Nanoc::DataSource
6
- attr_reader :items
7
- attr_reader :layouts
8
-
9
- def initialize(items, layouts, orig_data_source = nil)
10
- super({}, '/', '/', {})
11
-
12
- @items = items
13
- @layouts = layouts
14
- @orig_data_source = orig_data_source
15
- end
16
-
17
- def item_changes
18
- @orig_data_source ? @orig_data_source.item_changes : super
19
- end
20
-
21
- def layout_changes
22
- @orig_data_source ? @orig_data_source.layout_changes : super
23
- end
24
- end
25
- end
26
- end