txgh-queue 1.0.0 → 1.0.1

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
2
  SHA1:
3
- metadata.gz: ff7b50a82408cdac666a7921a2f9f011bc8d5226
4
- data.tar.gz: dbe3735109b47773c7bb8175544273f2edffd86c
3
+ metadata.gz: dcb3e21737b86d0dd43566b43f85158387854826
4
+ data.tar.gz: 369fd4afe0dfa0356c13d0b6269c1962be6ed92f
5
5
  SHA512:
6
- metadata.gz: 8c0b6b954cf71c340094acf5de1f34d33796b3eb92bcd6ac4b13ec5758f3c0f38b97f2a35617e1d224e2fd93881cd554d5cb3ce8bb26e3326b22f47480bd5af8
7
- data.tar.gz: d3113158ce321050b04ebe1c6abdb8260039a8cfe00ac6764d45f46d7d4cd2c1da7be04b101674aa9bc4bd234b96465f5e59c5a2c78e096b661784d4fadaed6d
6
+ metadata.gz: c7ab47d0904d9064f3bf469ab3bae4ec4dcd6698f4714d682c269a0c5c80a39bdcd5c4fc6128e7f7305667878da75ab43853eb8774d590fb9f8fd282418dd1f8
7
+ data.tar.gz: cd9dc3b678f94b5d02e4e7c4596fa30e9877f598ec41c0dc6888744b34aee3340461d822a9d0b74f89d23d931ba8fdde5bb3c99896c0dc334555bbe2a6040930
@@ -15,17 +15,9 @@ module TxghQueue
15
15
 
16
16
  def process(payload)
17
17
  Supervisor.supervise do
18
- config = config_from(payload)
19
- project = config.transifex_project
20
- repo = config.github_repo
21
-
22
18
  case payload.fetch('txgh_event')
23
- when 'github.push'
24
- handle_github_push(project, repo, payload)
25
- when 'github.delete'
26
- handle_github_delete(project, repo, payload)
27
- when 'transifex.hook'
28
- handle_transifex_hook(project, repo, payload)
19
+ when 'github.push', 'github.delete', 'transifex.hook'
20
+ handle_expected(payload)
29
21
  else
30
22
  handle_unexpected
31
23
  end
@@ -34,8 +26,28 @@ module TxghQueue
34
26
 
35
27
  private
36
28
 
29
+ def handle_expected(payload)
30
+ config = config_from(payload)
31
+ project = config.transifex_project
32
+ repo = config.github_repo
33
+
34
+ case payload.fetch('txgh_event')
35
+ when 'github.push'
36
+ handle_github_push(project, repo, payload)
37
+ when 'github.delete'
38
+ handle_github_delete(project, repo, payload)
39
+ when 'transifex.hook'
40
+ handle_transifex_hook(project, repo, payload)
41
+ end
42
+ end
43
+
37
44
  def config_from(payload)
38
- Txgh::Config::KeyManager.config_from_repo(payload.fetch('repo_name'))
45
+ case payload.fetch('txgh_event')
46
+ when 'github.push', 'github.delete'
47
+ Txgh::Config::KeyManager.config_from_repo(payload.fetch('repo_name'))
48
+ when 'transifex.hook'
49
+ Txgh::Config::KeyManager.config_from_project(payload.fetch('project'))
50
+ end
39
51
  end
40
52
 
41
53
  def handle_github_push(project, repo, payload)
@@ -1,3 +1,3 @@
1
1
  module TxghQueue
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txgh-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro