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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54bd17f12c9d7f51fd795daeaee77e5b52788eb2df7a12a67f820c92b7087ff1
4
- data.tar.gz: c6fdf92e84a6cf7819ed9867734ea864e9218fe3b740e611467383b6a4e84d6f
3
+ metadata.gz: f3c02b553986a17b56b22b342fb17880d8fdae3d5d61a109967b26c7a29a0524
4
+ data.tar.gz: ac13219636877bc7c61536a53bf7e20e6c4f83bdd4c706f4eec05bc15aea436f
5
5
  SHA512:
6
- metadata.gz: c28f62cf64f3787a2b4a595eb161061c1935363503932f3783d5bc08f738ea5df5cbf25aa58a0230b361f6b95906fd705d71a45ccc5e481c150c25f0cd41c6ae
7
- data.tar.gz: 6c02c0871a2575b8c2263b822691f784ce6d623c9dd11c79340960a16b60fe3a8bb21799dbfc39844b2ca93cb7fa466365deaa2a842b1dbd37aee158998e01aa
6
+ metadata.gz: 6b2759f1235b6e7490d2d3247f5c3e5e97181857d03a20cda5fb520d11a18ef20ea9651a266e9d5d11022b49979b8843f678f7bee60bb6d72a81fe9b1e799da3
7
+ data.tar.gz: 85c04374c3c46bfa5a9a51b08ed95ebf09067fd82d87b90f5a40abcf9de880fc097e103b2c34d0346148fc91ea01d88c96fa5258cb923dd10aea8081449be757
@@ -64,4 +64,5 @@ module Txbr
64
64
  Txbr.register_handler('campaigns', Txbr::CampaignHandler)
65
65
 
66
66
  ::Liquid::Template.register_tag(:connected_content, Txbr::Liquid::ConnectedContentTag)
67
+ ::Liquid::Template.register_tag(:abort_message, Txbr::Liquid::AbortMessageTag)
67
68
  end
@@ -1,5 +1,6 @@
1
1
  module Txbr
2
2
  module Liquid
3
+ autoload :AbortMessageTag, 'txbr/liquid/abort_message_tag'
3
4
  autoload :ConnectedContentTag, 'txbr/liquid/connected_content_tag'
4
5
  end
5
6
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Txbr
2
- VERSION = '2.2.0'
2
+ VERSION = '2.3.0'
3
3
  end
@@ -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.2.0
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-08-31 00:00:00.000000000 Z
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
- rubygems_version: 3.0.4
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.