jekyll 3.3.0 → 3.3.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: d8d1ccf027b6fb0da7805b442449aa63d0a22ef0
4
- data.tar.gz: ac1b81c708fd150ddf115d8d967d20e245460645
3
+ metadata.gz: 68bb27761f573ec04ae1397a773f64e1d8f4545e
4
+ data.tar.gz: bd8993ae63044fd48be9ff85bcb0ee5ff7c3dc4c
5
5
  SHA512:
6
- metadata.gz: e336dc8f9e8dd733ab4fb788434c48eecede987f412c8f8ba07a050ce2cb9daedd6bb8625bf1c57149011981fcda9b2c5ff8ba8aaa86f4cc351f1d925709f470
7
- data.tar.gz: d1b9196688c17be6cb1e89c573d22180972e44b1e4e519515d1f722df37c56313bb28ac6e6003a216bafa224a26532970315d9a09f7afdce13dce63b01c8d649
6
+ metadata.gz: bcd138cfb2d0629a83d4b2c16c4fd9d4635cb053ba14302611820be25acef3a475e0956f65933eb4641133769d7e62abdecd60f11636a53f2b70aa945bb2d74d
7
+ data.tar.gz: 2addd77ace5a02fae654c07fcc2d2db6d993ac8036771333cbb023d68a09c622d6433a8aefc42d9ab69b57f0972d9f75c0118924a89b0b9bbbec2384827ab907
@@ -6,6 +6,7 @@ AllCops:
6
6
  Exclude:
7
7
  - lib/jekyll/renderer.rb
8
8
  - bin/**/*
9
+ - exe/**/*
9
10
  - benchmark/**/*
10
11
  - script/**/*
11
12
  - vendor/**/*
@@ -17,6 +18,10 @@ Lint/UselessAccessModifier:
17
18
  Enabled: false
18
19
  Metrics/AbcSize:
19
20
  Max: 21
21
+ Metrics/BlockLength:
22
+ Exclude:
23
+ - test/**/*.rb
24
+ - lib/jekyll/configuration.rb
20
25
  Metrics/ClassLength:
21
26
  Exclude:
22
27
  - !ruby/regexp /features\/.*.rb$/
@@ -71,23 +71,27 @@ module Jekyll
71
71
  #
72
72
  # Returns nothing.
73
73
  def watch(site, options)
74
- if Utils::Platforms.windows?
75
- Jekyll.logger.warn "", "--watch arg is unsupported on Windows. "
76
- Jekyll.logger.warn "", "If you are on Windows Bash, please see: " \
77
- "https://github.com/Microsoft/BashOnWindows/issues/216"
74
+ # Warn Windows users that they might need to upgrade.
75
+ if Utils::Platforms.bash_on_windows?
76
+ Jekyll.logger.warn "",
77
+ "Auto-regeneration may not work on some Windows versions."
78
+ Jekyll.logger.warn "",
79
+ "Please see: https://github.com/Microsoft/BashOnWindows/issues/216"
80
+ Jekyll.logger.warn "",
81
+ "If it does not work, please upgrade Bash on Windows or "\
82
+ "run Jekyll with --no-watch."
83
+ end
78
84
 
85
+ External.require_with_graceful_fail "jekyll-watch"
86
+ watch_method = Jekyll::Watcher.method(:watch)
87
+ if watch_method.parameters.size == 1
88
+ watch_method.call(
89
+ options
90
+ )
79
91
  else
80
- External.require_with_graceful_fail "jekyll-watch"
81
- watch_method = Jekyll::Watcher.method(:watch)
82
- if watch_method.parameters.size == 1
83
- watch_method.call(
84
- options
85
- )
86
- else
87
- watch_method.call(
88
- options, site
89
- )
90
- end
92
+ watch_method.call(
93
+ options, site
94
+ )
91
95
  end
92
96
  end
93
97
  end # end of class << self
@@ -17,7 +17,9 @@ module Jekyll
17
17
  # Handling Reading
18
18
  "safe" => false,
19
19
  "include" => [".htaccess"],
20
- "exclude" => %w(node_modules vendor),
20
+ "exclude" => %w(
21
+ node_modules vendor/bundle/ vendor/cache/ vendor/gems/ vendor/ruby/
22
+ ),
21
23
  "keep_files" => [".git", ".svn"],
22
24
  "encoding" => "utf-8",
23
25
  "markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
@@ -78,6 +78,11 @@ module Jekyll
78
78
  def y_day
79
79
  @obj.date.strftime("%j")
80
80
  end
81
+
82
+ private
83
+ def fallback_data
84
+ {}
85
+ end
81
86
  end
82
87
  end
83
88
  end
@@ -36,8 +36,7 @@ module Jekyll
36
36
  end
37
37
 
38
38
  def included?(entry)
39
- glob_include?(site.include,
40
- entry)
39
+ glob_include?(site.include, entry)
41
40
  end
42
41
 
43
42
  def special?(entry)
@@ -50,14 +49,14 @@ module Jekyll
50
49
  end
51
50
 
52
51
  def excluded?(entry)
53
- excluded = glob_include?(site.exclude, relative_to_source(entry))
54
- if excluded
55
- Jekyll.logger.debug(
56
- "EntryFilter:",
57
- "excluded #{relative_to_source(entry)}"
58
- )
52
+ glob_include?(site.exclude, relative_to_source(entry)).tap do |excluded|
53
+ if excluded
54
+ Jekyll.logger.debug(
55
+ "EntryFilter:",
56
+ "excluded #{relative_to_source(entry)}"
57
+ )
58
+ end
59
59
  end
60
- excluded
61
60
  end
62
61
 
63
62
  # --
@@ -188,7 +188,7 @@ module Jekyll
188
188
  if path.nil? || path.empty?
189
189
  ""
190
190
  else
191
- path.gsub(%r!\A/!, "").gsub(%r!([^/])\z!, '\1')
191
+ path.gsub(%r!\A/|(?<=[^/])\z!, "".freeze)
192
192
  end
193
193
  end
194
194
  end
@@ -62,8 +62,7 @@ module Jekyll
62
62
  end
63
63
 
64
64
  def sanitize_filename(name)
65
- name.gsub!(%r![^\w\s-]+!, "")
66
- name.gsub!(%r!(^|\b\s)\s+($|\s?\b)!, '\\1\\2')
65
+ name.gsub!(%r![^\w\s-]+|(?<=^|\b\s)\s+(?=$|\s?\b)!, "".freeze)
67
66
  name.gsub(%r!\s+!, "_")
68
67
  end
69
68
  end
@@ -191,11 +191,7 @@ module Jekyll
191
191
  render_pages(payload)
192
192
 
193
193
  Jekyll::Hooks.trigger :site, :post_render, self, payload
194
- # rubocop: disable HandleExceptions
195
- rescue Errno::ENOENT
196
- # ignore missing layout dir
197
194
  end
198
- # rubocop: enable HandleExceptions
199
195
 
200
196
  # Remove orphaned files and empty directories in destination.
201
197
  #
@@ -84,14 +84,36 @@ module Jekyll
84
84
  end
85
85
  end
86
86
 
87
+ # We include underscores in keys to allow for 'i_month' and so forth.
88
+ # This poses a problem for keys which are followed by an underscore
89
+ # but the underscore is not part of the key, e.g. '/:month_:day'.
90
+ # That should be :month and :day, but our key extraction regexp isn't
91
+ # smart enough to know that so we have to make it an explicit
92
+ # possibility.
93
+ def possible_keys(key)
94
+ if key.end_with?("_")
95
+ [key, key.chomp("_")]
96
+ else
97
+ [key]
98
+ end
99
+ end
100
+
87
101
  def generate_url_from_drop(template)
88
102
  template.gsub(%r!:([a-z_]+)!) do |match|
89
- replacement = @placeholders.public_send(match.sub(":".freeze, "".freeze))
90
- if replacement.nil?
91
- "".freeze
92
- else
93
- self.class.escape_path(replacement)
103
+ pool = possible_keys(match.sub(":".freeze, "".freeze))
104
+
105
+ winner = pool.find { |key| @placeholders.key?(key) }
106
+ if winner.nil?
107
+ raise NoMethodError,
108
+ "The URL template doesn't have #{pool.join(" or ")} keys. "\
109
+ "Check your permalink template!"
94
110
  end
111
+
112
+ value = @placeholders[winner]
113
+ value = "" if value.nil?
114
+ replacement = self.class.escape_path(value)
115
+
116
+ match.sub(":#{winner}", replacement)
95
117
  end.gsub(%r!//!, "/".freeze)
96
118
  end
97
119
 
@@ -19,20 +19,33 @@ module Jekyll
19
19
  # /proc/version returns nothing to us.
20
20
  # --
21
21
 
22
- def really_windows?
22
+ def vanilla_windows?
23
23
  RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
24
24
  !proc_version
25
25
  end
26
26
 
27
+ # --
28
+ # XXX: Remove in 4.0
29
+ # --
30
+
31
+ alias_method :really_windows?, \
32
+ :vanilla_windows?
33
+
27
34
  #
28
35
 
29
- def windows?
30
- RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i || \
36
+ def bash_on_windows?
37
+ RbConfig::CONFIG["host_os"] =~ %r!linux! && \
31
38
  proc_version =~ %r!microsoft!i
32
39
  end
33
40
 
34
41
  #
35
42
 
43
+ def windows?
44
+ vanilla_windows? || bash_on_windows?
45
+ end
46
+
47
+ #
48
+
36
49
  def linux?
37
50
  RbConfig::CONFIG["host_os"] =~ %r!linux! && \
38
51
  proc_version !~ %r!microsoft!i
@@ -1,3 +1,3 @@
1
1
  module Jekyll
2
- VERSION = "3.3.0".freeze
2
+ VERSION = "3.3.1".freeze
3
3
  end
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # This config file is meant for settings that affect your whole blog, values
4
4
  # which you are expected to set up once and rarely edit after that. If you find
5
- # yourself editing these this file very often, consider using Jekyll's data files
5
+ # yourself editing this file very often, consider using Jekyll's data files
6
6
  # feature for the data you need to update frequently.
7
7
  #
8
8
  # For technical reasons, this file is *NOT* reloaded automatically when you use
@@ -38,7 +38,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
38
38
 
39
39
  To set up your environment to develop this theme, run `bundle install`.
40
40
 
41
- You theme is setup just like a normal Jelyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
41
+ Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
42
42
 
43
43
  When your theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.
44
44
 
@@ -12,7 +12,8 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(<%= theme_directories.join("|") %>|LICENSE|README)}i) }
14
14
 
15
- spec.add_development_dependency "jekyll", "~> <%= jekyll_version_with_minor %>"
15
+ spec.add_runtime_dependency "jekyll", "~> <%= jekyll_version_with_minor %>"
16
+
16
17
  spec.add_development_dependency "bundler", "~> 1.12"
17
18
  spec.add_development_dependency "rake", "~> 10.0"
18
19
  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.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-06 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid