liquid 5.8.4 → 5.8.6

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: c72fe05240f10e6ba8055bd37a8aab224c267c448fddfbe442088a543de9f300
4
+ data.tar.gz: 978c42cfc22bff685a7aca5444cb90cc4e8664966c9c6653b20fe2bacfa1eb0e
5
5
  SHA512:
6
- metadata.gz: 2baca28147b3a1ff5e6366260468d86876cdf3b1ef2700994abb2bf7feaefa51214eb2541685dc390f21806c6781d2d161e5bc3a4afa0f1575fdc1462129e2f5
7
- data.tar.gz: fd2d398969cee1ca649a0aecab0275fa5b018e79fee8901217baf805e49d6cc6ba305e9fc7e1afed68d66be020be3946bd608b1b664b6684000e024434bf5910
6
+ metadata.gz: 3dfc1921f76f20ceff572098f627dbea6d40685bd0ba97739df8900d6e2842d5f4d9e6a870852a26da11d044c86058c85aae87f2058195234218b2b9ccb4f217
7
+ data.tar.gz: 5639f869fd8859b67651f0a7c2f8f2d69742a963766e031dddfb0aba032ce5791003fb50894f4b0d9bc1dfe55476488e8d17f54de45317ce3790043441715cf8
@@ -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,9 +979,8 @@ module Liquid
990
979
 
991
980
  def filter_array(input, property, target_value, default_value = [], &block)
992
981
  ary = InputIterator.new(input, context)
993
- return default_value if ary.empty?
994
982
 
995
- property = Utils.to_s(property)
983
+ return default_value if ary.empty?
996
984
 
997
985
  block.call(ary) do |item|
998
986
  if target_value.nil?
@@ -1009,7 +997,7 @@ module Liquid
1009
997
  end
1010
998
 
1011
999
  def raise_property_error(property)
1012
- raise Liquid::ArgumentError, "cannot select the property '#{property}'"
1000
+ raise Liquid::ArgumentError, "cannot select the property '#{Utils.to_s(property)}'"
1013
1001
  end
1014
1002
 
1015
1003
  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.6"
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.6
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: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: strscan
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: 1.3.7
161
161
  requirements: []
162
- rubygems_version: 3.6.6
162
+ rubygems_version: 3.6.8
163
163
  specification_version: 4
164
164
  summary: A secure, non-evaling end user template engine with aesthetic markup.
165
165
  test_files: []