liquid 5.8.4 → 5.8.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b21ab22edb08e63058c7d7658a67d71b7ea86e7d5b14c04e0f0d9094f016a02d
4
- data.tar.gz: 150312cb3ae35757ee0db8f24ac3e7166a6da38258d129f3cd8caa4e71d55ccf
3
+ metadata.gz: 63f8fefe364591ebb5607eb04d7a5deb207750a999b39a804c3fa280e1d447f0
4
+ data.tar.gz: 7ab7815719a685e943681d972ccfc7bac6d854b4aec65ab278f2daf85b6f065a
5
5
  SHA512:
6
- metadata.gz: 2baca28147b3a1ff5e6366260468d86876cdf3b1ef2700994abb2bf7feaefa51214eb2541685dc390f21806c6781d2d161e5bc3a4afa0f1575fdc1462129e2f5
7
- data.tar.gz: fd2d398969cee1ca649a0aecab0275fa5b018e79fee8901217baf805e49d6cc6ba305e9fc7e1afed68d66be020be3946bd608b1b664b6684000e024434bf5910
6
+ metadata.gz: a8d60d8b8a80527f0ca9f09bb57e984e0991754f023f304fd168e134b1660b71b92edc93b3ea8daf566e5cdb62d1586aef709c526fa596e7e6d4df15745f1231
7
+ data.tar.gz: 1cb24c81cbd74c6cd8e1b42c61b138e939b5f7c43e34545d4ba1d45aa5aa8b42843d7722b17a3f7c48793fda357b49504dbb676c47f901d27c9961661af0805f
@@ -386,7 +386,6 @@ module Liquid
386
386
  end
387
387
  elsif ary.all? { |el| el.respond_to?(:[]) }
388
388
  begin
389
- property = Utils.to_s(property)
390
389
  ary.sort { |a, b| nil_safe_compare(a[property], b[property]) }
391
390
  rescue TypeError
392
391
  raise_property_error(property)
@@ -416,7 +415,6 @@ module Liquid
416
415
  end
417
416
  elsif ary.all? { |el| el.respond_to?(:[]) }
418
417
  begin
419
- property = Utils.to_s(property)
420
418
  ary.sort { |a, b| nil_safe_casecmp(a[property], b[property]) }
421
419
  rescue TypeError
422
420
  raise_property_error(property)
@@ -504,7 +502,6 @@ module Liquid
504
502
  elsif ary.empty? # The next two cases assume a non-empty array.
505
503
  []
506
504
  else
507
- property = Utils.to_s(property)
508
505
  ary.uniq do |item|
509
506
  item[property]
510
507
  rescue TypeError
@@ -536,11 +533,6 @@ module Liquid
536
533
  # @liquid_syntax array | map: string
537
534
  # @liquid_return [array[untyped]]
538
535
  def map(input, property)
539
- property = Utils.to_s(property)
540
-
541
- # Return the input array if property is empty (no-op)
542
- return InputIterator.new(input, context).to_a if property.empty?
543
-
544
536
  InputIterator.new(input, context).map do |e|
545
537
  e = e.call if e.is_a?(Proc)
546
538
 
@@ -570,7 +562,6 @@ module Liquid
570
562
  elsif ary.empty? # The next two cases assume a non-empty array.
571
563
  []
572
564
  else
573
- property = Liquid::Utils.to_s(property)
574
565
  ary.reject do |item|
575
566
  item[property].nil?
576
567
  rescue TypeError
@@ -960,8 +951,6 @@ module Liquid
960
951
  # @liquid_syntax array | sum
961
952
  # @liquid_return [number]
962
953
  def sum(input, property = nil)
963
- property = property.nil? ? nil : Utils.to_s(property)
964
-
965
954
  ary = InputIterator.new(input, context)
966
955
  return 0 if ary.empty?
967
956
 
@@ -990,6 +979,7 @@ module Liquid
990
979
 
991
980
  def filter_array(input, property, target_value, default_value = [], &block)
992
981
  ary = InputIterator.new(input, context)
982
+
993
983
  return default_value if ary.empty?
994
984
 
995
985
  property = Utils.to_s(property)
@@ -1009,7 +999,7 @@ module Liquid
1009
999
  end
1010
1000
 
1011
1001
  def raise_property_error(property)
1012
- raise Liquid::ArgumentError, "cannot select the property '#{property}'"
1002
+ raise Liquid::ArgumentError, "cannot select the property '#{Utils.to_s(property)}'"
1013
1003
  end
1014
1004
 
1015
1005
  def apply_operation(input, operand, operation)
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Liquid
5
- VERSION = "5.8.4"
5
+ VERSION = "5.8.5"
6
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.8.4
4
+ version: 5.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Lütke
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-09 00:00:00.000000000 Z
10
+ date: 2025-04-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: strscan