forest_liana 9.9.0 → 9.9.1

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: 94585933c17d5a8b720c6c32e17e9705733cdf80f9bbe992057a2237f5755660
4
- data.tar.gz: 4d1aad4570b575aa292e043da1bd291203071de3cf30a2239f8755199fb6a189
3
+ metadata.gz: 8aeb54b6b9ba89ae0f00ac71e95e2882ef44c6d468f2e9d21b5a73e21ba58073
4
+ data.tar.gz: 260b24d904ffa85ec49b19e4e03b10f0d97e5dbe43247e86ac844b9ee89cfac0
5
5
  SHA512:
6
- metadata.gz: cca082a9836005e0815cbb365f316271f0687d4add033a6439848fb99f19106c919887728cf1b959375f35019a9890a1ec79130ac4f21a5dd214d91a6d721052
7
- data.tar.gz: 0645fc709e80e13fa8abc533bc695a71a516f127c80d5b05dee7225f00a53490782732e7dcdd206987631494273d5cc7b49d2146d654caf0a41e6bc62d5e4543
6
+ metadata.gz: 89e217eaf4c3d3d2ad7d8b90845cdf8a1a09f199b26498264443e68c09ef6cb510906716a213618b449dd7394cdc3e72ec6be03489664b0c15bdce843dd151a9
7
+ data.tar.gz: 31d9c2fc79c7bdb86a9251a832921cc5ddaf377c5dff5408be392f968094dc6397580ad7cb2a0638b5ce8f180d020a13a1248cc3f1de98cf1998dfbe1fda4cff
@@ -4,7 +4,9 @@ module ForestLiana
4
4
 
5
5
  def self.inject_context_in_value(value, context_variables)
6
6
  inject_context_in_value_custom(value) do |context_variable_key|
7
- context_variables.get_value(context_variable_key).to_s
7
+ value = context_variables.get_value(context_variable_key)
8
+ raise "Unknown context variable: #{context_variable_key}, please check the query for any typos" if value.nil?
9
+ value.to_s
8
10
  end
9
11
  end
10
12
 
@@ -18,12 +20,10 @@ module ForestLiana
18
20
  while (match = regex.match(value_with_context_variables_injected))
19
21
  context_variable_key = match[1]
20
22
 
21
- unless encountered_variables.include?(context_variable_key)
22
- value_with_context_variables_injected.gsub!(
23
- /{{#{context_variable_key}}}/,
24
- yield(context_variable_key)
25
- )
26
- end
23
+ value_with_context_variables_injected.gsub!(
24
+ /{{#{context_variable_key}}}/,
25
+ yield(context_variable_key)
26
+ )
27
27
 
28
28
  encountered_variables.push(context_variable_key)
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "9.9.0"
2
+ VERSION = "9.9.1"
3
3
  end
@@ -101,6 +101,12 @@ module ForestLiana
101
101
  ).to eq(expected_value.to_s)
102
102
  end
103
103
  end
104
+
105
+ it 'raises an error when the variable is not found' do
106
+ expect {
107
+ described_class.inject_context_in_value("{{siths.selectedRecord.evilString}}", context_variables)
108
+ }.to raise_error('Unknown context variable: siths.selectedRecord.evilString, please check the query for any typos')
109
+ end
104
110
  end
105
111
  end
106
112
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.9.0
4
+ version: 9.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-07 00:00:00.000000000 Z
11
+ date: 2025-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails