dimples 4.1.3 → 4.2.0

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: e4066a33f67147ae9d974930a4bbebbcd0d66a97
4
- data.tar.gz: 0c21a026756610171383174f183ea2db4d6e4fbe
3
+ metadata.gz: fc01bb40770e8a3a3b7884110770715e3208b896
4
+ data.tar.gz: 61311224553e98e92284f604fe3365bebe91ceff
5
5
  SHA512:
6
- metadata.gz: b58c2ebd02f2a34f600407ec688c8338ec1c5b5647ac3f544d3b9a7274f8037ec253b2ed4f1a98a05d66b2e86b4fc3b4a26221edd600a401d61b9730a8a826aa
7
- data.tar.gz: 8fde57e85fddfa556ff51e5e749c75e3aa8c27593b4797317845c9bc102d76caf986265a4acb460f9d94a8dd4ea0090d32e03cf07e5a8f2517f522fc7ead31b3
6
+ metadata.gz: 81a7521d8dc5b54bb4dba111bbba718a3a2fb1ab4e076481a3179849b5762c6a62adec5de18e51bafccd6d1b0febd4e088dcaaeb4e2aff90d74e4d2cacf6ed10
7
+ data.tar.gz: 23c81dd7c232953de8ab1b190dd1fb0ff4d251fc9da6d325b8077245a89ba32b3d9d3313a9e0db7b90b57edae4d76ce9ffca88372982c2fd2d159a15df08a852
@@ -45,15 +45,7 @@ module Dimples
45
45
  def generate
46
46
  scan_files
47
47
  prepare_output_directory
48
-
49
- generate_pages unless @pages.count.zero?
50
-
51
- unless @posts.count.zero?
52
- generate_posts
53
- generate_archives
54
- generate_categories if @config[:generation][:categories]
55
- end
56
-
48
+ publish_files
57
49
  copy_assets
58
50
  rescue Errors::RenderingError,
59
51
  Errors::PublishingError,
@@ -61,6 +53,16 @@ module Dimples
61
53
  @errors << e.message
62
54
  end
63
55
 
56
+ def publish_files
57
+ publish_pages unless @pages.count.zero?
58
+
59
+ unless @posts.count.zero?
60
+ publish_posts
61
+ publish_archives
62
+ publish_categories if @config[:generation][:categories]
63
+ end
64
+ end
65
+
64
66
  def generated?
65
67
  @errors.count.zero?
66
68
  end
@@ -143,7 +145,7 @@ module Dimples
143
145
  raise Errors::GenerationError, error_message
144
146
  end
145
147
 
146
- def generate_posts
148
+ def publish_posts
147
149
  if @config[:verbose_logging]
148
150
  Dimples.logger.debug_generation('posts', @posts.length)
149
151
  end
@@ -157,10 +159,10 @@ module Dimples
157
159
  @config[:layouts][:posts]
158
160
  )
159
161
 
160
- generate_posts_feeds if @config[:generation][:feeds]
162
+ publish_posts_feeds if @config[:generation][:feeds]
161
163
  end
162
164
 
163
- def generate_pages
165
+ def publish_pages
164
166
  if @config[:verbose_logging]
165
167
  Dimples.logger.debug_generation('pages', @pages.length)
166
168
  end
@@ -168,7 +170,7 @@ module Dimples
168
170
  @pages.each(&:write)
169
171
  end
170
172
 
171
- def generate_categories
173
+ def publish_categories
172
174
  if @config[:verbose_logging]
173
175
  Dimples.logger.debug_generation('category pages', @categories.length)
174
176
  end
@@ -190,10 +192,10 @@ module Dimples
190
192
  )
191
193
  end
192
194
 
193
- generate_category_feeds if @config[:generation][:category_feeds]
195
+ publish_category_feeds if @config[:generation][:category_feeds]
194
196
  end
195
197
 
196
- def generate_archives
198
+ def publish_archives
197
199
  %w[year month day].each do |date_type|
198
200
  date_archives_sym = "#{date_type}_archives".to_sym
199
201
  next unless @config[:generation][date_archives_sym]
@@ -220,7 +222,7 @@ module Dimples
220
222
  end
221
223
  end
222
224
 
223
- def generate_feeds(path, context)
225
+ def publish_feeds(path, context)
224
226
  feed_templates.each do |format|
225
227
  next unless @templates[format]
226
228
 
@@ -235,17 +237,17 @@ module Dimples
235
237
  end
236
238
  end
237
239
 
238
- def generate_posts_feeds
240
+ def publish_posts_feeds
239
241
  posts = @posts[0..@config[:pagination][:per_page] - 1]
240
- generate_feeds(@output_paths[:site], posts: posts)
242
+ publish_feeds(@output_paths[:site], posts: posts)
241
243
  end
242
244
 
243
- def generate_category_feeds
245
+ def publish_category_feeds
244
246
  @categories.each_value do |category|
245
247
  path = File.join(@output_paths[:categories], category.slug)
246
248
  posts = category.posts[0..@config[:pagination][:per_page] - 1]
247
249
 
248
- generate_feeds(path, posts: posts, category: category.slug)
250
+ publish_feeds(path, posts: posts, category: category.slug)
249
251
  end
250
252
  end
251
253
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dimples
4
- VERSION = '4.1.3'
4
+ VERSION = '4.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-12 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt