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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fb618ddf8d3d2e620724cafc6aa1b70261663ee
4
- data.tar.gz: ca0a71f31dd49e557c03f0966de9259370da521a
3
+ metadata.gz: 3e8a3ed5cdaefcc808129d0ebfef256e0aa7e641
4
+ data.tar.gz: b3064574b71656c376c7ca73c9c678cec1989d53
5
5
  SHA512:
6
- metadata.gz: bf2ce885ed263227ccf3cac248adf7cc7a90046696e824125add9b9c72ec2d2093cbc6f09f8cf8b678efed835442e774255a0c14ef24720f5c2bae981974b988
7
- data.tar.gz: c9238d764fe40159ee4557cd55889d1a423d99419061220df8c35e0b0d55e65cf8911b083a37b25e896fef893990dbf971ca665d51cb6a5a8efe03e0a2240afd
6
+ metadata.gz: 202585b6bcb851aed4815effce07388d18436f1f8015d4a5f1f2e6e3abbd6e4bab49ad2de44b666523347600e62f401ccca39c54f85b865d6faa8b23c472c46d
7
+ data.tar.gz: 34fd7900730f0ad5dc4faa29061fd36f61be1f336b03bf0da98acd6bd4237484b4818d6eeba66c9a554a1deab88dec61c172161e81112348f523b479d031fb12
@@ -13,12 +13,19 @@ module Shingoncoder
13
13
  fail NotImplementedError
14
14
  end
15
15
 
16
- def progress
17
- fail NotImplementedError
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
- fail NotImplementedError
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 :code, :body
3
+ attr_reader :body, :code
4
4
 
5
- def initialize(properties)
6
- @id = properties.fetch('id')
7
- @code = properties.fetch('code')
8
- @body = { 'id' => @id }
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
@@ -1,3 +1,3 @@
1
1
  module Shingoncoder
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shingoncoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne