zencoder-flix_cloud-gem 0.5.1 → 0.5.2
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.
- data/Rakefile +1 -1
- data/VERSION.yml +1 -1
- data/lib/flix_cloud/exceptions.rb +1 -0
- data/lib/flix_cloud/record.rb +7 -5
- data/lib/flix_cloud.rb +1 -1
- data/test/flix_cloud/job_test.rb +28 -3
- metadata +4 -4
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ begin
|
|
11
11
|
gem.authors = ["Nathan Sutton"]
|
12
12
|
gem.add_dependency('builder', '>= 2.1.2')
|
13
13
|
gem.add_dependency('crack', '>= 0.1.1')
|
14
|
-
gem.add_dependency('
|
14
|
+
gem.add_dependency('sevenwire-http_client', '>= 0.1.0')
|
15
15
|
|
16
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
17
|
end
|
data/VERSION.yml
CHANGED
@@ -3,3 +3,4 @@ class FlixCloud::SaveError < FlixCloud::Error; end
|
|
3
3
|
class FlixCloud::CreateError < FlixCloud::Error; end
|
4
4
|
class FlixCloud::ServerBrokeConnection < FlixCloud::Error; end
|
5
5
|
class FlixCloud::RequestTimeout < FlixCloud::Error; end
|
6
|
+
class FlixCloud::ConnectionRefused < FlixCloud::Error; end
|
data/lib/flix_cloud/record.rb
CHANGED
@@ -32,12 +32,14 @@ protected
|
|
32
32
|
|
33
33
|
def post(path, body)
|
34
34
|
begin
|
35
|
-
FlixCloud::Response.new(
|
35
|
+
FlixCloud::Response.new(HttpClient::Resource.new("https://flixcloud.com/#{path}",
|
36
36
|
:verify_ssl => OpenSSL::SSL::VERIFY_PEER).post(body, :content_type => 'application/xml', :accept => 'application/xml'))
|
37
|
-
rescue
|
38
|
-
raise FlixCloud::ServerBrokeConnection
|
39
|
-
rescue
|
40
|
-
raise FlixCloud::RequestTimeout
|
37
|
+
rescue HttpClient::ServerBrokeConnection
|
38
|
+
raise FlixCloud::ServerBrokeConnection, $!.message
|
39
|
+
rescue HttpClient::RequestTimeout
|
40
|
+
raise FlixCloud::RequestTimeout, $!.message
|
41
|
+
rescue HttpClient::ConnectionRefused
|
42
|
+
raise FlixCloud::ConnectionRefused, $!.message
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
data/lib/flix_cloud.rb
CHANGED
data/test/flix_cloud/job_test.rb
CHANGED
@@ -460,7 +460,7 @@ class FlixCloud::JobTest < Test::Unit::TestCase
|
|
460
460
|
|
461
461
|
context "When calling save on a valid job and the server connection gets interrupted" do
|
462
462
|
setup do
|
463
|
-
|
463
|
+
HttpClient::Resource.expects(:new).raises(HttpClient::ServerBrokeConnection)
|
464
464
|
@job = FlixCloud::Job.new(:api_key => 'your-api-key',
|
465
465
|
:recipe_id => 2,
|
466
466
|
:input_url => 'your-input-url',
|
@@ -481,9 +481,10 @@ class FlixCloud::JobTest < Test::Unit::TestCase
|
|
481
481
|
end
|
482
482
|
end
|
483
483
|
|
484
|
+
|
484
485
|
context "When calling save on a valid job and the connection times out" do
|
485
486
|
setup do
|
486
|
-
|
487
|
+
HttpClient::Resource.expects(:new).raises(HttpClient::RequestTimeout)
|
487
488
|
@job = FlixCloud::Job.new(:api_key => 'your-api-key',
|
488
489
|
:recipe_id => 2,
|
489
490
|
:input_url => 'your-input-url',
|
@@ -497,11 +498,35 @@ class FlixCloud::JobTest < Test::Unit::TestCase
|
|
497
498
|
:watermark_password => 'your-watermark-password')
|
498
499
|
end
|
499
500
|
|
500
|
-
should "railse a FlixCloud::
|
501
|
+
should "railse a FlixCloud::RequestTimeout exception" do
|
501
502
|
assert_raises FlixCloud::RequestTimeout do
|
502
503
|
@job.save
|
503
504
|
end
|
504
505
|
end
|
505
506
|
end
|
506
507
|
|
508
|
+
|
509
|
+
context "When calling save on a valid job and the connection is refused" do
|
510
|
+
setup do
|
511
|
+
HttpClient::Resource.expects(:new).raises(HttpClient::ConnectionRefused)
|
512
|
+
@job = FlixCloud::Job.new(:api_key => 'your-api-key',
|
513
|
+
:recipe_id => 2,
|
514
|
+
:input_url => 'your-input-url',
|
515
|
+
:input_user => 'your-input-user',
|
516
|
+
:input_password => 'your-input-password',
|
517
|
+
:output_url => 'your-output-url',
|
518
|
+
:output_user => 'your-output-user',
|
519
|
+
:output_password => 'your-output-password',
|
520
|
+
:watermark_url => 'your-watermark-url',
|
521
|
+
:watermark_user => 'your-watermark-user',
|
522
|
+
:watermark_password => 'your-watermark-password')
|
523
|
+
end
|
524
|
+
|
525
|
+
should "railse a FlixCloud::ConnectionRefused exception" do
|
526
|
+
assert_raises FlixCloud::ConnectionRefused do
|
527
|
+
@job.save
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|
531
|
+
|
507
532
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zencoder-flix_cloud-gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Sutton
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-17 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -33,14 +33,14 @@ dependencies:
|
|
33
33
|
version: 0.1.1
|
34
34
|
version:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
36
|
+
name: sevenwire-http_client
|
37
37
|
type: :runtime
|
38
38
|
version_requirement:
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 0.1.0
|
44
44
|
version:
|
45
45
|
description:
|
46
46
|
email: nate@sevenwire.com
|