shingoncoder 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shingoncoder/job.rb +10 -3
- data/lib/shingoncoder/response.rb +9 -5
- data/lib/shingoncoder/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: 3e8a3ed5cdaefcc808129d0ebfef256e0aa7e641
|
4
|
+
data.tar.gz: b3064574b71656c376c7ca73c9c678cec1989d53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 202585b6bcb851aed4815effce07388d18436f1f8015d4a5f1f2e6e3abbd6e4bab49ad2de44b666523347600e62f401ccca39c54f85b865d6faa8b23c472c46d
|
7
|
+
data.tar.gz: 34fd7900730f0ad5dc4faa29061fd36f61be1f336b03bf0da98acd6bd4237484b4818d6eeba66c9a554a1deab88dec61c172161e81112348f523b479d031fb12
|
data/lib/shingoncoder/job.rb
CHANGED
@@ -13,12 +13,19 @@ module Shingoncoder
|
|
13
13
|
fail NotImplementedError
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
# Each output should have current_event
|
17
|
+
# job itself should have 'progress'
|
18
|
+
def progress(id)
|
19
|
+
job = Shingoncoder::Backend::JobRegistry::Job.find(id)
|
20
|
+
Response.new('body' => id, 'code' => 200)
|
18
21
|
end
|
19
22
|
|
23
|
+
# should have ["job"]["input_media_file"]["url"]
|
24
|
+
# TODO should have ["job"]["state"] which is one of:
|
25
|
+
# "pending", "waiting", "processing", "cancelled", "failed", "finished"
|
20
26
|
def details
|
21
|
-
|
27
|
+
job = Shingoncoder::Backend::JobRegistry::Job.find(id)
|
28
|
+
Response.new('body' => { 'job' => { 'input_media_file' => { 'url' => job.input.fetch('input') } } }, 'code' => 200)
|
22
29
|
end
|
23
30
|
end
|
24
31
|
end
|
@@ -1,11 +1,15 @@
|
|
1
1
|
module Shingoncoder
|
2
2
|
class Response
|
3
|
-
attr_reader :
|
3
|
+
attr_reader :body, :code
|
4
4
|
|
5
|
-
def initialize(
|
6
|
-
|
7
|
-
@code = properties.
|
8
|
-
@body =
|
5
|
+
def initialize(opts)
|
6
|
+
properties = opts.with_indifferent_access
|
7
|
+
@code = properties.delete(:code)
|
8
|
+
@body = properties.fetch(:body, properties)
|
9
|
+
end
|
10
|
+
|
11
|
+
def success?
|
12
|
+
true
|
9
13
|
end
|
10
14
|
end
|
11
15
|
end
|
data/lib/shingoncoder/version.rb
CHANGED