rivendell-api 0.6 → 0.7
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/lib/rivendell/api/xport.rb
CHANGED
@@ -141,6 +141,8 @@ module Rivendell::API
|
|
141
141
|
end
|
142
142
|
|
143
143
|
def import(cart_number, cut_number, file, options = {})
|
144
|
+
timeout = (options.delete(:timeout) || 10)*60
|
145
|
+
|
144
146
|
arguments = {
|
145
147
|
:channels => 2,
|
146
148
|
:normalization_level => -13,
|
@@ -152,7 +154,7 @@ module Rivendell::API
|
|
152
154
|
|
153
155
|
arguments[:use_metadata] = 1 if arguments[:use_metadata]
|
154
156
|
|
155
|
-
post COMMAND_IMPORT, arguments, :timeout =>
|
157
|
+
post COMMAND_IMPORT, arguments, :timeout => timeout
|
156
158
|
end
|
157
159
|
|
158
160
|
def add_cut(cart_number)
|
@@ -113,11 +113,16 @@ describe Rivendell::API::Xport do
|
|
113
113
|
FakeWeb.register_uri(:post, "http://localhost/rd-bin/rdxport.cgi", :body => xml_response)
|
114
114
|
end
|
115
115
|
|
116
|
-
it "should use a timeout of 10 minutes" do
|
116
|
+
it "should use a default timeout of 10 minutes" do
|
117
117
|
subject.should_receive(:post).with(anything, anything, hash_including(:timeout => 600))
|
118
118
|
subject.import 123, 001, fixture_file("empty.wav")
|
119
119
|
end
|
120
120
|
|
121
|
+
it "should use a given timeout" do
|
122
|
+
subject.should_receive(:post).with(anything, anything, hash_including(:timeout => 1200))
|
123
|
+
subject.import 123, 001, fixture_file("empty.wav"), timeout: 20
|
124
|
+
end
|
125
|
+
|
121
126
|
it "should use COMMAND 2" do
|
122
127
|
subject.import 123, 001, fixture_file("empty.wav")
|
123
128
|
FakeWeb.last_request["COMMAND"] == "2"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rivendell-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.7'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httmultiparty
|
@@ -206,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
segments:
|
208
208
|
- 0
|
209
|
-
hash:
|
209
|
+
hash: 1535084425241020234
|
210
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
211
|
none: false
|
212
212
|
requirements:
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
version: '0'
|
216
216
|
segments:
|
217
217
|
- 0
|
218
|
-
hash:
|
218
|
+
hash: 1535084425241020234
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
221
|
rubygems_version: 1.8.23
|