streamio 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +4 -0
- data/lib/streamio.rb +1 -0
- data/lib/streamio/errors.rb +6 -0
- data/lib/streamio/resource.rb +9 -4
- data/lib/streamio/version.rb +1 -1
- metadata +4 -3
data/HISTORY.md
CHANGED
data/lib/streamio.rb
CHANGED
data/lib/streamio/resource.rb
CHANGED
@@ -12,7 +12,7 @@ module Streamio
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def get(path, parameters = {})
|
15
|
-
@net.request(net_request(Net::HTTP::Get, path, parameters))
|
15
|
+
validate_and_return @net.request(net_request(Net::HTTP::Get, path, parameters))
|
16
16
|
end
|
17
17
|
|
18
18
|
def post(path, parameters = {})
|
@@ -20,15 +20,15 @@ module Streamio
|
|
20
20
|
value.is_a?(File)
|
21
21
|
end ? Net::HTTP::Post::Multipart : Net::HTTP::Post
|
22
22
|
|
23
|
-
@net.request(net_request(request_class, path, parameters))
|
23
|
+
validate_and_return @net.request(net_request(request_class, path, parameters))
|
24
24
|
end
|
25
25
|
|
26
26
|
def put(path, parameters = {})
|
27
|
-
@net.request(net_request(Net::HTTP::Put, path, parameters))
|
27
|
+
validate_and_return @net.request(net_request(Net::HTTP::Put, path, parameters))
|
28
28
|
end
|
29
29
|
|
30
30
|
def delete(path)
|
31
|
-
@net.request(net_request(Net::HTTP::Delete, path))
|
31
|
+
validate_and_return @net.request(net_request(Net::HTTP::Delete, path))
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
@@ -54,5 +54,10 @@ module Streamio
|
|
54
54
|
req["Accept"] = "application/json"
|
55
55
|
req
|
56
56
|
end
|
57
|
+
|
58
|
+
def validate_and_return(response)
|
59
|
+
raise Errors::Unauthorized if response.code.to_i == 401
|
60
|
+
response
|
61
|
+
end
|
57
62
|
end
|
58
63
|
end
|
data/lib/streamio/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: streamio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -116,6 +116,7 @@ extra_rdoc_files: []
|
|
116
116
|
files:
|
117
117
|
- lib/streamio/audio.rb
|
118
118
|
- lib/streamio/encoding_profile.rb
|
119
|
+
- lib/streamio/errors.rb
|
119
120
|
- lib/streamio/image.rb
|
120
121
|
- lib/streamio/model.rb
|
121
122
|
- lib/streamio/player.rb
|
@@ -143,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
144
|
version: '0'
|
144
145
|
segments:
|
145
146
|
- 0
|
146
|
-
hash:
|
147
|
+
hash: 3096267224614195611
|
147
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
149
|
none: false
|
149
150
|
requirements:
|
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
153
|
version: '0'
|
153
154
|
segments:
|
154
155
|
- 0
|
155
|
-
hash:
|
156
|
+
hash: 3096267224614195611
|
156
157
|
requirements: []
|
157
158
|
rubyforge_project:
|
158
159
|
rubygems_version: 1.8.24
|