liquid 5.8.2 → 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: 7f97ab28ad2792ea056687b9879110d166b0617add41fdf3f590e3b90bfbf176
4
- data.tar.gz: 97361f583e5ac620bc70a195c92dea7346174a77928e365dc787ed99e576209e
3
+ metadata.gz: c72fe05240f10e6ba8055bd37a8aab224c267c448fddfbe442088a543de9f300
4
+ data.tar.gz: 978c42cfc22bff685a7aca5444cb90cc4e8664966c9c6653b20fe2bacfa1eb0e
5
5
  SHA512:
6
- metadata.gz: 1afca81c6258b41da81eed6757992df8e68a5df0222a91fbd9754595bc824e1f5d7a40dccdc3aef1e554084eb21b92d99b9c8f03334d1fd830d15381bd5539d4
7
- data.tar.gz: d87c729523f2b1d31c7e509570a6e0becb0679d80292afedc2f9bf5278883ef748c107fb705b2dd11af21a5f7fc18423c7b08573032ef6062ecb24af37bf4c03
6
+ metadata.gz: 3dfc1921f76f20ceff572098f627dbea6d40685bd0ba97739df8900d6e2842d5f4d9e6a870852a26da11d044c86058c85aae87f2058195234218b2b9ccb4f217
7
+ data.tar.gz: 5639f869fd8859b67651f0a7c2f8f2d69742a963766e031dddfb0aba032ce5791003fb50894f4b0d9bc1dfe55476488e8d17f54de45317ce3790043441715cf8
@@ -3,7 +3,6 @@
3
3
  require 'cgi'
4
4
  require 'base64'
5
5
  require 'bigdecimal'
6
-
7
6
  module Liquid
8
7
  module StandardFilters
9
8
  MAX_I32 = (1 << 31) - 1
@@ -387,7 +386,6 @@ module Liquid
387
386
  end
388
387
  elsif ary.all? { |el| el.respond_to?(:[]) }
389
388
  begin
390
- property = Utils.to_s(property)
391
389
  ary.sort { |a, b| nil_safe_compare(a[property], b[property]) }
392
390
  rescue TypeError
393
391
  raise_property_error(property)
@@ -417,7 +415,6 @@ module Liquid
417
415
  end
418
416
  elsif ary.all? { |el| el.respond_to?(:[]) }
419
417
  begin
420
- property = Utils.to_s(property)
421
418
  ary.sort { |a, b| nil_safe_casecmp(a[property], b[property]) }
422
419
  rescue TypeError
423
420
  raise_property_error(property)
@@ -505,7 +502,6 @@ module Liquid
505
502
  elsif ary.empty? # The next two cases assume a non-empty array.
506
503
  []
507
504
  else
508
- property = Utils.to_s(property)
509
505
  ary.uniq do |item|
510
506
  item[property]
511
507
  rescue TypeError
@@ -537,7 +533,6 @@ module Liquid
537
533
  # @liquid_syntax array | map: string
538
534
  # @liquid_return [array[untyped]]
539
535
  def map(input, property)
540
- property = Utils.to_s(property)
541
536
  InputIterator.new(input, context).map do |e|
542
537
  e = e.call if e.is_a?(Proc)
543
538
 
@@ -567,7 +562,6 @@ module Liquid
567
562
  elsif ary.empty? # The next two cases assume a non-empty array.
568
563
  []
569
564
  else
570
- property = Liquid::Utils.to_s(property)
571
565
  ary.reject do |item|
572
566
  item[property].nil?
573
567
  rescue TypeError
@@ -957,8 +951,6 @@ module Liquid
957
951
  # @liquid_syntax array | sum
958
952
  # @liquid_return [number]
959
953
  def sum(input, property = nil)
960
- property = property.nil? ? nil : Utils.to_s(property)
961
-
962
954
  ary = InputIterator.new(input, context)
963
955
  return 0 if ary.empty?
964
956
 
@@ -986,10 +978,8 @@ module Liquid
986
978
  attr_reader :context
987
979
 
988
980
  def filter_array(input, property, target_value, default_value = [], &block)
989
- property = Liquid::Utils.to_s(property)
990
- return default_value if property.empty?
991
-
992
981
  ary = InputIterator.new(input, context)
982
+
993
983
  return default_value if ary.empty?
994
984
 
995
985
  block.call(ary) do |item|
@@ -1007,7 +997,7 @@ module Liquid
1007
997
  end
1008
998
 
1009
999
  def raise_property_error(property)
1010
- raise Liquid::ArgumentError, "cannot select the property '#{property}'"
1000
+ raise Liquid::ArgumentError, "cannot select the property '#{Utils.to_s(property)}'"
1011
1001
  end
1012
1002
 
1013
1003
  def apply_operation(input, operand, operation)
@@ -1079,7 +1069,10 @@ module Liquid
1079
1069
  end
1080
1070
 
1081
1071
  def uniq(&block)
1082
- to_a.uniq(&block)
1072
+ to_a.uniq do |item|
1073
+ item = Utils.to_liquid_value(item)
1074
+ block ? yield(item) : item
1075
+ end
1083
1076
  end
1084
1077
 
1085
1078
  def compact
@@ -10,7 +10,7 @@ module Liquid
10
10
  # @liquid_description
11
11
  # Variables that are declared with `decrement` are unique to the [layout](/themes/architecture/layouts), [template](/themes/architecture/templates),
12
12
  # or [section](/themes/architecture/sections) file that they're created in. However, the variable is shared across
13
- # [snippets](/themes/architecture#snippets) included in the file.
13
+ # [snippets](/themes/architecture/snippets) included in the file.
14
14
  #
15
15
  # Similarly, variables that are created with `decrement` are independent from those created with [`assign`](/docs/api/liquid/tags/assign)
16
16
  # and [`capture`](/docs/api/liquid/tags/capture). However, `decrement` and [`increment`](/docs/api/liquid/tags/increment) share
@@ -6,7 +6,7 @@ module Liquid
6
6
  # @liquid_category theme
7
7
  # @liquid_name include
8
8
  # @liquid_summary
9
- # Renders a [snippet](/themes/architecture#snippets).
9
+ # Renders a [snippet](/themes/architecture/snippets).
10
10
  # @liquid_description
11
11
  # Inside the snippet, you can access and alter variables that are [created](/docs/api/liquid/tags/variable-tags) outside of the
12
12
  # snippet.
@@ -10,7 +10,7 @@ module Liquid
10
10
  # @liquid_description
11
11
  # Variables that are declared with `increment` are unique to the [layout](/themes/architecture/layouts), [template](/themes/architecture/templates),
12
12
  # or [section](/themes/architecture/sections) file that they're created in. However, the variable is shared across
13
- # [snippets](/themes/architecture#snippets) included in the file.
13
+ # [snippets](/themes/architecture/snippets) included in the file.
14
14
  #
15
15
  # Similarly, variables that are created with `increment` are independent from those created with [`assign`](/docs/api/liquid/tags/assign)
16
16
  # and [`capture`](/docs/api/liquid/tags/capture). However, `increment` and [`decrement`](/docs/api/liquid/tags/decrement) share
@@ -6,7 +6,7 @@ module Liquid
6
6
  # @liquid_category theme
7
7
  # @liquid_name render
8
8
  # @liquid_summary
9
- # Renders a [snippet](/themes/architecture#snippets) or [app block](/themes/architecture/sections/section-schema#render-app-blocks).
9
+ # Renders a [snippet](/themes/architecture/snippets) or [app block](/themes/architecture/sections/section-schema#render-app-blocks).
10
10
  # @liquid_description
11
11
  # Inside snippets and app blocks, you can't directly access variables that are [created](/docs/api/liquid/tags/variable-tags) outside
12
12
  # of the snippet or app block. However, you can [specify variables as parameters](/docs/api/liquid/tags/render#render-passing-variables-to-a-snippet)
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Liquid
5
- VERSION = "5.8.2"
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.2
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-03-19 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: []