txbr 2.2.0 → 2.3.0
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 +4 -4
- data/lib/txbr.rb +1 -0
- data/lib/txbr/liquid.rb +1 -0
- data/lib/txbr/liquid/abort_message_tag.rb +16 -0
- data/lib/txbr/version.rb +1 -1
- data/spec/email_template_spec.rb +3 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f3c02b553986a17b56b22b342fb17880d8fdae3d5d61a109967b26c7a29a0524
|
|
4
|
+
data.tar.gz: ac13219636877bc7c61536a53bf7e20e6c4f83bdd4c706f4eec05bc15aea436f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b2759f1235b6e7490d2d3247f5c3e5e97181857d03a20cda5fb520d11a18ef20ea9651a266e9d5d11022b49979b8843f678f7bee60bb6d72a81fe9b1e799da3
|
|
7
|
+
data.tar.gz: 85c04374c3c46bfa5a9a51b08ed95ebf09067fd82d87b90f5a40abcf9de880fc097e103b2c34d0346148fc91ea01d88c96fa5258cb923dd10aea8081449be757
|
data/lib/txbr.rb
CHANGED
data/lib/txbr/liquid.rb
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'liquid'
|
|
2
|
+
|
|
3
|
+
module Txbr
|
|
4
|
+
module Liquid
|
|
5
|
+
# Used to stand in for the special Braze {% abort_message(...) %} tag.
|
|
6
|
+
# Renders as an empty string.
|
|
7
|
+
class AbortMessageTag < ::Liquid::Tag
|
|
8
|
+
def initialize(_tag_name, _arg, _context = nil)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def render(_context)
|
|
12
|
+
''
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
data/lib/txbr/version.rb
CHANGED
data/spec/email_template_spec.rb
CHANGED
|
@@ -17,6 +17,9 @@ describe Txbr::EmailTemplate do
|
|
|
17
17
|
{% assign translation_enabled = true %}
|
|
18
18
|
{% connected_content http://my_strings_api.com?project_slug={{project_slug}}&resource_slug={{resource_slug}} :save strings %}
|
|
19
19
|
{% connected_content http://my_strings_api.com?project_slug=my_project&resource_slug=my_footer_resource :save footer %}
|
|
20
|
+
{% if strings.__http_status_code__ != 200 %}
|
|
21
|
+
{% abort_message("Error fetching translations") %}
|
|
22
|
+
{% endif %}
|
|
20
23
|
</head>
|
|
21
24
|
<body>
|
|
22
25
|
{{strings.header | default: 'Buy our stuff!'}}
|
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.
|
|
4
|
+
version: 2.3.0
|
|
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
|
+
date: 2019-09-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: abroad
|
|
@@ -130,6 +130,7 @@ files:
|
|
|
130
130
|
- lib/txbr/email_template_handler.rb
|
|
131
131
|
- lib/txbr/email_templates_api.rb
|
|
132
132
|
- lib/txbr/liquid.rb
|
|
133
|
+
- lib/txbr/liquid/abort_message_tag.rb
|
|
133
134
|
- lib/txbr/liquid/connected_content_tag.rb
|
|
134
135
|
- lib/txbr/metadata.rb
|
|
135
136
|
- lib/txbr/project.rb
|
|
@@ -175,7 +176,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
175
176
|
- !ruby/object:Gem::Version
|
|
176
177
|
version: '0'
|
|
177
178
|
requirements: []
|
|
178
|
-
|
|
179
|
+
rubyforge_project:
|
|
180
|
+
rubygems_version: 2.7.6.2
|
|
179
181
|
signing_key:
|
|
180
182
|
specification_version: 4
|
|
181
183
|
summary: A library for syncing translation resources between Braze and Transifex.
|