heywatch 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/heywatch.rb +8 -1
- metadata +4 -4
data/lib/heywatch.rb
CHANGED
@@ -78,12 +78,19 @@ class HeyWatch
|
|
78
78
|
#
|
79
79
|
# hw.bin :encoded_video, 12345
|
80
80
|
def bin(resource, id, &block)
|
81
|
+
RestClient.get(url(resource, id), :raw_response => true, &block)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Get the real location of the video / encoded_video
|
85
|
+
#
|
86
|
+
# hw.url :encoded_video, 12345
|
87
|
+
def url(resource, id)
|
81
88
|
unless [:encoded_video, :video].include?(resource.to_sym)
|
82
89
|
raise InvalidResource, "Can't retrieve '#{resource}'"
|
83
90
|
end
|
84
91
|
|
85
92
|
req("/#{resource}/#{id}.bin", :head) do |res, req|
|
86
|
-
return
|
93
|
+
return res.headers[:location]
|
87
94
|
end
|
88
95
|
end
|
89
96
|
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 1
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 1.
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 1.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bruno Celeste
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-
|
17
|
+
date: 2012-11-08 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|