jekyll 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jekyll might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7a714a746d474d294968912e1d95d793174165c
4
- data.tar.gz: a8d08a44906ec34cba1c3fd3889db31ca5bfafb8
3
+ metadata.gz: bbceef751c1ed39cdd114281048271b98f2964bb
4
+ data.tar.gz: 6e8a4c06979282eb307f59270fd3bb75513863ae
5
5
  SHA512:
6
- metadata.gz: 3da575bed2b088a6b33dbbbe5bde105adb4fee9bf6812a4274030bbcac74816084071a9a1b345c27178c0b40625c668cf61f3a80e9838045ec3119228fde7fc7
7
- data.tar.gz: 0dd32ac1af7b9a182df355f6bb6f04f210c070f0d159651b9e5872941be77b4e9b0df537ecb65517669f2d8257d97a9ae61cd51483f6212c110c9b63c3d7384e
6
+ metadata.gz: af52df4c2c894accde6a6766b33204f6223b9c1cb00547ffe0806e9a1b794492b8769209737e0c3bad46e0405d72ada24e2ba5909ccc832b070ea349b925ad8d
7
+ data.tar.gz: 3da43c4067d652df4b857cc2161c5ee99f58f660d57643128eb97bdb8ca136f109447ded5b9bdc02da5857c24dc994d3b679e660a414595cc2e41a5bf074e985
@@ -58,7 +58,7 @@ module Jekyll
58
58
  # Merge some data in with this document's data.
59
59
  #
60
60
  # Returns the merged data.
61
- def merge_data!(other)
61
+ def merge_data!(other, source: "YAML front matter")
62
62
  if other.key?('categories') && !other['categories'].nil?
63
63
  if other['categories'].is_a?(String)
64
64
  other['categories'] = other['categories'].split(" ").map(&:strip)
@@ -67,7 +67,7 @@ module Jekyll
67
67
  end
68
68
  Utils.deep_merge_hashes!(data, other)
69
69
  if data.key?('date') && !data['date'].is_a?(Time)
70
- data['date'] = Utils.parse_date(data['date'].to_s, "Document '#{relative_path}' does not have a valid date in the YAML front matter.")
70
+ data['date'] = Utils.parse_date(data['date'].to_s, "Document '#{relative_path}' does not have a valid date in the #{source}.")
71
71
  end
72
72
  data
73
73
  end
@@ -287,20 +287,23 @@ module Jekyll
287
287
  else
288
288
  begin
289
289
  defaults = @site.frontmatter_defaults.all(url, collection.label.to_sym)
290
- merge_data!(defaults) unless defaults.empty?
290
+ merge_data!(defaults, source: "front matter defaults") unless defaults.empty?
291
291
 
292
292
  self.content = File.read(path, merged_file_read_opts(opts))
293
293
  if content =~ YAML_FRONT_MATTER_REGEXP
294
294
  self.content = $POSTMATCH
295
295
  data_file = SafeYAML.load($1)
296
- merge_data!(data_file) if data_file
296
+ merge_data!(data_file, source: "YAML front matter") if data_file
297
297
  end
298
298
 
299
299
  post_read
300
300
  rescue SyntaxError => e
301
- puts "YAML Exception reading #{path}: #{e.message}"
301
+ Jekyll.logger.error "Error:", "YAML Exception reading #{path}: #{e.message}"
302
302
  rescue Exception => e
303
- puts "Error reading file #{path}: #{e.message}"
303
+ if e.is_a? Jekyll::Errors::FatalException
304
+ raise e
305
+ end
306
+ Jekyll.logger.error "Error:", "could not read file #{path}: #{e.message}"
304
307
  end
305
308
  end
306
309
  end
@@ -311,8 +314,10 @@ module Jekyll
311
314
  merge_data!({
312
315
  "slug" => slug,
313
316
  "ext" => ext
314
- })
315
- merge_data!({"date" => date}) if data['date'].nil? || data['date'].to_i == site.time.to_i
317
+ }, source: "filename")
318
+ if data['date'].nil? || data['date'].to_i == site.time.to_i
319
+ merge_data!({"date" => date}, source: "filename")
320
+ end
316
321
  data['title'] ||= slug.split('-').select {|w| w.capitalize! || w }.join(' ')
317
322
  end
318
323
  populate_categories
@@ -332,7 +337,7 @@ module Jekyll
332
337
  superdirs = relative_path.sub(/#{special_dir}(.*)/, '').split(File::SEPARATOR).reject do |c|
333
338
  c.empty? || c.eql?(special_dir) || c.eql?(basename)
334
339
  end
335
- merge_data!({ 'categories' => superdirs })
340
+ merge_data!({ 'categories' => superdirs }, source: "file path")
336
341
  end
337
342
 
338
343
  def populate_categories
@@ -224,7 +224,7 @@ module Jekyll
224
224
  # Build a hash map based on the specified post attribute ( post attr =>
225
225
  # array of posts ) then sort each array in reverse order.
226
226
  hash = Hash.new { |h, key| h[key] = [] }
227
- posts.docs.each { |p| p.data[post_attr].each { |t| hash[t] << p } }
227
+ posts.docs.each { |p| p.data[post_attr].each { |t| hash[t] << p } if p.data[post_attr] }
228
228
  hash.values.each { |posts| posts.sort!.reverse! }
229
229
  hash
230
230
  end
@@ -1,3 +1,3 @@
1
1
  module Jekyll
2
- VERSION = '3.0.1'
2
+ VERSION = '3.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-18 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  requirements: []
236
236
  rubyforge_project:
237
- rubygems_version: 2.2.5
237
+ rubygems_version: 2.5.1
238
238
  signing_key:
239
239
  specification_version: 2
240
240
  summary: A simple, blog aware, static site generator.