tess_edit 0.5.16 → 0.5.17

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: f94d3bf110ca08ee76b35571622ff9637dc1c0bd2ebe6959429da9bc37de14ce
4
- data.tar.gz: fe49f2095f43a1238c6a9b4a58ef8e7f099453325a25090ea831821c2573b8d3
3
+ metadata.gz: 81bf024320e1b26b908b234509c20f2d3d0b28486246f677f697a73c004ec464
4
+ data.tar.gz: 6fee53efa892077a3ab1e55111de4d67a827f52091cff03e3c052bae15fc108f
5
5
  SHA512:
6
- metadata.gz: b7e299e82c79d5c321ac33c305305a3398bed106c6b2060eeaebf7fee01370b1dec5f8c859195eaca41912d7c37b85ede67cd21715f490999496c820201a6d56
7
- data.tar.gz: 2f5fbac84e32432ab410de4b731d91fd664be39ba0bd5145707d9418f07380f20b354004137de2cf77c555d4e97dfadd67131397cf7aed326e77290a06a60218
6
+ metadata.gz: ba363c92cb29469719787c21fe62d2d4d2d0fa0c53d9d9764eee878e546ba5e675c9434335f45fb4a1bfb2c5f84de258e7946276743b893a8ceb93d2e8c7e312
7
+ data.tar.gz: 9fa13068fed9c8fe57d31f0abe2834a0f0aa981b5f1cf1600fc700e6c6af2217e7e812105ca7784fcbba74d653b1e8abdd40177de83f007764c99137a023672d
@@ -256,7 +256,7 @@ async function checkPath(path, context, local) {
256
256
  if (!own) {
257
257
  context.roots ||= await variables.options("", context.scope).catch(() => [])
258
258
  if (!context.roots.length) return null
259
- if (!context.roots.some((variable) => variable.name === root)) return { at: 0, length: root.length, message: t("There's no variable %{name}", { name: root }) }
259
+ if (!context.roots.some((variable) => [root, names[0]].includes(variable.name))) return { at: 0, length: root.length, message: t("There's no variable %{name}", { name: root }) }
260
260
  }
261
261
  // Each name after it, as far as its parent's variables are known
262
262
  let at = names[0].length + 1
@@ -266,8 +266,9 @@ async function checkPath(path, context, local) {
266
266
  if (!variable?.children) return null
267
267
  const options = await variables.options(parent, scope).catch(() => [])
268
268
  if (!options.length) return null
269
+ // A method's name may end in ? (screening.payment_needed?), as Liquid allows, with or without it
269
270
  const name = names[i].replace(/\?$/, "")
270
- if (name !== "size" && !options.some((option) => option.name === name)) return { at, length: names[i].length, message: t("%{path} has no %{name}", { path: parent, name }) }
271
+ if (name !== "size" && !options.some((option) => [name, `${name}?`].includes(option.name))) return { at, length: names[i].length, message: t("%{path} has no %{name}", { path: parent, name }) }
271
272
  at += names[i].length + 1
272
273
  }
273
274
  return null
@@ -1,3 +1,3 @@
1
1
  module TessEdit
2
- VERSION = "0.5.16"
2
+ VERSION = "0.5.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tess_edit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.16
4
+ version: 0.5.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt