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 +4 -4
- data/lib/txgh-queue/job.rb +23 -11
- data/lib/txgh-queue/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb3e21737b86d0dd43566b43f85158387854826
|
4
|
+
data.tar.gz: 369fd4afe0dfa0356c13d0b6269c1962be6ed92f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7ab47d0904d9064f3bf469ab3bae4ec4dcd6698f4714d682c269a0c5c80a39bdcd5c4fc6128e7f7305667878da75ab43853eb8774d590fb9f8fd282418dd1f8
|
7
|
+
data.tar.gz: cd9dc3b678f94b5d02e4e7c4596fa30e9877f598ec41c0dc6888744b34aee3340461d822a9d0b74f89d23d931ba8fdde5bb3c99896c0dc334555bbe2a6040930
|
data/lib/txgh-queue/job.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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)
|
data/lib/txgh-queue/version.rb
CHANGED