liquid 5.6.1 → 5.6.3

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: f56c8d1a7b6c038267d7e838aae2d8dba5c99e5fbb563d1163966cbbc9b60673
4
- data.tar.gz: c26e7a9288ee25b325ff6f2db4d21b8ed4f9ad97eb64f1aebeefd971e5c5bc46
3
+ metadata.gz: e94dfc486078f8382dda61acab0aeeb632c80a60e77eccb69b6648cd805ee846
4
+ data.tar.gz: 6441533cb1929fdae33fbe996cc94a977f83cd9acb2675c49b2ef7a5bf75886f
5
5
  SHA512:
6
- metadata.gz: a81801d7e2976bd5825e19349a410c5800e85c30d31502da013cab9b95fff5cdeb7debcd9e7ccedee4a3056456ed3433a3c8751258f89c9a24c8b46a223e2f19
7
- data.tar.gz: b81704d1039698ce2e0391ad2bfbb6d69daba677dfbc1d4180bb7b6a4018981ed7984af44b64de84d8c745561cacf86999a1f326d1045296d696c5b62edd8849
6
+ metadata.gz: b990bba340432ee1d227f3784812d344be76afb8cdf77ce44138a4bceee25ab01ff799c4e716bbe68842b31bcabfb462cf2212bac364d88424adbace0b6767ee
7
+ data.tar.gz: 4093fe9102def533ae9e449fbb372d079e02ad7309bb9a297e1724ae69ed520eb5b108b0f6697d109a04088ba5bec7d55a55641182bda0ae699e2d27361050b6
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lru_redux"
4
-
5
3
  module Liquid
6
4
  # Context keeps the variable stack and resolves variables, as well as keywords
7
5
  #
@@ -41,7 +39,6 @@ module Liquid
41
39
  @filters = []
42
40
  @global_filter = nil
43
41
  @disabled_tags = {}
44
- @expression_cache = LruRedux::ThreadSafeCache.new(1000)
45
42
 
46
43
  # Instead of constructing new StringScanner objects for each Expression parse,
47
44
  # we recycle the same one.
@@ -183,7 +180,7 @@ module Liquid
183
180
  # Example:
184
181
  # products == empty #=> products.empty?
185
182
  def [](expression)
186
- evaluate(Expression.parse(expression, @string_scanner, @expression_cache))
183
+ evaluate(Expression.parse(expression, @string_scanner))
187
184
  end
188
185
 
189
186
  def key?(key)
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lru_redux"
4
-
5
3
  module Liquid
6
4
  class Expression
7
5
  LITERALS = {
@@ -79,10 +77,17 @@ module Liquid
79
77
  end
80
78
 
81
79
  ss.string = markup
82
- # the first byte must be a digit, a period, or a dash
80
+ # the first byte must be a digit or a dash
83
81
  byte = ss.scan_byte
84
82
 
85
- return false if byte != DASH && byte != DOT && (byte < ZERO || byte > NINE)
83
+ return false if byte != DASH && (byte < ZERO || byte > NINE)
84
+
85
+ if byte == DASH
86
+ peek_byte = ss.peek_byte
87
+
88
+ # if it starts with a dash, the next byte must be a digit
89
+ return false if peek_byte.nil? || !(peek_byte >= ZERO && peek_byte <= NINE)
90
+ end
86
91
 
87
92
  # The markup could be a float with multiple dots
88
93
  first_dot_pos = nil
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Liquid
5
- VERSION = "5.6.1"
5
+ VERSION = "5.6.3"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.1
4
+ version: 5.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Lütke