jekyll 3.1.0 → 3.1.1

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: 05e4f40f8f400d7aa40c3d15acb9fcdc8f16ceaf
4
- data.tar.gz: 714e2322ba59673ee70dbc6acdf924052e3c0939
3
+ metadata.gz: 56c167aa9b02ffadc0482aa73eca44b948a1fbc5
4
+ data.tar.gz: 009cc8ae7b98a986ffd1792c382ab04a7e3ecfa9
5
5
  SHA512:
6
- metadata.gz: 7bc2509f9b4705cb88834a2ffdb802c30a42e311b494a5a33662cc27e5731a7958f0e814f73f01855fe84fd08a2ee6dd8fe6d6bd900c2e743033846af0147a24
7
- data.tar.gz: 10397d196e420bf2480038070cf2f6f9a3f67e4f0f321a728365d675da69c5ae1b975be1e207cbdef9819679fba09ca720ea11a125b66ce50d9f00450dd56aba
6
+ metadata.gz: 5f12355c33e46191613bed314fcca4d4124e5957cd1ffe394e61c99f2e99536c8c445b9dee2182f52b59d48350c7d3a785b3c49a8e86fb7665477bdcc047b8e4
7
+ data.tar.gz: 42e90646fb9484f3dfe61c2268074f7ed97656a0cc4674a07d21c12d985c5be8de08d58afa4a9d3f9414cd097cda30f9405f99c85157718ef8e7377c1d939f85
@@ -28,12 +28,6 @@ module Jekyll
28
28
  !(data.key?('published') && data['published'] == false)
29
29
  end
30
30
 
31
- # Returns merged option hash for File.read of self.site (if exists)
32
- # and a given param
33
- def merged_file_read_opts(opts)
34
- (site ? site.file_read_opts : {}).merge(opts)
35
- end
36
-
37
31
  # Read the YAML frontmatter.
38
32
  #
39
33
  # base - The String path to the dir containing the file.
@@ -46,7 +40,7 @@ module Jekyll
46
40
 
47
41
  begin
48
42
  self.content = File.read(site.in_source_dir(base, name),
49
- merged_file_read_opts(opts))
43
+ Utils.merged_file_read_opts(site, opts))
50
44
  if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
51
45
  self.content = $POSTMATCH
52
46
  self.data = SafeYAML.load(Regexp.last_match(1))
@@ -237,16 +237,6 @@ module Jekyll
237
237
  trigger_hooks(:post_write)
238
238
  end
239
239
 
240
- # Returns merged option hash for File.read of self.site (if exists)
241
- # and a given param
242
- #
243
- # opts - override options
244
- #
245
- # Return the file read options hash.
246
- def merged_file_read_opts(opts)
247
- site ? site.file_read_opts.merge(opts) : opts
248
- end
249
-
250
240
  # Whether the file is published or not, as indicated in YAML front-matter
251
241
  #
252
242
  # Returns true if the 'published' key is specified in the YAML front-matter and not `false`.
@@ -269,7 +259,7 @@ module Jekyll
269
259
  defaults = @site.frontmatter_defaults.all(url, collection.label.to_sym)
270
260
  merge_data!(defaults, source: "front matter defaults") unless defaults.empty?
271
261
 
272
- self.content = File.read(path, merged_file_read_opts(opts))
262
+ self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
273
263
  if content =~ YAML_FRONT_MATTER_REGEXP
274
264
  self.content = $POSTMATCH
275
265
  data_file = SafeYAML.load(Regexp.last_match(1))
@@ -9,6 +9,8 @@ module Jekyll
9
9
 
10
10
  alias_method :extname, :ext
11
11
 
12
+ FORWARD_SLASH = '/'.freeze
13
+
12
14
  # Attributes for Liquid templates
13
15
  ATTRIBUTES_FOR_LIQUID = %w(
14
16
  content
@@ -55,7 +57,12 @@ module Jekyll
55
57
  #
56
58
  # Returns the String destination directory.
57
59
  def dir
58
- url[-1, 1] == '/' ? url : File.dirname(url)
60
+ if url.end_with?(FORWARD_SLASH)
61
+ url
62
+ else
63
+ url_dir = File.dirname(url)
64
+ url_dir.end_with?(FORWARD_SLASH) ? url_dir : "#{url_dir}/"
65
+ end
59
66
  end
60
67
 
61
68
  # The full path and filename of the post. Defined in the YAML of the post
@@ -168,7 +168,7 @@ module Jekyll
168
168
  private
169
169
 
170
170
  def permalink_ext
171
- if document.permalink
171
+ if document.permalink && !document.permalink.end_with?("/")
172
172
  permalink_ext = File.extname(document.permalink)
173
173
  permalink_ext unless permalink_ext.empty?
174
174
  end
@@ -273,5 +273,15 @@ module Jekyll
273
273
  end
274
274
  end
275
275
 
276
+ # Returns merged option hash for File.read of self.site (if exists)
277
+ # and a given param
278
+ def merged_file_read_opts(site, opts)
279
+ merged = (site ? site.file_read_opts : {}).merge(opts)
280
+ if merged["encoding"] && !merged["encoding"].start_with?("bom|")
281
+ merged["encoding"].insert(0, "bom|")
282
+ end
283
+ merged
284
+ end
285
+
276
286
  end
277
287
  end
@@ -1,3 +1,3 @@
1
1
  module Jekyll
2
- VERSION = '3.1.0'
2
+ VERSION = '3.1.1'
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.1.0
4
+ version: 3.1.1
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: 2016-01-24 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid