jekyll 4.3.4 → 4.4.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
  SHA256:
3
- metadata.gz: 36a2e136e304048a4cd7cc196e2aed55eb12f143e9132181462ded47f80973b1
4
- data.tar.gz: a3f4d3438d8ba9179740dacc2eb89ecc7d0770927a1628fc2ac410010bea0c7b
3
+ metadata.gz: 6d429ecde97ed33aec9c33b132f24904b49af207540708c32f63a4643733dda9
4
+ data.tar.gz: b8241219e23446e5ea9bf4a16e1a27189257bc38c01e1cc1578668c9638bf36f
5
5
  SHA512:
6
- metadata.gz: c37c4db936253fd9307605f04af32d0a869839699b3056bae5dab4f1941ee7016e8d520f77f20a5d45026424fee68ff070e3029b81b4b0aafc0835cf4fe92528
7
- data.tar.gz: 0437ed64aa93cd10d3c751897bdf52b5de2d1d50bd52282588cee37a86d9a56d13fdad0ee32bfabb55336dcb5b2796c13857d9870700d071043869eb188e5711
6
+ metadata.gz: 7cf4e479b58a21659d7ca74e2ec3bb8ed24f89916048a0573f2e1c15fa7f44cfa7a535130e9e6233ac831f55ccf14250e686fbb039c64f14e8e03669b144d31c
7
+ data.tar.gz: 4320b2998e0f80d2afb4a8d6c10f16625ca3fc2f91a380c6ad88ee82e9589f8928fbdcaa89a121ae4c94dd3a8d823c611a3ae1dd75c9799c097c5c10ec4fee28
data/.rubocop.yml CHANGED
@@ -1,35 +1,53 @@
1
- ---
2
- inherit_from: .rubocop_todo.yml
1
+ # -----------------------------------------------------------------------------
2
+ # This file has been formatted via a Rake Task configuring cops from
3
+ # RuboCop v1.57.2.
4
+ #
5
+ # To add more cops, paste configurations at the end of the file and run
6
+ # the rake task via `bundle exec rake rubocop:format_config`.
7
+ # -----------------------------------------------------------------------------
3
8
 
4
- require:
5
- - rubocop-minitest
6
- - rubocop-performance
7
- - rubocop-rake
8
- - rubocop-rspec
9
- - ./rubocop/jekyll
9
+ inherit_from: ".rubocop_todo.yml"
10
10
 
11
- Jekyll/NoPutsAllowed:
12
- Exclude:
13
- - rake/*.rake
11
+ require:
12
+ - "./rubocop/jekyll"
13
+ - rubocop-minitest
14
+ - rubocop-performance
15
+ - rubocop-rake
16
+ - rubocop-rspec
14
17
 
18
+ # Directive for all cops
15
19
  AllCops:
16
20
  TargetRubyVersion: 2.7
17
21
  Include:
18
- - lib/**/*.rb
19
- - test/**/*.rb
22
+ - lib/**/*.rb
23
+ - test/**/*.rb
24
+ Exclude:
25
+ - benchmark/**/*
26
+ - bin/**/*
27
+ - exe/**/*
28
+ - script/**/*
29
+ - tmp/**/*
30
+ - vendor/**/*
31
+
32
+ # Configure custom cop
33
+ Jekyll/NoPutsAllowed:
20
34
  Exclude:
21
- - bin/**/*
22
- - exe/**/*
23
- - benchmark/**/*
24
- - script/**/*
25
- - vendor/**/*
26
- - tmp/**/*
35
+ - rake/*.rake
36
+
37
+ # Configure built-in cops
38
+ # =======================
27
39
 
40
+ # Gemspec cops
41
+ # ----------------------------------------
28
42
  Gemspec/DeprecatedAttributeAssignment:
29
43
  Enabled: true
44
+ Gemspec/DevelopmentDependencies:
45
+ Enabled: false
30
46
  Gemspec/RequireMFA:
31
47
  Enabled: false
32
48
 
49
+ # Layout cops
50
+ # ----------------------------------------
33
51
  Layout/BeginEndAlignment:
34
52
  Enabled: true
35
53
  Layout/EmptyComment:
@@ -38,6 +56,8 @@ Layout/EmptyLinesAroundAttributeAccessor:
38
56
  Enabled: true
39
57
  Layout/EndAlignment:
40
58
  Severity: error
59
+ Layout/EndOfLine:
60
+ Enabled: false
41
61
  Layout/FirstArrayElementIndentation:
42
62
  EnforcedStyle: consistent
43
63
  Layout/FirstHashElementIndentation:
@@ -54,10 +74,10 @@ Layout/LineEndStringConcatenationIndentation:
54
74
  Enabled: true
55
75
  Layout/LineLength:
56
76
  Exclude:
57
- - !ruby/regexp /features\/.*.rb/
58
- - Rakefile
59
- - rake/*.rake
60
- - Gemfile
77
+ - Gemfile
78
+ - Rakefile
79
+ - features/**/*.rb
80
+ - rake/**/*.rake
61
81
  Max: 100
62
82
  Severity: warning
63
83
  Layout/MultilineMethodCallIndentation:
@@ -71,8 +91,10 @@ Layout/SpaceBeforeBrackets:
71
91
  Layout/SpaceInsideHashLiteralBraces:
72
92
  Enabled: true
73
93
  Exclude:
74
- - test/**/*.rb
94
+ - test/**/*.rb
75
95
 
96
+ # Lint cops
97
+ # ----------------------------------------
76
98
  Lint/AmbiguousAssignment:
77
99
  Enabled: true
78
100
  Lint/AmbiguousOperatorPrecedence:
@@ -84,7 +106,7 @@ Lint/BinaryOperatorWithIdenticalOperands:
84
106
  Lint/ConstantDefinitionInBlock:
85
107
  Enabled: true
86
108
  Exclude:
87
- - test/**/*.rb
109
+ - test/**/*.rb
88
110
  Lint/ConstantOverwrittenInRescue:
89
111
  Enabled: true
90
112
  Lint/DeprecatedConstants:
@@ -95,6 +117,10 @@ Lint/DuplicateBranch:
95
117
  Enabled: true
96
118
  Lint/DuplicateElsifCondition:
97
119
  Enabled: true
120
+ Lint/DuplicateMagicComment:
121
+ Enabled: true
122
+ Lint/DuplicateMatchPattern:
123
+ Enabled: true
98
124
  Lint/DuplicateRegexpCharacterClassElement:
99
125
  Enabled: true
100
126
  Lint/DuplicateRequire:
@@ -119,11 +145,13 @@ Lint/LambdaWithoutLiteralBlock:
119
145
  Enabled: true
120
146
  Lint/MissingSuper:
121
147
  Enabled: false
148
+ Lint/MixedCaseRange:
149
+ Enabled: true
122
150
  Lint/MixedRegexpCaptureTypes:
123
151
  Enabled: false
124
152
  Lint/NestedPercentLiteral:
125
153
  Exclude:
126
- - test/test_site.rb
154
+ - test/test_site.rb
127
155
  Lint/NoReturnInBeginEndBlocks:
128
156
  Enabled: true
129
157
  Lint/NumberedParameterAssignment:
@@ -136,8 +164,12 @@ Lint/RaiseException:
136
164
  Enabled: true
137
165
  Lint/RedundantDirGlobSort:
138
166
  Enabled: true
167
+ Lint/RedundantRegexpQuantifiers:
168
+ Enabled: true
139
169
  Lint/RedundantSafeNavigation:
140
170
  Enabled: true
171
+ Lint/RefinementImportMethods:
172
+ Enabled: true
141
173
  Lint/RequireRangeParentheses:
142
174
  Enabled: true
143
175
  Lint/RequireRelativeSelfPath:
@@ -166,32 +198,38 @@ Lint/UnreachableLoop:
166
198
  Enabled: true
167
199
  Lint/UselessMethodDefinition:
168
200
  Enabled: true
201
+ Lint/UselessRuby2Keywords:
202
+ Enabled: true
169
203
  Lint/UselessTimes:
170
204
  Enabled: true
171
205
  Lint/Void:
172
206
  Exclude:
173
- - lib/jekyll/site.rb
207
+ - lib/jekyll/site.rb
174
208
 
209
+ # Metrics cops
210
+ # ----------------------------------------
175
211
  Metrics/AbcSize:
176
212
  Max: 23
177
213
  Metrics/BlockLength:
178
214
  Exclude:
179
- - test/**/*.rb
180
- - lib/jekyll/configuration.rb
181
- - rake/*.rake
215
+ - lib/jekyll/configuration.rb
216
+ - rake/**/*.rake
217
+ - test/**/*.rb
182
218
  Metrics/ClassLength:
183
219
  Exclude:
184
- - !ruby/regexp /features\/.*.rb$/
185
- - !ruby/regexp /test\/.*.rb$/
186
- - lib/jekyll/document.rb
187
- - lib/jekyll/site.rb
188
- - lib/jekyll/commands/serve.rb
189
- - lib/jekyll/configuration.rb
220
+ - features/**/*.rb
221
+ - lib/jekyll/commands/serve.rb
222
+ - lib/jekyll/configuration.rb
223
+ - lib/jekyll/document.rb
224
+ - lib/jekyll/site.rb
225
+ - test/**/*.rb
190
226
  Max: 240
227
+ Metrics/CollectionLiteralLength:
228
+ Enabled: true
191
229
  Metrics/CyclomaticComplexity:
192
230
  Exclude:
193
- - lib/jekyll/utils.rb
194
- - lib/jekyll/commands/serve.rb
231
+ - lib/jekyll/commands/serve.rb
232
+ - lib/jekyll/utils.rb
195
233
  Max: 11
196
234
  Metrics/MethodLength:
197
235
  CountComments: false
@@ -199,58 +237,102 @@ Metrics/MethodLength:
199
237
  Severity: error
200
238
  Metrics/ModuleLength:
201
239
  Exclude:
202
- - lib/jekyll/filters.rb
240
+ - lib/jekyll/filters.rb
203
241
  Max: 240
204
242
  Metrics/ParameterLists:
205
243
  Max: 4
206
244
  Metrics/PerceivedComplexity:
207
245
  Max: 13
208
246
 
247
+ # Minitest cops
248
+ # ----------------------------------------
209
249
  Minitest/AssertEmptyLiteral:
210
250
  Enabled: false
211
251
  Minitest/AssertInDelta:
212
252
  Enabled: true
213
- Minitest/AssertionInLifecycleHook:
214
- Enabled: true
215
253
  Minitest/AssertKindOf:
216
254
  Enabled: true
255
+ Minitest/AssertOperator:
256
+ Enabled: false
217
257
  Minitest/AssertOutput:
218
258
  Enabled: true
219
259
  Minitest/AssertPathExists:
220
260
  Enabled: true
261
+ Minitest/AssertPredicate:
262
+ Enabled: false
263
+ Minitest/AssertRaisesWithRegexpArgument:
264
+ Enabled: true
265
+ Minitest/AssertSame:
266
+ Enabled: true
221
267
  Minitest/AssertSilent:
222
268
  Enabled: true
223
269
  Minitest/AssertWithExpectedArgument:
224
270
  Enabled: true
225
- Minitest/LiteralAsActualArgument:
271
+ Minitest/AssertionInLifecycleHook:
226
272
  Enabled: true
227
- Minitest/TestMethodName:
273
+ Minitest/DuplicateTestRun:
274
+ Enabled: true
275
+ Minitest/EmptyLineBeforeAssertionMethods:
228
276
  Enabled: false
277
+ Minitest/LifecycleHooksOrder:
278
+ Enabled: true
279
+ Minitest/LiteralAsActualArgument:
280
+ Enabled: true
229
281
  Minitest/MultipleAssertions:
230
282
  Enabled: true
283
+ Minitest/NonExecutableTestMethod:
284
+ Enabled: true
285
+ Minitest/NonPublicTestMethod:
286
+ Enabled: true
287
+ Minitest/RedundantMessageArgument:
288
+ Enabled: true
231
289
  Minitest/RefuteInDelta:
232
290
  Enabled: true
233
291
  Minitest/RefuteKindOf:
234
292
  Enabled: true
293
+ Minitest/RefuteOperator:
294
+ Enabled: false
235
295
  Minitest/RefutePathExists:
236
296
  Enabled: true
297
+ Minitest/RefutePredicate:
298
+ Enabled: false
299
+ Minitest/RefuteSame:
300
+ Enabled: true
301
+ Minitest/ReturnInTestMethod:
302
+ Enabled: true
303
+ Minitest/SkipEnsure:
304
+ Enabled: true
305
+ Minitest/SkipWithoutReason:
306
+ Enabled: true
307
+ Minitest/TestFileName:
308
+ Enabled: true
309
+ Exclude:
310
+ - test/helper.rb
311
+ Minitest/TestMethodName:
312
+ Enabled: false
237
313
  Minitest/UnreachableAssertion:
238
314
  Enabled: true
239
315
  Minitest/UnspecifiedException:
240
316
  Enabled: true
317
+ Minitest/UselessAssertion:
318
+ Enabled: true
241
319
 
320
+ # Naming cops
321
+ # ----------------------------------------
242
322
  Naming/FileName:
243
323
  Enabled: false
244
324
  Naming/HeredocDelimiterNaming:
245
325
  Exclude:
246
- - test/**/*.rb
326
+ - test/**/*.rb
247
327
  Naming/MemoizedInstanceVariableName:
248
328
  Exclude:
249
- - lib/jekyll/convertible.rb
250
- - lib/jekyll/drops/site_drop.rb
251
- - lib/jekyll/drops/unified_payload_drop.rb
252
- - lib/jekyll/page_without_a_file.rb
329
+ - lib/jekyll/convertible.rb
330
+ - lib/jekyll/drops/site_drop.rb
331
+ - lib/jekyll/drops/unified_payload_drop.rb
332
+ - lib/jekyll/page_without_a_file.rb
253
333
 
334
+ # Performance cops
335
+ # ----------------------------------------
254
336
  Performance/AncestorsInclude:
255
337
  Enabled: false
256
338
  Performance/ArraySemiInfiniteRangeSlice:
@@ -267,6 +349,8 @@ Performance/ConstantRegexp:
267
349
  Enabled: true
268
350
  Performance/MapCompact:
269
351
  Enabled: true
352
+ Performance/MapMethodChain:
353
+ Enabled: true
270
354
  Performance/MethodObjectAsBlock:
271
355
  Enabled: true
272
356
  Performance/RedundantEqualityComparisonBlock:
@@ -288,23 +372,27 @@ Performance/StringIdentifierArgument:
288
372
  Performance/StringInclude:
289
373
  Enabled: true
290
374
  Exclude:
291
- - lib/jekyll/utils/platforms.rb
375
+ - lib/jekyll/utils/platforms.rb
292
376
  Performance/Sum:
293
377
  Enabled: true
294
378
 
379
+ # Security cops
380
+ # ----------------------------------------
295
381
  Security/CompoundHash:
296
382
  Enabled: true
297
383
  Security/IoMethods:
298
384
  Enabled: true
299
385
  Security/MarshalLoad:
300
386
  Exclude:
301
- - !ruby/regexp /test\/.*.rb$/
302
- - lib/jekyll/regenerator.rb
387
+ - lib/jekyll/regenerator.rb
388
+ - test/**/*.rb
303
389
  Security/YAMLLoad:
304
390
  Exclude:
305
- - !ruby/regexp /features\/.*.rb/
306
- - !ruby/regexp /test\/.*.rb$/
391
+ - features/**/*.rb
392
+ - test/**/*.rb
307
393
 
394
+ # Style cops
395
+ # ----------------------------------------
308
396
  Style/AccessModifierDeclarations:
309
397
  Enabled: false
310
398
  Style/AccessorGrouping:
@@ -317,21 +405,25 @@ Style/ArgumentsForwarding:
317
405
  Enabled: false
318
406
  Style/ArrayCoercion:
319
407
  Enabled: true
408
+ Style/ArrayIntersect:
409
+ Enabled: true
320
410
  Style/BisectedAttrAccessor:
321
411
  Enabled: true
322
412
  Style/CaseLikeIf:
323
413
  Enabled: true
324
- Style/StringChars:
325
- Enabled: true
326
414
  Style/ClassAndModuleChildren:
327
415
  Exclude:
328
- - test/**/*.rb
416
+ - test/**/*.rb
329
417
  Style/ClassEqualityComparison:
330
418
  Enabled: true
331
419
  Style/CollectionCompact:
332
420
  Enabled: true
333
421
  Style/CombinableLoops:
334
422
  Enabled: true
423
+ Style/ConcatArrayLiterals:
424
+ Enabled: true
425
+ Style/DirEmpty:
426
+ Enabled: true
335
427
  Style/DocumentDynamicEvalDefinition:
336
428
  Enabled: true
337
429
  Style/Documentation:
@@ -342,25 +434,29 @@ Style/EmptyHeredoc:
342
434
  Enabled: true
343
435
  Style/EndlessMethod:
344
436
  Enabled: true
437
+ Style/EnvHome:
438
+ Enabled: true
439
+ Style/ExactRegexpMatch:
440
+ Enabled: true
345
441
  Style/ExplicitBlockArgument:
346
442
  Enabled: false
347
443
  Style/ExponentialNotation:
348
444
  Enabled: true
349
- Style/EnvHome:
350
- Enabled: true
351
445
  Style/FetchEnvVar:
352
446
  Enabled: false
447
+ Style/FileEmpty:
448
+ Enabled: true
353
449
  Style/FileRead:
354
450
  Enabled: false
451
+ Style/FileWrite:
452
+ Enabled: true
355
453
  Style/FormatStringToken:
356
454
  Exclude:
357
- - lib/jekyll/utils/ansi.rb
358
- - lib/jekyll/liquid_renderer/table.rb
359
- - lib/jekyll/profiler.rb
455
+ - lib/jekyll/liquid_renderer/table.rb
456
+ - lib/jekyll/profiler.rb
457
+ - lib/jekyll/utils/ansi.rb
360
458
  Style/FrozenStringLiteralComment:
361
459
  EnforcedStyle: always
362
- Style/FileWrite:
363
- Enabled: true
364
460
  Style/GlobalStdStream:
365
461
  Enabled: true
366
462
  Style/GuardClause:
@@ -368,7 +464,7 @@ Style/GuardClause:
368
464
  Style/HashAsLastArrayItem:
369
465
  Enabled: true
370
466
  Style/HashConversion:
371
- Enabled: true
467
+ Enabled: true
372
468
  Style/HashEachMethods:
373
469
  Enabled: true
374
470
  Style/HashExcept:
@@ -392,9 +488,11 @@ Style/MapCompactWithConditionalBlock:
392
488
  Enabled: true
393
489
  Style/MapToHash:
394
490
  Enabled: true
491
+ Style/MinMaxComparison:
492
+ Enabled: true
395
493
  Style/MixinUsage:
396
494
  Exclude:
397
- - test/helper.rb
495
+ - test/helper.rb
398
496
  Style/ModuleFunction:
399
497
  Enabled: false
400
498
  Style/MultilineTernaryOperator:
@@ -405,61 +503,94 @@ Style/NestedFileDirname:
405
503
  Enabled: true
406
504
  Style/NilLambda:
407
505
  Enabled: true
506
+ Style/ObjectThen:
507
+ Enabled: true
508
+ Style/OperatorMethodCall:
509
+ Enabled: true
408
510
  Style/OptionalBooleanParameter:
409
511
  Enabled: true
410
512
  Exclude:
411
- - lib/jekyll/log_adapter.rb
513
+ - lib/jekyll/log_adapter.rb
412
514
  Style/PercentLiteralDelimiters:
413
515
  PreferredDelimiters:
414
516
  "%Q": "{}"
415
- "%W": ()
517
+ "%W": "()"
416
518
  "%q": "{}"
417
519
  "%r": "!!"
418
- "%s": ()
419
- "%w": ()
420
- "%x": ()
520
+ "%s": "()"
521
+ "%w": "()"
522
+ "%x": "()"
421
523
  Style/QuotedSymbols:
422
524
  Enabled: true
423
525
  Style/RedundantArgument:
424
526
  Enabled: true
527
+ Style/RedundantArrayConstructor:
528
+ Enabled: true
425
529
  Style/RedundantAssignment:
426
530
  Enabled: true
531
+ Style/RedundantConstantBase:
532
+ Enabled: true
533
+ Style/RedundantCurrentDirectoryInPath:
534
+ Enabled: true
535
+ Style/RedundantDoubleSplatHashBraces:
536
+ Enabled: true
537
+ Style/RedundantEach:
538
+ Enabled: true
427
539
  Style/RedundantFetchBlock:
428
540
  Enabled: false
429
541
  Style/RedundantFileExtensionInRequire:
430
542
  Enabled: true
543
+ Style/RedundantFilterChain:
544
+ Enabled: true
545
+ Style/RedundantHeredocDelimiterQuotes:
546
+ Enabled: true
431
547
  Style/RedundantInitialize:
432
548
  Enabled: true
433
549
  Exclude:
434
- - lib/jekyll/plugin.rb
550
+ - lib/jekyll/plugin.rb
551
+ Style/RedundantLineContinuation:
552
+ Enabled: true
553
+ Style/RedundantRegexpArgument:
554
+ Enabled: true
435
555
  Style/RedundantRegexpCharacterClass:
436
556
  Enabled: true
557
+ Style/RedundantRegexpConstructor:
558
+ Enabled: true
437
559
  Style/RedundantRegexpEscape:
438
560
  Enabled: true
439
561
  Style/RedundantSelfAssignment:
440
562
  Enabled: true
441
563
  Style/RedundantSelfAssignmentBranch:
442
564
  Enabled: true
565
+ Style/RedundantStringEscape:
566
+ Enabled: true
443
567
  Style/RegexpLiteral:
444
568
  EnforcedStyle: percent_r
445
569
  Style/RescueModifier:
446
570
  Enabled: false
571
+ Style/ReturnNilInPredicateMethodDefinition:
572
+ Enabled: true
447
573
  Style/SafeNavigation:
448
574
  Exclude:
449
- - lib/jekyll/document.rb
575
+ - lib/jekyll/document.rb
576
+ - lib/jekyll/page.rb
450
577
  Style/SignalException:
451
578
  EnforcedStyle: only_raise
452
579
  Style/SingleArgumentDig:
453
580
  Enabled: true
581
+ Style/SingleLineDoEndBlock:
582
+ Enabled: true
454
583
  Style/SlicingWithRange:
455
584
  Enabled: false
456
585
  Style/SoleNestedConditional:
457
586
  Enabled: true
587
+ Style/StringChars:
588
+ Enabled: true
458
589
  Style/StringConcatenation:
459
590
  Enabled: true
460
591
  Exclude:
461
- - lib/jekyll/commands/*.rb
462
- - test/**/*.rb
592
+ - lib/jekyll/commands/*.rb
593
+ - test/**/*.rb
463
594
  Style/StringLiterals:
464
595
  EnforcedStyle: double_quotes
465
596
  Style/StringLiteralsInInterpolation:
@@ -28,7 +28,7 @@ module Jekyll
28
28
  "the server is started.",],
29
29
  "livereload" => ["-l", "--livereload",
30
30
  "Use LiveReload to automatically refresh browsers",],
31
- "livereload_ignore" => ["--livereload-ignore ignore GLOB1[,GLOB2[,...]]",
31
+ "livereload_ignore" => ["--livereload-ignore GLOB1[,GLOB2[,...]]",
32
32
  Array,
33
33
  "Files for LiveReload to ignore. " \
34
34
  "Remember to quote the values so your shell " \
@@ -71,7 +71,6 @@ module Jekyll
71
71
  end
72
72
 
73
73
  cmd.action do |_, opts|
74
- opts["livereload_port"] ||= LIVERELOAD_PORT
75
74
  opts["serving"] = true
76
75
  opts["watch"] = true unless opts.key?("watch")
77
76
 
@@ -94,6 +93,7 @@ module Jekyll
94
93
  opts = configuration_from_options(opts)
95
94
  destination = opts["destination"]
96
95
  if opts["livereload"]
96
+ opts["livereload_port"] ||= LIVERELOAD_PORT
97
97
  validate_options(opts)
98
98
  register_reload_hooks(opts)
99
99
  end
@@ -138,7 +138,6 @@ module Jekyll
138
138
  end
139
139
  end
140
140
 
141
- # rubocop:disable Metrics/AbcSize
142
141
  def register_reload_hooks(opts)
143
142
  require_relative "serve/live_reload_reactor"
144
143
  @reload_reactor = LiveReloadReactor.new
@@ -160,7 +159,7 @@ module Jekyll
160
159
  if @changed_pages && @reload_reactor && @reload_reactor.running?
161
160
  ignore, @changed_pages = @changed_pages.partition do |p|
162
161
  Array(opts["livereload_ignore"]).any? do |filter|
163
- File.fnmatch(filter, Jekyll.sanitized_path(p.relative_path))
162
+ File.fnmatch(filter, p.relative_path)
164
163
  end
165
164
  end
166
165
  Jekyll.logger.debug "LiveReload:", "Ignoring #{ignore.map(&:relative_path)}"
@@ -169,7 +168,6 @@ module Jekyll
169
168
  @changed_pages = nil
170
169
  end
171
170
  end
172
- # rubocop:enable Metrics/AbcSize
173
171
 
174
172
  # Do a base pre-setup of WEBRick so that everything is in place
175
173
  # when we get ready to party, checking for an setting up an error page
@@ -274,12 +272,19 @@ module Jekyll
274
272
  def boot_or_detach(server, opts)
275
273
  if opts["detach"]
276
274
  pid = Process.fork do
275
+ # Detach the process from controlling terminal
276
+ $stdin.reopen("/dev/null", "r")
277
+ $stdout.reopen("/dev/null", "w")
278
+ $stderr.reopen("/dev/null", "w")
277
279
  server.start
278
280
  end
279
281
 
280
282
  Process.detach(pid)
281
283
  Jekyll.logger.info "Server detached with pid '#{pid}'.",
282
284
  "Run `pkill -f jekyll' or `kill -9 #{pid}' to stop the server."
285
+
286
+ # Exit without running `at_exit` inherited by the forked process.
287
+ Process.exit! 0
283
288
  else
284
289
  t = Thread.new { server.start }
285
290
  trap("INT") { server.shutdown }
@@ -280,7 +280,8 @@ module Jekyll
280
280
  return self[key] if key?(key)
281
281
  raise KeyError, %(key not found: "#{key}") if default.nil? && block.nil?
282
282
  return yield(key) unless block.nil?
283
- return default unless default.nil?
283
+
284
+ default unless default.nil?
284
285
  end
285
286
 
286
287
  private
@@ -441,6 +441,14 @@ module Jekyll
441
441
  property.split(".").reduce(liquid_data) do |data, key|
442
442
  data.respond_to?(:[]) && data[key]
443
443
  end
444
+ rescue TypeError => e
445
+ msg = if liquid_data.is_a?(Array)
446
+ "Error accessing object (#{liquid_data.to_s[0...20]}) with given key. Expected an " \
447
+ "integer but got #{property.inspect} instead."
448
+ else
449
+ e.message
450
+ end
451
+ raise e, msg
444
452
  end
445
453
 
446
454
  FLOAT_LIKE = %r!\A\s*-?(?:\d+\.?\d*|\.\d+)\s*\Z!.freeze
@@ -109,7 +109,7 @@ module Jekyll
109
109
  sanitized_path = sanitize_path(path)
110
110
 
111
111
  if rel_scope_path.include?("*")
112
- glob_scope(sanitized_path, rel_scope_path)
112
+ File.fnmatch?(strip_collections_dir(rel_scope_path), sanitized_path)
113
113
  else
114
114
  path_is_subpath?(sanitized_path, strip_collections_dir(rel_scope_path))
115
115
  end
@@ -83,7 +83,7 @@ module Jekyll
83
83
  # Returns an array of strings, each string being the name of a gem name
84
84
  # that is allowed to be used.
85
85
  def whitelist
86
- @whitelist ||= Array[site.config["whitelist"]].flatten
86
+ @whitelist ||= [site.config["whitelist"]].flatten
87
87
  end
88
88
 
89
89
  # Require all .rb files if safe mode is off
data/lib/jekyll/site.rb CHANGED
@@ -49,7 +49,7 @@ module Jekyll
49
49
 
50
50
  %w(safe lsi highlighter baseurl exclude include future unpublished
51
51
  show_drafts limit_posts keep_files).each do |opt|
52
- send("#{opt}=", config[opt])
52
+ send(:"#{opt}=", config[opt])
53
53
  end
54
54
 
55
55
  # keep using `gems` to avoid breaking change
@@ -486,7 +486,7 @@ module Jekyll
486
486
  # Returns nothing
487
487
  def limit_posts!
488
488
  if limit_posts.positive?
489
- limit = posts.docs.length < limit_posts ? posts.docs.length : limit_posts
489
+ limit = [posts.docs.length, limit_posts].min
490
490
  posts.docs = posts.docs[-limit, limit]
491
491
  end
492
492
  end
@@ -4,7 +4,9 @@ module Jekyll
4
4
  class StaticFile
5
5
  extend Forwardable
6
6
 
7
- attr_reader :relative_path, :extname, :name
7
+ attr_reader :relative_path, :extname,
8
+ :type, # Returns the type of the collection if present, nil otherwise.
9
+ :name
8
10
 
9
11
  def_delegator :to_liquid, :to_json, :to_json
10
12
 
@@ -34,6 +36,7 @@ module Jekyll
34
36
  @collection = collection
35
37
  @relative_path = File.join(*[@dir, @name].compact)
36
38
  @extname = File.extname(@name)
39
+ @type = @collection&.label&.to_sym
37
40
  end
38
41
  # rubocop: enable Metrics/ParameterLists
39
42
 
@@ -171,11 +174,6 @@ module Jekyll
171
174
  end
172
175
  end
173
176
 
174
- # Returns the type of the collection if present, nil otherwise.
175
- def type
176
- @type ||= @collection.nil? ? nil : @collection.label.to_sym
177
- end
178
-
179
177
  # Returns the front matter defaults defined for the file's URL and/or type
180
178
  # as defined in _config.yml.
181
179
  def defaults
@@ -23,7 +23,9 @@ module Jekyll
23
23
 
24
24
  #{markup}
25
25
 
26
- Valid syntax: highlight <lang> [linenos]
26
+ Valid syntax: highlight <lang> [linenos] [mark_lines="3 4 5"]
27
+
28
+ See https://jekyllrb.com/docs/liquid/tags/#code-snippet-highlighting for more details.
27
29
  MSG
28
30
  end
29
31
  end
@@ -80,32 +82,45 @@ module Jekyll
80
82
 
81
83
  def render_rouge(code)
82
84
  require "rouge"
83
- formatter = ::Rouge::Formatters::HTML.new
84
- if @highlight_options[:linenos]
85
- formatter = ::Rouge::Formatters::HTMLTable.new(
86
- formatter,
87
- {
88
- :css_class => "highlight",
89
- :gutter_class => "gutter",
90
- :code_class => "code",
91
- }
92
- )
93
- end
94
- lexer = ::Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText
85
+ formatter = Rouge::Formatters::HTML.new
86
+ formatter = line_highlighter_formatter(formatter) if @highlight_options[:mark_lines]
87
+ formatter = table_formatter(formatter) if @highlight_options[:linenos]
88
+
89
+ lexer = Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText
95
90
  formatter.format(lexer.lex(code))
96
91
  end
97
92
 
93
+ def line_highlighter_formatter(formatter)
94
+ Rouge::Formatters::HTMLLineHighlighter.new(
95
+ formatter,
96
+ :highlight_lines => mark_lines
97
+ )
98
+ end
99
+
100
+ def mark_lines
101
+ value = @highlight_options[:mark_lines]
102
+ return value.map(&:to_i) if value.is_a?(Array)
103
+
104
+ raise SyntaxError, "Syntax Error for mark_lines declaration. Expected a " \
105
+ "double-quoted list of integers."
106
+ end
107
+
108
+ def table_formatter(formatter)
109
+ Rouge::Formatters::HTMLTable.new(
110
+ formatter,
111
+ :css_class => "highlight",
112
+ :gutter_class => "gutter",
113
+ :code_class => "code"
114
+ )
115
+ end
116
+
98
117
  def render_codehighlighter(code)
99
118
  h(code).strip
100
119
  end
101
120
 
102
121
  def add_code_tag(code)
103
- code_attributes = [
104
- "class=\"language-#{@lang.to_s.tr("+", "-")}\"",
105
- "data-lang=\"#{@lang}\"",
106
- ].join(" ")
107
- "<figure class=\"highlight\"><pre><code #{code_attributes}>" \
108
- "#{code.chomp}</code></pre></figure>"
122
+ code_attrs = %(class="language-#{@lang.tr("+", "-")}" data-lang="#{@lang}")
123
+ %(<figure class="highlight"><pre><code #{code_attrs}>#{code.chomp}</code></pre></figure>)
109
124
  end
110
125
  end
111
126
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jekyll
4
- VERSION = "4.3.4"
4
+ VERSION = "4.4.0"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  permalink: /404.html
3
- layout: default
3
+ layout: page
4
4
  ---
5
5
 
6
6
  <style type="text/css" media="screen">
@@ -26,8 +26,11 @@ module RuboCop
26
26
  # @alpha.omega
27
27
  # )
28
28
  #
29
- class AssertEqualLiteralActual < Cop
30
- MSG = "Provide the 'expected value' as the first argument to `assert_equal`.".freeze
29
+ class AssertEqualLiteralActual < Base
30
+ extend AutoCorrector
31
+
32
+ MSG = "Provide the 'expected value' as the first argument to `assert_equal`."
33
+ RESTRICT_ON_SEND = %i[assert_equal].freeze
31
34
 
32
35
  SIMPLE_LITERALS = %i(
33
36
  true
@@ -61,12 +64,10 @@ module RuboCop
61
64
 
62
65
  def on_send(node)
63
66
  return unless literal_actual?(node) || literal_actual_with_msg?(node)
64
- add_offense(node, location: :expression)
65
- end
66
67
 
67
- def autocorrect(node)
68
- lambda do |corrector|
69
- corrector.replace(node.loc.expression, replacement(node))
68
+ range = node.loc.expression
69
+ add_offense(range) do |corrector|
70
+ corrector.replace(range, replacement(node))
70
71
  end
71
72
  end
72
73
 
@@ -1,20 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rubocop"
4
-
5
3
  module RuboCop
6
4
  module Cop
7
5
  module Jekyll
8
- class NoPAllowed < Cop
9
- MSG = "Avoid using `p` to print things. Use `Jekyll.logger` instead.".freeze
6
+ class NoPAllowed < Base
7
+ MSG = "Avoid using `p` to print things. Use `Jekyll.logger` instead."
8
+ RESTRICT_ON_SEND = %i[p].freeze
10
9
 
11
10
  def_node_search :p_called?, <<-PATTERN
12
- (send _ :p _)
11
+ (send _ :p _)
13
12
  PATTERN
14
13
 
15
14
  def on_send(node)
16
15
  if p_called?(node)
17
- add_offense(node, :location => :selector)
16
+ add_offense(node.loc.selector)
18
17
  end
19
18
  end
20
19
  end
@@ -1,20 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rubocop"
4
-
5
3
  module RuboCop
6
4
  module Cop
7
5
  module Jekyll
8
- class NoPutsAllowed < Cop
9
- MSG = "Avoid using `puts` to print things. Use `Jekyll.logger` instead.".freeze
6
+ class NoPutsAllowed < Base
7
+ MSG = "Avoid using `puts` to print things. Use `Jekyll.logger` instead."
8
+ RESTRICT_ON_SEND = %i[puts].freeze
10
9
 
11
10
  def_node_search :puts_called?, <<-PATTERN
12
- (send nil? :puts _)
11
+ (send nil? :puts _)
13
12
  PATTERN
14
13
 
15
14
  def on_send(node)
16
15
  if puts_called?(node)
17
- add_offense(node, :location => :selector)
16
+ add_offense(node.loc.selector)
18
17
  end
19
18
  end
20
19
  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.3.4
4
+ version: 4.4.0
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: 2024-09-16 00:00:00.000000000 Z
13
+ date: 2025-01-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -26,6 +26,20 @@ dependencies:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
28
  version: '2.4'
29
+ - !ruby/object:Gem::Dependency
30
+ name: base64
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '0.2'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.2'
29
43
  - !ruby/object:Gem::Dependency
30
44
  name: colorator
31
45
  requirement: !ruby/object:Gem::Requirement
@@ -40,6 +54,20 @@ dependencies:
40
54
  - - "~>"
41
55
  - !ruby/object:Gem::Version
42
56
  version: '1.0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: csv
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '3.0'
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '3.0'
43
71
  - !ruby/object:Gem::Dependency
44
72
  name: em-websocket
45
73
  requirement: !ruby/object:Gem::Requirement
@@ -102,6 +130,20 @@ dependencies:
102
130
  - - "~>"
103
131
  - !ruby/object:Gem::Version
104
132
  version: '2.0'
133
+ - !ruby/object:Gem::Dependency
134
+ name: json
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '2.6'
140
+ type: :runtime
141
+ prerelease: false
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '2.6'
105
147
  - !ruby/object:Gem::Dependency
106
148
  name: kramdown
107
149
  requirement: !ruby/object:Gem::Requirement
@@ -154,22 +196,22 @@ dependencies:
154
196
  name: mercenary
155
197
  requirement: !ruby/object:Gem::Requirement
156
198
  requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '0.3'
157
202
  - - ">="
158
203
  - !ruby/object:Gem::Version
159
204
  version: 0.3.6
160
- - - "<"
161
- - !ruby/object:Gem::Version
162
- version: '0.5'
163
205
  type: :runtime
164
206
  prerelease: false
165
207
  version_requirements: !ruby/object:Gem::Requirement
166
208
  requirements:
209
+ - - "~>"
210
+ - !ruby/object:Gem::Version
211
+ version: '0.3'
167
212
  - - ">="
168
213
  - !ruby/object:Gem::Version
169
214
  version: 0.3.6
170
- - - "<"
171
- - !ruby/object:Gem::Version
172
- version: '0.5'
173
215
  - !ruby/object:Gem::Dependency
174
216
  name: pathutil
175
217
  requirement: !ruby/object:Gem::Requirement
@@ -394,7 +436,7 @@ metadata:
394
436
  bug_tracker_uri: https://github.com/jekyll/jekyll/issues
395
437
  changelog_uri: https://github.com/jekyll/jekyll/releases
396
438
  homepage_uri: https://jekyllrb.com
397
- post_install_message:
439
+ post_install_message:
398
440
  rdoc_options:
399
441
  - "--charset=UTF-8"
400
442
  require_paths:
@@ -403,7 +445,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
403
445
  requirements:
404
446
  - - ">="
405
447
  - !ruby/object:Gem::Version
406
- version: 2.5.0
448
+ version: 2.7.0
407
449
  required_rubygems_version: !ruby/object:Gem::Requirement
408
450
  requirements:
409
451
  - - ">="
@@ -411,7 +453,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
411
453
  version: 2.7.0
412
454
  requirements: []
413
455
  rubygems_version: 3.1.6
414
- signing_key:
456
+ signing_key:
415
457
  specification_version: 4
416
458
  summary: A simple, blog aware, static site generator.
417
459
  test_files: []