argonuts-ruby 0.1.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2eebc8c0a3b2502db0b47ad785762c0d237b753b02b26772a7b2174e67104d9
4
- data.tar.gz: 50d0552f780e45ea9d3d97825c6e76c85040a9b9ade93199a45998610fc23747
3
+ metadata.gz: 7e2c30f0385009c72cfb5331860629272f31073fe0a45026d15d62b6d960cf9a
4
+ data.tar.gz: a4e2b1756e5fe6a13da61b299935768bf3459d31ab4d43d3162492c915159ecc
5
5
  SHA512:
6
- metadata.gz: 211adbb3435d2ad43f5ca17596d9adc5f782ef0a7994d3111f4f4e020fead87a78a7bf35cbfc652953e969ec87432533f8a2c6657150180267147f489375e888
7
- data.tar.gz: de68d2b6b95b31e770eaa605f9055f592df03ea1bb2990c78d3df3c81a79504a10cbd3c5fa9cfea69dd255a1e4e74a2cccee96c292e49d0d9364b8ff47284295
6
+ metadata.gz: 1cc6801e7c368828f46b14c93528341e256a1d596df959d43c68ecc421de210f3515e8e32f9f0f4c28ddcad7e862cc6fd390cf33b3c1b655b0ad1d946e3ae9d8
7
+ data.tar.gz: b7d305a99e6bd26792b49ba46ffff8a4c2014c49c2b8209a34620b298bb5d5a47a67cddd8e631bec3f2028f952d972de7f98cd5d3dcabcbeaaf7587368e22294
data/README.md CHANGED
@@ -30,14 +30,13 @@ bundle install
30
30
 
31
31
  ## Usage
32
32
 
33
- The library needs you to set your API key which can be found in your [dashboard](https://argonuts.co/dashboard).
33
+ The library needs you to set your API key which can be found in your [profile](https://argonuts.co/profile).
34
34
 
35
35
 
36
36
  ```ruby
37
37
  Argonuts.api_key = 'api-key'
38
38
 
39
39
  Argonuts.notification = {
40
- type: "http",
41
40
  url: "https://yoursite.co/api/argonuts/webhook"
42
41
  }
43
42
 
@@ -49,7 +48,7 @@ Argonuts.storage = {
49
48
  ## Creating a job
50
49
 
51
50
  ```ruby
52
- Argonuts::Job.create(
51
+ job = Argonuts::Job.create({
53
52
  input: { url: "https://yoursite.co/path/file.mp4" },
54
53
  outputs: {
55
54
  "jpg:300x": { path: "/image.jpg" },
@@ -58,27 +57,13 @@ Argonuts::Job.create(
58
57
  hls: { path: "hls/" }
59
58
  }
60
59
  }
61
- )
60
+ })
62
61
  ```
63
62
 
64
63
  ## Getting information about a job
65
64
 
66
65
  ```ruby
67
- Argonuts::Job.retrieve("OolQXaiU86NFki")
68
- ```
69
-
70
- ## Retrieving metadata
71
-
72
- ```ruby
73
- Argonuts::Metadata.retrieve("OolQXaiU86NFki")
74
-
75
- ```
76
-
77
- ## Per-request configuration
78
-
79
- ```ruby
80
- cli = Argonuts::Client.new(api_key: "api-key-prod")
81
- Argonuts::Job.create(job, client: cli)
66
+ Argonuts::Job.retrieve(job.id)
82
67
  ```
83
68
 
84
69
  *Released under the [MIT license](http://www.opensource.org/licenses/mit-license.php).*
data/lib/argonuts/api.rb CHANGED
@@ -22,6 +22,7 @@ module Argonuts
22
22
 
23
23
  url = URI("#{cli.endpoint}#{path}")
24
24
  http = Net::HTTP.new(url.host, url.port)
25
+ http.use_ssl = true if url.instance_of? URI::HTTPS
25
26
 
26
27
  case verb
27
28
  when :get
@@ -1,3 +1,3 @@
1
1
  module Argonuts
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.5"
3
3
  end
data/lib/argonuts-ruby.rb CHANGED
@@ -6,7 +6,7 @@ require "argonuts/metadata"
6
6
  require "argonuts/version"
7
7
 
8
8
  module Argonuts
9
- ENDPOINT = "https://argonuts.co/api/v1"
9
+ ENDPOINT = "https://argonuts.co/api/v1/"
10
10
 
11
11
  def self.api_key=(key)
12
12
  @api_key = key
@@ -11,7 +11,6 @@ class ArgonutsTest < Test::Unit::TestCase
11
11
  Argonuts.endpoint = ENV["ARGONUTS_ENDPOINT"]
12
12
 
13
13
  Argonuts.notification = {
14
- type: "http",
15
14
  url: ENV["ARGONUTS_WEBHOOK_URL"]
16
15
  }
17
16
 
@@ -52,13 +51,13 @@ class ArgonutsTest < Test::Unit::TestCase
52
51
  assert_equal "job.starting", job.status
53
52
  end
54
53
 
55
- # def test_retrieve_job
56
- # job = Argonuts::Job.retrieve(create_job.id)
57
- # assert job.is_a?(Argonuts::Job)
58
- # assert_not_nil job.id
59
- # assert_equal "job.starting", job.status
60
- # end
61
- #
54
+ def test_retrieve_job
55
+ job = Argonuts::Job.retrieve(create_job.id)
56
+ assert job.is_a?(Argonuts::Job)
57
+ assert_not_nil job.id
58
+ assert_equal "job.starting", job.status
59
+ end
60
+
62
61
  # def test_create_job_error
63
62
  # create_job(input: {url: "notvalidurl"})
64
63
  # rescue => e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: argonuts-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Argonuts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-03 00:00:00.000000000 Z
11
+ date: 2022-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http