nanoc-core 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: 81268371fca3b0d630f91ce6290ca35c685092b8a0f62ead810cc973d4a24d68
4
- data.tar.gz: 101af420b1fcd1701dd3c21392bdf6623121e952d64a3be09eed90ba4dde67b4
3
+ metadata.gz: 7ae42507c2bd9926280d8ad198a38578676110ddb6864b7f23d9d743a6c4e6ec
4
+ data.tar.gz: 76a1b941f030ee96ad01133b23e78cb1b74861e2ddd5f89147caf58fbccc8bc4
5
5
  SHA512:
6
- metadata.gz: 7b82d40f993402eae07367d4ae9170b3d7ad7fc80013f3f8ab8c42d944a2fa240bb37a01b693f6cfb305490eed65992d14334ecf581bc470550fcd61f5b9be8d
7
- data.tar.gz: 3bfe0233488f5c1df56f09af4059031fef6b622a99c8bbd7e23981a1f4aaa48c81854b19854ae086b22e24a6b8ac870d0c07914a67e24edff9f63dd3eb1a36a0
6
+ metadata.gz: b3ddf024cd0850616dd067a9c120519d1eea6e24efd236e78ce0fb9de30065f34117c52b429ff0e4045a1872ab34f15891c618a67ce084d6313c9e19febfac25
7
+ data.tar.gz: ed2c07319632a3f4f4222f95fa280c1bd5f460d9b4a3561a62c35c1eba1291cae8c19a5028db18cbdea8b269d6f600fa8ed73222c6366bc84b72c4050a5f7744
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nanoc
4
+ module Core
5
+ class AggregateDataSource < ::Nanoc::Core::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
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nanoc
4
+ module Core
5
+ class InMemDataSource < Nanoc::Core::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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Core
5
- VERSION = '4.11.3'
5
+ VERSION = '4.11.4'
6
6
  end
7
7
  end
data/lib/nanoc/core.rb CHANGED
@@ -10,6 +10,7 @@ require 'ddmemoize'
10
10
  require 'ddmetrics'
11
11
  require 'ddplugin'
12
12
  require 'hamster'
13
+ require 'slow_enumerator_tools'
13
14
  require 'zeitwerk'
14
15
 
15
16
  module Nanoc
@@ -25,7 +26,7 @@ inflector_class = Class.new(Zeitwerk::Inflector) do
25
26
  when 'version'
26
27
  'VERSION'
27
28
  else
28
- super(basename.tr('-', '_'), abspath.tr('-', '_'))
29
+ super
29
30
  end
30
31
  end
31
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-core
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: ddmemoize
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.19'
83
+ - !ruby/object:Gem::Dependency
84
+ name: slow_enumerator_tools
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: zeitwerk
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -107,6 +121,7 @@ files:
107
121
  - lib/nanoc/core/action_provider.rb
108
122
  - lib/nanoc/core/action_sequence.rb
109
123
  - lib/nanoc/core/action_sequence_builder.rb
124
+ - lib/nanoc/core/aggregate_data_source.rb
110
125
  - lib/nanoc/core/binary_content.rb
111
126
  - lib/nanoc/core/checksum_collection.rb
112
127
  - lib/nanoc/core/checksummer.rb
@@ -125,6 +140,7 @@ files:
125
140
  - lib/nanoc/core/error.rb
126
141
  - lib/nanoc/core/identifiable_collection.rb
127
142
  - lib/nanoc/core/identifier.rb
143
+ - lib/nanoc/core/in_mem_data_source.rb
128
144
  - lib/nanoc/core/instrumentor.rb
129
145
  - lib/nanoc/core/item.rb
130
146
  - lib/nanoc/core/item_collection.rb