honkster-encosion 0.3.3 → 0.3.4
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/VERSION +1 -1
- data/honkster-encosion.gemspec +1 -1
- data/lib/encosion/base.rb +7 -4
- data/lib/encosion/video.rb +1 -1
- data/test/encosion_test.rb +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/honkster-encosion.gemspec
CHANGED
data/lib/encosion/base.rb
CHANGED
@@ -86,7 +86,7 @@ module Encosion
|
|
86
86
|
body = JSON.parse(response.body.content.strip)
|
87
87
|
header = response.header
|
88
88
|
|
89
|
-
error_check(header,body)
|
89
|
+
error_check(header, body)
|
90
90
|
# if we get here then no exceptions were raised
|
91
91
|
return body
|
92
92
|
end
|
@@ -96,12 +96,15 @@ module Encosion
|
|
96
96
|
def error_check(header,body)
|
97
97
|
if header.status_code == 200
|
98
98
|
return true if body.nil?
|
99
|
-
|
100
|
-
|
101
|
-
|
99
|
+
error = body['error']
|
100
|
+
|
101
|
+
unless error.nil?
|
102
|
+
message = "#{body['error']["name"]}: #{body['error']["message"]} (code #{body['error']['code']})"
|
103
|
+
|
102
104
|
body['errors'].each do |error|
|
103
105
|
message += "\n#{error.values.first} (code #{error.values.last})"
|
104
106
|
end if body.has_key? 'errors'
|
107
|
+
|
105
108
|
raise BrightcoveException, message
|
106
109
|
end
|
107
110
|
else
|
data/lib/encosion/video.rb
CHANGED
data/test/encosion_test.rb
CHANGED
@@ -7,7 +7,7 @@ class EncosionTest < Test::Unit::TestCase
|
|
7
7
|
Encosion.options[:read_token] = 'WZvNvOA-dhN8Q1VCBfJlAH1GNbk-fp48rG7r0LnRNvd1nuRvwJy6uw..'
|
8
8
|
Encosion.options[:write_token] = 'UuVyFQ0u58r_1FBxTmmt1bp640RvkkOQjNK9UCBTFH2VW3DA2o_Itw..'
|
9
9
|
|
10
|
-
p Encosion::Video.delete_by_reference_id("testvideo")
|
10
|
+
# p Encosion::Video.delete_by_reference_id("testvideo")
|
11
11
|
|
12
12
|
new_video = Encosion::Video.new(
|
13
13
|
:file => File.new("/home/honk/workspace/honkster-encosion/test/movie.mov"),
|