txbr 2.5.2 → 2.5.3

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: af6782638d9d86f0593f7d1bd4066684dcb447f805e5c324fa1471e8f28bc3bc
4
- data.tar.gz: 565be3c3aba1c78725433ab38d54bfb6930bd05afb40e385157e14a4233d1855
3
+ metadata.gz: a33819dfb9210addc0b31bf40df318a0884dfd476d2f2c76ee81847a0c483b61
4
+ data.tar.gz: 92e410458f6786dfdaa03c08f96c85313b7f79b3820e3a46a93f0a4c23468bce
5
5
  SHA512:
6
- metadata.gz: 2945218cdb7970b015336e857d4cd766ffdbc9bc25459c27bd2c69fc630c3df00368c24c2584bd762f9e50535b4e479738492d5876e42b7c272dc96db4285a52
7
- data.tar.gz: 6a1cb78704a76414ce698a637e9f80e65577c4d85baa024ea49f22bcea71b15203f048931c91c110c2b7f7253483a57b715e5fd294dd7a64281348f5bf43478d
6
+ metadata.gz: 2c3eab3a5bd77892765f01839a8b0bfaec22fc964113751487d851d6dcd8b4ab91bd2861dcc5bfad44b21af42bbd672eb2d6828fa12727dd2a882c7cd29d6b66
7
+ data.tar.gz: ced749251485e0fb2f0015aca96f9138219a22db044e63b6ef10b84e415b44e26555aac499bd734bbada6717610437bc3795681d376f6d360522938a68420ee8
@@ -69,7 +69,7 @@ module Txbr
69
69
  # Otherwise, transform the var into something Liquid-friendly so it
70
70
  # doesn't jam up the parser.
71
71
  def prerender(source, variables)
72
- source.gsub(/\{\s*\{\s*(?:[\w\-\_\.\[\]]+\.)?\$\{\s*[\w\-\.\[\]]+\s*\}?\s*\}?\s*\}?/) do |orig|
72
+ source.gsub(/(?:\{\s*\{\s*)?(?:[\w\-\_\.\[\]]+\.)?\$\{\s*[\w\-\.\[\]]+\s*\}?\s*(?:\}?\s*\})?/) do |orig|
73
73
  plain = orig.sub(/\A\{\{/, '').sub(/\}\}\z/, '')
74
74
 
75
75
  result = if val = variables[plain]
@@ -1,3 +1,3 @@
1
1
  module Txbr
2
- VERSION = '2.5.2'
2
+ VERSION = '2.5.3'
3
3
  end
@@ -10,6 +10,7 @@ describe Txbr::Template do
10
10
  <h1>Braze campaign is {{campaign.${api_id}}}</h1>
11
11
  <h2>Hello, {{${first_name}}}</h2>
12
12
  <h3>I speak {{custom_attributes.${preferred_language} | default: 'en'}}</h3>
13
+ <h3>{{'foo bar ' | append: custom_attributes.${foobar}}}</h3>
13
14
  SRC
14
15
  end
15
16
 
@@ -17,7 +18,8 @@ describe Txbr::Template do
17
18
  let(:prerender_variables) do
18
19
  {
19
20
  'campaign.${api_id}' => 'abc123',
20
- '${first_name}' => 'Dwight'
21
+ '${first_name}' => 'Dwight',
22
+ 'custom_attributes.${foobar}' => 'baz'
21
23
  }
22
24
  end
23
25
 
@@ -26,6 +28,7 @@ describe Txbr::Template do
26
28
  <h1>Braze campaign is abc123</h1>
27
29
  <h2>Hello, Dwight</h2>
28
30
  <h3>I speak en</h3>
31
+ <h3>foo bar baz</h3>
29
32
  TEXT
30
33
  end
31
34
  end
@@ -36,6 +39,7 @@ describe Txbr::Template do
36
39
  <h1>Braze campaign is </h1>
37
40
  <h2>Hello, </h2>
38
41
  <h3>I speak en</h3>
42
+ <h3>foo bar </h3>
39
43
  TEXT
40
44
  end
41
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-26 00:00:00.000000000 Z
11
+ date: 2020-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abroad