rivendell-api 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Rivendell
2
2
  module Api
3
- VERSION = "0.7"
3
+ VERSION = "0.8"
4
4
  end
5
5
  end
@@ -162,6 +162,23 @@ module Rivendell::API
162
162
  Rivendell::API::Cut.new(response["cutAdd"]["cut"])
163
163
  end
164
164
 
165
+ def edit_cut(cart_number, cut_number, attributes = {})
166
+ attributes[:cart_number] = cart_number
167
+ attributes[:cut_number] = cut_number
168
+
169
+ post COMMAND_EDITCUT, attributes
170
+ end
171
+
172
+ def list_cut(cart_number, cut_number)
173
+ arguments = {
174
+ :cart_number => cart_number,
175
+ :cut_number => cut_number
176
+ }
177
+
178
+ response = post COMMAND_LISTCUT, arguments
179
+ Rivendell::API::Cut.new(response["cutList"]["cut"])
180
+ end
181
+
165
182
  end
166
183
 
167
184
  end
@@ -0,0 +1,4 @@
1
+ <RDWebResult>
2
+ <ResponseCode>200</ResponseCode>
3
+ <ErrorString>OK</ErrorString>
4
+ </RDWebResult>
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <cutList>
3
+ <cut>
4
+ <cutName>070000_001</cutName>
5
+ <cartNumber>70000</cartNumber>
6
+ <cutNumber>1</cutNumber>
7
+ <evergreen>false</evergreen>
8
+ <description>test</description>
9
+ <outcue></outcue>
10
+ <isrc></isrc>
11
+ <isci></isci>
12
+ <length>0</length>
13
+ <originDatetime></originDatetime>
14
+ <startDatetime></startDatetime>
15
+ <endDatetime></endDatetime>
16
+ <sun>true</sun>
17
+ <mon>true</mon>
18
+ <tue>true</tue>
19
+ <wed>true</wed>
20
+ <thu>true</thu>
21
+ <fri>true</fri>
22
+ <sat>true</sat>
23
+ <startDaypart></startDaypart>
24
+ <endDaypart></endDaypart>
25
+ <originName></originName>
26
+ <weight>1</weight>
27
+ <lastPlayDatetime/>
28
+ <playCounter>0</playCounter>
29
+ <localCounter>0</localCounter>
30
+ <validity>0</validity>
31
+ <codingFormat>0</codingFormat>
32
+ <sampleRate>0</sampleRate>
33
+ <bitRate>0</bitRate>
34
+ <channels>2</channels>
35
+ <playGain>0</playGain>
36
+ <startPoint>-1</startPoint>
37
+ <endPoint>-1</endPoint>
38
+ <fadeupPoint>-1</fadeupPoint>
39
+ <fadedownPoint>-1</fadedownPoint>
40
+ <segueStartPoint>-1</segueStartPoint>
41
+ <segueEndPoint>-1</segueEndPoint>
42
+ <segueGain>-3000</segueGain>
43
+ <hookStartPoint>-1</hookStartPoint>
44
+ <hookEndPoint>-1</hookEndPoint>
45
+ <talkStartPoint>-1</talkStartPoint>
46
+ <talkEndPoint>0</talkEndPoint>
47
+ </cut>
48
+ </cutList>
@@ -207,6 +207,51 @@ describe Rivendell::API::Xport do
207
207
 
208
208
  end
209
209
 
210
+ describe "#list_cut" do
211
+
212
+ before(:each) do
213
+ FakeWeb.register_uri(:post, "http://localhost/rd-bin/rdxport.cgi", :body => fixture_content("rdxport_list_cut.xml"))
214
+ end
215
+
216
+ it "should use COMMAND 10" do
217
+ subject.list_cut(70000,1)
218
+ FakeWeb.last_request["COMMAND"] == "8"
219
+ end
220
+
221
+ it "should return Cut" do
222
+ subject.list_cut(70000,1).cart_number.should == "70000"
223
+ end
224
+
225
+ end
226
+
227
+ describe "#edit_cut" do
228
+
229
+ before(:each) do
230
+ FakeWeb.register_uri(:post, "http://localhost/rd-bin/rdxport.cgi", :body => fixture_content("rdxport_edit_cut.xml"))
231
+ end
232
+
233
+ it "should use COMMAND 15" do
234
+ subject.edit_cut 70000, 1
235
+ FakeWeb.last_request["COMMAND"] == "15"
236
+ end
237
+
238
+ it "should use specified cart number" do
239
+ subject.edit_cut 70000, 1
240
+ FakeWeb.last_request["CART_NUMBER"] == 70000
241
+ end
242
+
243
+ it "should use specified cut number" do
244
+ subject.edit_cut 70000, 1
245
+ FakeWeb.last_request["CUT_NUMBER"] == 1
246
+ end
247
+
248
+ it "should use given attributes" do
249
+ subject.edit_cut 70000, 1, :description => "Test"
250
+ FakeWeb.last_request["DESCRIPTION"] == "Test"
251
+ end
252
+
253
+ end
254
+
210
255
  describe "#list_carts" do
211
256
 
212
257
  before(:each) do
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.7'
4
+ version: '0.8'
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-11-17 00:00:00.000000000 Z
12
+ date: 2014-11-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httmultiparty
@@ -181,9 +181,11 @@ files:
181
181
  - spec/fixtures/rdxport_add_cart.xml
182
182
  - spec/fixtures/rdxport_add_cut.xml
183
183
  - spec/fixtures/rdxport_edit_cart.xml
184
+ - spec/fixtures/rdxport_edit_cut.xml
184
185
  - spec/fixtures/rdxport_import.xml
185
186
  - spec/fixtures/rdxport_list_carts-single-cart.xml
186
187
  - spec/fixtures/rdxport_list_carts.xml
188
+ - spec/fixtures/rdxport_list_cut.xml
187
189
  - spec/fixtures/rdxport_list_cuts.xml
188
190
  - spec/fixtures/rdxport_list_groups.xml
189
191
  - spec/rivendell/api/cart_spec.rb
@@ -206,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
206
208
  version: '0'
207
209
  segments:
208
210
  - 0
209
- hash: 1535084425241020234
211
+ hash: -2208257095706775777
210
212
  required_rubygems_version: !ruby/object:Gem::Requirement
211
213
  none: false
212
214
  requirements:
@@ -215,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
217
  version: '0'
216
218
  segments:
217
219
  - 0
218
- hash: 1535084425241020234
220
+ hash: -2208257095706775777
219
221
  requirements: []
220
222
  rubyforge_project:
221
223
  rubygems_version: 1.8.23
@@ -227,9 +229,11 @@ test_files:
227
229
  - spec/fixtures/rdxport_add_cart.xml
228
230
  - spec/fixtures/rdxport_add_cut.xml
229
231
  - spec/fixtures/rdxport_edit_cart.xml
232
+ - spec/fixtures/rdxport_edit_cut.xml
230
233
  - spec/fixtures/rdxport_import.xml
231
234
  - spec/fixtures/rdxport_list_carts-single-cart.xml
232
235
  - spec/fixtures/rdxport_list_carts.xml
236
+ - spec/fixtures/rdxport_list_cut.xml
233
237
  - spec/fixtures/rdxport_list_cuts.xml
234
238
  - spec/fixtures/rdxport_list_groups.xml
235
239
  - spec/rivendell/api/cart_spec.rb