txgh-queue 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d0eeeea710b8fe7c6d1272b8e7431e245ec424f0
4
- data.tar.gz: 273e6fb2341cd9cf1a0ed206fb9e387d2103e0ee
2
+ SHA256:
3
+ metadata.gz: 182f92ae726c4dd56d50d53ae0f5cae3bcfae7f44ee675783a5153b2b084f4cf
4
+ data.tar.gz: 14bda789ede5a1f337c6c4bd708681b8f5958f279d5b01d71214f52fa737bfea
5
5
  SHA512:
6
- metadata.gz: 7e2f8e78daf5d14342100433525c3f85be02fd7cfa66d54f539d16748366675074e508c2c081bcefbe0f51c6a1c6303e44a50b78b58f2dd8c4f397d224d973f1
7
- data.tar.gz: 2143754bbaf2fd26f8af013d856366207db6113fc71e533f41bfc747e2657a294033b93588ebedb86f443d079ffd231b8d02c045578029f012b2f0d30e26933c
6
+ metadata.gz: 11476fc78f162f70a3c4331aac64d4eec1d80101462cd30a29f1efd4e65af4cbd66be23aaafb80fc018347635789ab4dbc6ab95ba22b656c12769bc4265dcc1d
7
+ data.tar.gz: 6ac7cb8a9d890cb72407882fe2265b8abe9e2f61c958d7345c6d94ec1ea8b371545caa0afebec96c2ab19ccdf7c4db2db31d91673ec44b12c9a3fbf3089d8af9
@@ -1,3 +1,4 @@
1
+ require 'erb'
1
2
  require 'yaml'
2
3
 
3
4
  module TxghQueue
@@ -37,11 +38,15 @@ module TxghQueue
37
38
  end
38
39
 
39
40
  def load_file(payload)
40
- Txgh::Utils.deep_symbolize_keys(YAML.load_file(payload))
41
+ Txgh::Utils.deep_symbolize_keys(parse(File.read(payload)))
41
42
  end
42
43
 
43
44
  def load_raw(payload)
44
- Txgh::Utils.deep_symbolize_keys(YAML.load(payload))
45
+ Txgh::Utils.deep_symbolize_keys(parse(payload))
46
+ end
47
+
48
+ def parse(str)
49
+ YAML.load(ERB.new(str).result(binding))
45
50
  end
46
51
  end
47
52
  end
@@ -1,3 +1,3 @@
1
1
  module TxghQueue
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -25,6 +25,7 @@ describe TxghQueue::WebhookEndpoints, auto_configure: true do
25
25
 
26
26
  header('Date', date_str)
27
27
  header('X-Tx-Url', 'http://example.org/transifex')
28
+ header('Content-Type', 'application/json')
28
29
 
29
30
  header(
30
31
  TxghServer::TransifexRequestAuth::TRANSIFEX_HEADER,
@@ -11,7 +11,8 @@ describe Transifex::RequestHandler, auto_configure: true do
11
11
 
12
12
  let(:logger) { NilLogger.new }
13
13
  let(:body) { payload.to_json }
14
- let(:request) { TestRequest.new(body: body) }
14
+ let(:headers) { { 'CONTENT_TYPE' => 'application/json' } }
15
+ let(:request) { TestRequest.new(body: body, headers: headers) }
15
16
  let(:handler) { described_class.new(request, logger) }
16
17
  let(:payload) do
17
18
  { 'project' => project_name, 'resource' => resource_slug, 'language' => 'pt' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txgh-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.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: 2018-02-05 00:00:00.000000000 Z
11
+ date: 2019-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  requirements: []
169
169
  rubyforge_project:
170
- rubygems_version: 2.6.13
170
+ rubygems_version: 2.7.6
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Queue worker for processing Txgh webhooks.