jekyll 4.0.1 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +350 -163
- data/LICENSE +21 -21
- data/README.markdown +86 -90
- data/exe/jekyll +57 -57
- data/lib/blank_template/_config.yml +3 -3
- data/lib/blank_template/_layouts/default.html +12 -12
- data/lib/blank_template/_sass/main.scss +9 -9
- data/lib/blank_template/assets/css/main.scss +4 -4
- data/lib/blank_template/index.md +8 -8
- data/lib/jekyll/cache.rb +190 -190
- data/lib/jekyll/cleaner.rb +111 -111
- data/lib/jekyll/collection.rb +309 -309
- data/lib/jekyll/command.rb +105 -103
- data/lib/jekyll/commands/build.rb +93 -93
- data/lib/jekyll/commands/clean.rb +45 -45
- data/lib/jekyll/commands/doctor.rb +177 -173
- data/lib/jekyll/commands/help.rb +34 -34
- data/lib/jekyll/commands/new.rb +169 -169
- data/lib/jekyll/commands/new_theme.rb +40 -42
- data/lib/jekyll/commands/serve/live_reload_reactor.rb +122 -122
- data/lib/jekyll/commands/serve/livereload_assets/livereload.js +1183 -1183
- data/lib/jekyll/commands/serve/servlet.rb +202 -202
- data/lib/jekyll/commands/serve/websockets.rb +81 -81
- data/lib/jekyll/commands/serve.rb +362 -354
- data/lib/jekyll/configuration.rb +313 -316
- data/lib/jekyll/converter.rb +54 -54
- data/lib/jekyll/converters/identity.rb +41 -41
- data/lib/jekyll/converters/markdown/kramdown_parser.rb +199 -130
- data/lib/jekyll/converters/markdown.rb +113 -113
- data/lib/jekyll/converters/smartypants.rb +70 -70
- data/lib/jekyll/convertible.rb +257 -254
- data/lib/jekyll/deprecator.rb +50 -50
- data/lib/jekyll/document.rb +544 -522
- data/lib/jekyll/drops/collection_drop.rb +20 -20
- data/lib/jekyll/drops/document_drop.rb +70 -69
- data/lib/jekyll/drops/drop.rb +293 -215
- data/lib/jekyll/drops/excerpt_drop.rb +19 -19
- data/lib/jekyll/drops/jekyll_drop.rb +32 -32
- data/lib/jekyll/drops/site_drop.rb +66 -66
- data/lib/jekyll/drops/static_file_drop.rb +14 -14
- data/lib/jekyll/drops/unified_payload_drop.rb +26 -26
- data/lib/jekyll/drops/url_drop.rb +140 -132
- data/lib/jekyll/entry_filter.rb +121 -110
- data/lib/jekyll/errors.rb +20 -20
- data/lib/jekyll/excerpt.rb +201 -201
- data/lib/jekyll/external.rb +79 -79
- data/lib/jekyll/filters/date_filters.rb +110 -110
- data/lib/jekyll/filters/grouping_filters.rb +64 -64
- data/lib/jekyll/filters/url_filters.rb +98 -68
- data/lib/jekyll/filters.rb +535 -454
- data/lib/jekyll/frontmatter_defaults.rb +240 -245
- data/lib/jekyll/generator.rb +5 -5
- data/lib/jekyll/hooks.rb +107 -106
- data/lib/jekyll/inclusion.rb +32 -0
- data/lib/jekyll/layout.rb +67 -62
- data/lib/jekyll/liquid_extensions.rb +22 -22
- data/lib/jekyll/liquid_renderer/file.rb +77 -77
- data/lib/jekyll/liquid_renderer/table.rb +55 -75
- data/lib/jekyll/liquid_renderer.rb +80 -77
- data/lib/jekyll/log_adapter.rb +151 -151
- data/lib/jekyll/mime.types +866 -866
- data/lib/jekyll/page.rb +217 -186
- data/lib/jekyll/page_excerpt.rb +25 -0
- data/lib/jekyll/page_without_a_file.rb +14 -14
- data/lib/jekyll/path_manager.rb +74 -31
- data/lib/jekyll/plugin.rb +92 -92
- data/lib/jekyll/plugin_manager.rb +115 -115
- data/lib/jekyll/profiler.rb +58 -0
- data/lib/jekyll/publisher.rb +23 -23
- data/lib/jekyll/reader.rb +192 -187
- data/lib/jekyll/readers/collection_reader.rb +23 -22
- data/lib/jekyll/readers/data_reader.rb +79 -75
- data/lib/jekyll/readers/layout_reader.rb +62 -61
- data/lib/jekyll/readers/page_reader.rb +25 -24
- data/lib/jekyll/readers/post_reader.rb +85 -84
- data/lib/jekyll/readers/static_file_reader.rb +25 -24
- data/lib/jekyll/readers/theme_assets_reader.rb +52 -51
- data/lib/jekyll/regenerator.rb +195 -195
- data/lib/jekyll/related_posts.rb +52 -52
- data/lib/jekyll/renderer.rb +265 -267
- data/lib/jekyll/site.rb +551 -527
- data/lib/jekyll/static_file.rb +208 -203
- data/lib/jekyll/stevenson.rb +60 -60
- data/lib/jekyll/tags/highlight.rb +110 -110
- data/lib/jekyll/tags/include.rb +275 -221
- data/lib/jekyll/tags/link.rb +42 -41
- data/lib/jekyll/tags/post_url.rb +106 -107
- data/lib/jekyll/theme.rb +86 -80
- data/lib/jekyll/theme_builder.rb +121 -121
- data/lib/jekyll/url.rb +167 -164
- data/lib/jekyll/utils/ansi.rb +57 -57
- data/lib/jekyll/utils/exec.rb +26 -26
- data/lib/jekyll/utils/internet.rb +37 -37
- data/lib/jekyll/utils/platforms.rb +67 -82
- data/lib/jekyll/utils/thread_event.rb +31 -31
- data/lib/jekyll/utils/win_tz.rb +75 -75
- data/lib/jekyll/utils.rb +367 -367
- data/lib/jekyll/version.rb +5 -5
- data/lib/jekyll.rb +195 -206
- data/lib/site_template/.gitignore +5 -5
- data/lib/site_template/404.html +25 -25
- data/lib/site_template/_config.yml +55 -55
- data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +29 -29
- data/lib/site_template/about.markdown +18 -18
- data/lib/site_template/index.markdown +6 -6
- data/lib/theme_template/CODE_OF_CONDUCT.md.erb +74 -74
- data/lib/theme_template/Gemfile +4 -4
- data/lib/theme_template/LICENSE.txt.erb +21 -21
- data/lib/theme_template/README.md.erb +52 -52
- data/lib/theme_template/_layouts/default.html +1 -1
- data/lib/theme_template/_layouts/page.html +5 -5
- data/lib/theme_template/_layouts/post.html +5 -5
- data/lib/theme_template/example/_config.yml.erb +1 -1
- data/lib/theme_template/example/_post.md +12 -12
- data/lib/theme_template/example/index.html +14 -14
- data/lib/theme_template/example/style.scss +7 -7
- data/lib/theme_template/gitignore.erb +6 -6
- data/lib/theme_template/theme.gemspec.erb +16 -19
- data/rubocop/jekyll/assert_equal_literal_actual.rb +149 -149
- data/rubocop/jekyll/no_p_allowed.rb +23 -23
- data/rubocop/jekyll/no_puts_allowed.rb +23 -23
- data/rubocop/jekyll.rb +5 -5
- metadata +20 -38
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module RuboCop
|
|
4
|
-
module Cop
|
|
5
|
-
module Jekyll
|
|
6
|
-
# Checks for `assert_equal(exp, act, msg = nil)` calls containing literal values as
|
|
7
|
-
# second argument. The second argument should ideally be a method called on the tested
|
|
8
|
-
# instance.
|
|
9
|
-
#
|
|
10
|
-
# @example
|
|
11
|
-
# # bad
|
|
12
|
-
# assert_equal @foo.bar, "foobar"
|
|
13
|
-
# assert_equal @alpha.beta, { "foo" => "bar", "lorem" => "ipsum" }
|
|
14
|
-
# assert_equal @alpha.omega, ["foobar", "lipsum"]
|
|
15
|
-
#
|
|
16
|
-
# # good
|
|
17
|
-
# assert_equal "foobar", @foo.bar
|
|
18
|
-
#
|
|
19
|
-
# assert_equal(
|
|
20
|
-
# { "foo" => "bar", "lorem" => "ipsum" },
|
|
21
|
-
# @alpha.beta
|
|
22
|
-
# )
|
|
23
|
-
#
|
|
24
|
-
# assert_equal(
|
|
25
|
-
# ["foobar", "lipsum"],
|
|
26
|
-
# @alpha.omega
|
|
27
|
-
# )
|
|
28
|
-
#
|
|
29
|
-
class AssertEqualLiteralActual < Cop
|
|
30
|
-
MSG = "Provide the 'expected value' as the first argument to `assert_equal`.".freeze
|
|
31
|
-
|
|
32
|
-
SIMPLE_LITERALS = %i(
|
|
33
|
-
true
|
|
34
|
-
false
|
|
35
|
-
nil
|
|
36
|
-
int
|
|
37
|
-
float
|
|
38
|
-
str
|
|
39
|
-
sym
|
|
40
|
-
complex
|
|
41
|
-
rational
|
|
42
|
-
regopt
|
|
43
|
-
).freeze
|
|
44
|
-
|
|
45
|
-
COMPLEX_LITERALS = %i(
|
|
46
|
-
array
|
|
47
|
-
hash
|
|
48
|
-
pair
|
|
49
|
-
irange
|
|
50
|
-
erange
|
|
51
|
-
regexp
|
|
52
|
-
).freeze
|
|
53
|
-
|
|
54
|
-
def_node_matcher :literal_actual?, <<-PATTERN
|
|
55
|
-
(send nil? :assert_equal $(send ...) $#literal?)
|
|
56
|
-
PATTERN
|
|
57
|
-
|
|
58
|
-
def_node_matcher :literal_actual_with_msg?, <<-PATTERN
|
|
59
|
-
(send nil? :assert_equal $(send ...) $#literal? $#opt_msg?)
|
|
60
|
-
PATTERN
|
|
61
|
-
|
|
62
|
-
def on_send(node)
|
|
63
|
-
return unless literal_actual?(node) || literal_actual_with_msg?(node)
|
|
64
|
-
add_offense(node, location: :expression)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def autocorrect(node)
|
|
68
|
-
lambda do |corrector|
|
|
69
|
-
corrector.replace(node.loc.expression, replacement(node))
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
private
|
|
74
|
-
|
|
75
|
-
def opt_msg?(node)
|
|
76
|
-
node&.source
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# This is not implement using a NodePattern because it seems
|
|
80
|
-
# to not be able to match against an explicit (nil) sexp
|
|
81
|
-
def literal?(node)
|
|
82
|
-
node && (simple_literal?(node) || complex_literal?(node))
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
def simple_literal?(node)
|
|
86
|
-
SIMPLE_LITERALS.include?(node.type)
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
def complex_literal?(node)
|
|
90
|
-
COMPLEX_LITERALS.include?(node.type) &&
|
|
91
|
-
node.each_child_node.all?(&method(:literal?))
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def replacement(node)
|
|
95
|
-
_, _, first_param, second_param, optional_param = *node
|
|
96
|
-
|
|
97
|
-
replaced_text = \
|
|
98
|
-
if second_param.type == :hash
|
|
99
|
-
replace_hash_with_variable(first_param.source, second_param.source)
|
|
100
|
-
elsif second_param.type == :array && second_param.source != "[]"
|
|
101
|
-
replace_array_with_variable(first_param.source, second_param.source)
|
|
102
|
-
else
|
|
103
|
-
replace_based_on_line_length(first_param.source, second_param.source)
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
return "#{replaced_text}, #{optional_param.source}" if optional_param
|
|
107
|
-
replaced_text
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def replace_based_on_line_length(first_expression, second_expression)
|
|
111
|
-
result = "assert_equal #{second_expression}, #{first_expression}"
|
|
112
|
-
return result if result.length < 80
|
|
113
|
-
|
|
114
|
-
# fold long lines independent of Rubocop configuration for better readability
|
|
115
|
-
<<~TEXT
|
|
116
|
-
assert_equal(
|
|
117
|
-
#{second_expression},
|
|
118
|
-
#{first_expression}
|
|
119
|
-
)
|
|
120
|
-
TEXT
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
def replace_hash_with_variable(first_expression, second_expression)
|
|
124
|
-
expect_expression = if second_expression.start_with?("{")
|
|
125
|
-
second_expression
|
|
126
|
-
else
|
|
127
|
-
"{#{second_expression}}"
|
|
128
|
-
end
|
|
129
|
-
<<~TEXT
|
|
130
|
-
expected = #{expect_expression}
|
|
131
|
-
assert_equal expected, #{first_expression}
|
|
132
|
-
TEXT
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
def replace_array_with_variable(first_expression, second_expression)
|
|
136
|
-
expect_expression = if second_expression.start_with?("%")
|
|
137
|
-
second_expression
|
|
138
|
-
else
|
|
139
|
-
Array(second_expression)
|
|
140
|
-
end
|
|
141
|
-
<<~TEXT
|
|
142
|
-
expected = #{expect_expression}
|
|
143
|
-
assert_equal expected, #{first_expression}
|
|
144
|
-
TEXT
|
|
145
|
-
end
|
|
146
|
-
end
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RuboCop
|
|
4
|
+
module Cop
|
|
5
|
+
module Jekyll
|
|
6
|
+
# Checks for `assert_equal(exp, act, msg = nil)` calls containing literal values as
|
|
7
|
+
# second argument. The second argument should ideally be a method called on the tested
|
|
8
|
+
# instance.
|
|
9
|
+
#
|
|
10
|
+
# @example
|
|
11
|
+
# # bad
|
|
12
|
+
# assert_equal @foo.bar, "foobar"
|
|
13
|
+
# assert_equal @alpha.beta, { "foo" => "bar", "lorem" => "ipsum" }
|
|
14
|
+
# assert_equal @alpha.omega, ["foobar", "lipsum"]
|
|
15
|
+
#
|
|
16
|
+
# # good
|
|
17
|
+
# assert_equal "foobar", @foo.bar
|
|
18
|
+
#
|
|
19
|
+
# assert_equal(
|
|
20
|
+
# { "foo" => "bar", "lorem" => "ipsum" },
|
|
21
|
+
# @alpha.beta
|
|
22
|
+
# )
|
|
23
|
+
#
|
|
24
|
+
# assert_equal(
|
|
25
|
+
# ["foobar", "lipsum"],
|
|
26
|
+
# @alpha.omega
|
|
27
|
+
# )
|
|
28
|
+
#
|
|
29
|
+
class AssertEqualLiteralActual < Cop
|
|
30
|
+
MSG = "Provide the 'expected value' as the first argument to `assert_equal`.".freeze
|
|
31
|
+
|
|
32
|
+
SIMPLE_LITERALS = %i(
|
|
33
|
+
true
|
|
34
|
+
false
|
|
35
|
+
nil
|
|
36
|
+
int
|
|
37
|
+
float
|
|
38
|
+
str
|
|
39
|
+
sym
|
|
40
|
+
complex
|
|
41
|
+
rational
|
|
42
|
+
regopt
|
|
43
|
+
).freeze
|
|
44
|
+
|
|
45
|
+
COMPLEX_LITERALS = %i(
|
|
46
|
+
array
|
|
47
|
+
hash
|
|
48
|
+
pair
|
|
49
|
+
irange
|
|
50
|
+
erange
|
|
51
|
+
regexp
|
|
52
|
+
).freeze
|
|
53
|
+
|
|
54
|
+
def_node_matcher :literal_actual?, <<-PATTERN
|
|
55
|
+
(send nil? :assert_equal $(send ...) $#literal?)
|
|
56
|
+
PATTERN
|
|
57
|
+
|
|
58
|
+
def_node_matcher :literal_actual_with_msg?, <<-PATTERN
|
|
59
|
+
(send nil? :assert_equal $(send ...) $#literal? $#opt_msg?)
|
|
60
|
+
PATTERN
|
|
61
|
+
|
|
62
|
+
def on_send(node)
|
|
63
|
+
return unless literal_actual?(node) || literal_actual_with_msg?(node)
|
|
64
|
+
add_offense(node, location: :expression)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def autocorrect(node)
|
|
68
|
+
lambda do |corrector|
|
|
69
|
+
corrector.replace(node.loc.expression, replacement(node))
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
private
|
|
74
|
+
|
|
75
|
+
def opt_msg?(node)
|
|
76
|
+
node&.source
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# This is not implement using a NodePattern because it seems
|
|
80
|
+
# to not be able to match against an explicit (nil) sexp
|
|
81
|
+
def literal?(node)
|
|
82
|
+
node && (simple_literal?(node) || complex_literal?(node))
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def simple_literal?(node)
|
|
86
|
+
SIMPLE_LITERALS.include?(node.type)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def complex_literal?(node)
|
|
90
|
+
COMPLEX_LITERALS.include?(node.type) &&
|
|
91
|
+
node.each_child_node.all?(&method(:literal?))
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def replacement(node)
|
|
95
|
+
_, _, first_param, second_param, optional_param = *node
|
|
96
|
+
|
|
97
|
+
replaced_text = \
|
|
98
|
+
if second_param.type == :hash
|
|
99
|
+
replace_hash_with_variable(first_param.source, second_param.source)
|
|
100
|
+
elsif second_param.type == :array && second_param.source != "[]"
|
|
101
|
+
replace_array_with_variable(first_param.source, second_param.source)
|
|
102
|
+
else
|
|
103
|
+
replace_based_on_line_length(first_param.source, second_param.source)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
return "#{replaced_text}, #{optional_param.source}" if optional_param
|
|
107
|
+
replaced_text
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def replace_based_on_line_length(first_expression, second_expression)
|
|
111
|
+
result = "assert_equal #{second_expression}, #{first_expression}"
|
|
112
|
+
return result if result.length < 80
|
|
113
|
+
|
|
114
|
+
# fold long lines independent of Rubocop configuration for better readability
|
|
115
|
+
<<~TEXT
|
|
116
|
+
assert_equal(
|
|
117
|
+
#{second_expression},
|
|
118
|
+
#{first_expression}
|
|
119
|
+
)
|
|
120
|
+
TEXT
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def replace_hash_with_variable(first_expression, second_expression)
|
|
124
|
+
expect_expression = if second_expression.start_with?("{")
|
|
125
|
+
second_expression
|
|
126
|
+
else
|
|
127
|
+
"{#{second_expression}}"
|
|
128
|
+
end
|
|
129
|
+
<<~TEXT
|
|
130
|
+
expected = #{expect_expression}
|
|
131
|
+
assert_equal expected, #{first_expression}
|
|
132
|
+
TEXT
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def replace_array_with_variable(first_expression, second_expression)
|
|
136
|
+
expect_expression = if second_expression.start_with?("%")
|
|
137
|
+
second_expression
|
|
138
|
+
else
|
|
139
|
+
Array(second_expression)
|
|
140
|
+
end
|
|
141
|
+
<<~TEXT
|
|
142
|
+
expected = #{expect_expression}
|
|
143
|
+
assert_equal expected, #{first_expression}
|
|
144
|
+
TEXT
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "rubocop"
|
|
4
|
-
|
|
5
|
-
module RuboCop
|
|
6
|
-
module Cop
|
|
7
|
-
module Jekyll
|
|
8
|
-
class NoPAllowed < Cop
|
|
9
|
-
MSG = "Avoid using `p` to print things. Use `Jekyll.logger` instead.".freeze
|
|
10
|
-
|
|
11
|
-
def_node_search :p_called?, <<-PATTERN
|
|
12
|
-
(send _ :p _)
|
|
13
|
-
PATTERN
|
|
14
|
-
|
|
15
|
-
def on_send(node)
|
|
16
|
-
if p_called?(node)
|
|
17
|
-
add_offense(node, :location => :selector)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rubocop"
|
|
4
|
+
|
|
5
|
+
module RuboCop
|
|
6
|
+
module Cop
|
|
7
|
+
module Jekyll
|
|
8
|
+
class NoPAllowed < Cop
|
|
9
|
+
MSG = "Avoid using `p` to print things. Use `Jekyll.logger` instead.".freeze
|
|
10
|
+
|
|
11
|
+
def_node_search :p_called?, <<-PATTERN
|
|
12
|
+
(send _ :p _)
|
|
13
|
+
PATTERN
|
|
14
|
+
|
|
15
|
+
def on_send(node)
|
|
16
|
+
if p_called?(node)
|
|
17
|
+
add_offense(node, :location => :selector)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "rubocop"
|
|
4
|
-
|
|
5
|
-
module RuboCop
|
|
6
|
-
module Cop
|
|
7
|
-
module Jekyll
|
|
8
|
-
class NoPutsAllowed < Cop
|
|
9
|
-
MSG = "Avoid using `puts` to print things. Use `Jekyll.logger` instead.".freeze
|
|
10
|
-
|
|
11
|
-
def_node_search :puts_called?, <<-PATTERN
|
|
12
|
-
(send nil? :puts _)
|
|
13
|
-
PATTERN
|
|
14
|
-
|
|
15
|
-
def on_send(node)
|
|
16
|
-
if puts_called?(node)
|
|
17
|
-
add_offense(node, :location => :selector)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rubocop"
|
|
4
|
+
|
|
5
|
+
module RuboCop
|
|
6
|
+
module Cop
|
|
7
|
+
module Jekyll
|
|
8
|
+
class NoPutsAllowed < Cop
|
|
9
|
+
MSG = "Avoid using `puts` to print things. Use `Jekyll.logger` instead.".freeze
|
|
10
|
+
|
|
11
|
+
def_node_search :puts_called?, <<-PATTERN
|
|
12
|
+
(send nil? :puts _)
|
|
13
|
+
PATTERN
|
|
14
|
+
|
|
15
|
+
def on_send(node)
|
|
16
|
+
if puts_called?(node)
|
|
17
|
+
add_offense(node, :location => :selector)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
data/rubocop/jekyll.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
Dir[File.join(File.expand_path("jekyll", __dir__), "*.rb")].each do |ruby_file|
|
|
4
|
-
require ruby_file
|
|
5
|
-
end
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
Dir[File.join(File.expand_path("jekyll", __dir__), "*.rb")].each do |ruby_file|
|
|
4
|
+
require ruby_file
|
|
5
|
+
end
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom Preston-Werner
|
|
8
8
|
- Parker Moore
|
|
9
9
|
- Matt Rogers
|
|
10
|
-
autorequire:
|
|
10
|
+
autorequire:
|
|
11
11
|
bindir: exe
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2021-09-27 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: addressable
|
|
@@ -58,22 +58,16 @@ dependencies:
|
|
|
58
58
|
name: i18n
|
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
|
60
60
|
requirements:
|
|
61
|
-
- - "
|
|
62
|
-
- !ruby/object:Gem::Version
|
|
63
|
-
version: 0.9.5
|
|
64
|
-
- - "<"
|
|
61
|
+
- - "~>"
|
|
65
62
|
- !ruby/object:Gem::Version
|
|
66
|
-
version: '
|
|
63
|
+
version: '1.0'
|
|
67
64
|
type: :runtime
|
|
68
65
|
prerelease: false
|
|
69
66
|
version_requirements: !ruby/object:Gem::Requirement
|
|
70
67
|
requirements:
|
|
71
|
-
- - "
|
|
72
|
-
- !ruby/object:Gem::Version
|
|
73
|
-
version: 0.9.5
|
|
74
|
-
- - "<"
|
|
68
|
+
- - "~>"
|
|
75
69
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: '
|
|
70
|
+
version: '1.0'
|
|
77
71
|
- !ruby/object:Gem::Dependency
|
|
78
72
|
name: jekyll-sass-converter
|
|
79
73
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -108,14 +102,14 @@ dependencies:
|
|
|
108
102
|
requirements:
|
|
109
103
|
- - "~>"
|
|
110
104
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: '2.
|
|
105
|
+
version: '2.3'
|
|
112
106
|
type: :runtime
|
|
113
107
|
prerelease: false
|
|
114
108
|
version_requirements: !ruby/object:Gem::Requirement
|
|
115
109
|
requirements:
|
|
116
110
|
- - "~>"
|
|
117
111
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: '2.
|
|
112
|
+
version: '2.3'
|
|
119
113
|
- !ruby/object:Gem::Dependency
|
|
120
114
|
name: kramdown-parser-gfm
|
|
121
115
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -150,14 +144,14 @@ dependencies:
|
|
|
150
144
|
requirements:
|
|
151
145
|
- - "~>"
|
|
152
146
|
- !ruby/object:Gem::Version
|
|
153
|
-
version: 0.
|
|
147
|
+
version: 0.4.0
|
|
154
148
|
type: :runtime
|
|
155
149
|
prerelease: false
|
|
156
150
|
version_requirements: !ruby/object:Gem::Requirement
|
|
157
151
|
requirements:
|
|
158
152
|
- - "~>"
|
|
159
153
|
- !ruby/object:Gem::Version
|
|
160
|
-
version: 0.
|
|
154
|
+
version: 0.4.0
|
|
161
155
|
- !ruby/object:Gem::Dependency
|
|
162
156
|
name: pathutil
|
|
163
157
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -206,14 +200,14 @@ dependencies:
|
|
|
206
200
|
requirements:
|
|
207
201
|
- - "~>"
|
|
208
202
|
- !ruby/object:Gem::Version
|
|
209
|
-
version: '
|
|
203
|
+
version: '2.0'
|
|
210
204
|
type: :runtime
|
|
211
205
|
prerelease: false
|
|
212
206
|
version_requirements: !ruby/object:Gem::Requirement
|
|
213
207
|
requirements:
|
|
214
208
|
- - "~>"
|
|
215
209
|
- !ruby/object:Gem::Version
|
|
216
|
-
version: '
|
|
210
|
+
version: '2.0'
|
|
217
211
|
description: Jekyll is a simple, blog aware, static site generator.
|
|
218
212
|
email:
|
|
219
213
|
- maintainers@jekyllrb.com
|
|
@@ -278,6 +272,7 @@ files:
|
|
|
278
272
|
- lib/jekyll/frontmatter_defaults.rb
|
|
279
273
|
- lib/jekyll/generator.rb
|
|
280
274
|
- lib/jekyll/hooks.rb
|
|
275
|
+
- lib/jekyll/inclusion.rb
|
|
281
276
|
- lib/jekyll/layout.rb
|
|
282
277
|
- lib/jekyll/liquid_extensions.rb
|
|
283
278
|
- lib/jekyll/liquid_renderer.rb
|
|
@@ -286,10 +281,12 @@ files:
|
|
|
286
281
|
- lib/jekyll/log_adapter.rb
|
|
287
282
|
- lib/jekyll/mime.types
|
|
288
283
|
- lib/jekyll/page.rb
|
|
284
|
+
- lib/jekyll/page_excerpt.rb
|
|
289
285
|
- lib/jekyll/page_without_a_file.rb
|
|
290
286
|
- lib/jekyll/path_manager.rb
|
|
291
287
|
- lib/jekyll/plugin.rb
|
|
292
288
|
- lib/jekyll/plugin_manager.rb
|
|
289
|
+
- lib/jekyll/profiler.rb
|
|
293
290
|
- lib/jekyll/publisher.rb
|
|
294
291
|
- lib/jekyll/reader.rb
|
|
295
292
|
- lib/jekyll/readers/collection_reader.rb
|
|
@@ -347,26 +344,11 @@ homepage: https://jekyllrb.com
|
|
|
347
344
|
licenses:
|
|
348
345
|
- MIT
|
|
349
346
|
metadata:
|
|
347
|
+
source_code_uri: https://github.com/jekyll/jekyll
|
|
350
348
|
bug_tracker_uri: https://github.com/jekyll/jekyll/issues
|
|
351
349
|
changelog_uri: https://github.com/jekyll/jekyll/releases
|
|
352
350
|
homepage_uri: https://jekyllrb.com
|
|
353
|
-
|
|
354
|
-
post_install_message: |
|
|
355
|
-
-------------------------------------------------------------------------------------
|
|
356
|
-
Jekyll 4.0 comes with some major changes, notably:
|
|
357
|
-
|
|
358
|
-
* Our `link` tag now comes with the `relative_url` filter incorporated into it.
|
|
359
|
-
You should no longer prepend `{{ site.baseurl }}` to `{% link foo.md %}`
|
|
360
|
-
For further details: https://github.com/jekyll/jekyll/pull/6727
|
|
361
|
-
|
|
362
|
-
* Our `post_url` tag now comes with the `relative_url` filter incorporated into it.
|
|
363
|
-
You shouldn't prepend `{{ site.baseurl }}` to `{% post_url 2019-03-27-hello %}`
|
|
364
|
-
For further details: https://github.com/jekyll/jekyll/pull/7589
|
|
365
|
-
|
|
366
|
-
* Support for deprecated configuration options has been removed. We will no longer
|
|
367
|
-
output a warning and gracefully assign their values to the newer counterparts
|
|
368
|
-
internally.
|
|
369
|
-
-------------------------------------------------------------------------------------
|
|
351
|
+
post_install_message:
|
|
370
352
|
rdoc_options:
|
|
371
353
|
- "--charset=UTF-8"
|
|
372
354
|
require_paths:
|
|
@@ -382,8 +364,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
382
364
|
- !ruby/object:Gem::Version
|
|
383
365
|
version: 2.7.0
|
|
384
366
|
requirements: []
|
|
385
|
-
rubygems_version: 3.
|
|
386
|
-
signing_key:
|
|
367
|
+
rubygems_version: 3.2.28
|
|
368
|
+
signing_key:
|
|
387
369
|
specification_version: 4
|
|
388
370
|
summary: A simple, blog aware, static site generator.
|
|
389
371
|
test_files: []
|