kaltura_box 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +60 -0
- data/Rakefile +2 -0
- data/kaltura_box.gemspec +28 -0
- data/lib/generators/kaltura_box/install_generator.rb +16 -0
- data/lib/generators/templates/kaltura_box.rb +18 -0
- data/lib/generators/templates/kaltura_upload.js +67 -0
- data/lib/kaltura_box.rb +10 -0
- data/lib/kaltura_box/api.rb +13 -0
- data/lib/kaltura_box/category.rb +18 -0
- data/lib/kaltura_box/category/class_methods.rb +50 -0
- data/lib/kaltura_box/category/instance_methods.rb +30 -0
- data/lib/kaltura_box/client.rb +45 -0
- data/lib/kaltura_box/configuration.rb +22 -0
- data/lib/kaltura_box/entry.rb +36 -0
- data/lib/kaltura_box/entry/class_methods.rb +51 -0
- data/lib/kaltura_box/entry/instance_methods.rb +13 -0
- data/lib/kaltura_box/entry/metadata.rb +152 -0
- data/lib/kaltura_box/entry/metadata/class_and_instance_methods.rb +54 -0
- data/lib/kaltura_box/entry/metadata/class_methods.rb +69 -0
- data/lib/kaltura_box/version.rb +3 -0
- data/spec/api_spec.rb +22 -0
- data/spec/category_spec.rb +51 -0
- data/spec/entry_spec.rb +38 -0
- data/spec/metadata_spec.rb +256 -0
- data/spec/spec_helper.rb +68 -0
- data/spec/support/video.flv +0 -0
- data/vendor/kaltura-ruby-client/README +20 -0
- data/vendor/kaltura-ruby-client/Rakefile +19 -0
- data/vendor/kaltura-ruby-client/kaltura.gemspec +15 -0
- data/vendor/kaltura-ruby-client/kaltura.yml +7 -0
- data/vendor/kaltura-ruby-client/lib/kaltura.rb +31 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_client.rb +14450 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_client_base.rb +432 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_abc_screeners_watermark_access_control_client_plugin.rb +37 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_ad_cue_point_client_plugin.rb +108 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_annotation_client_plugin.rb +237 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_aspera_client_plugin.rb +61 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_attachment_client_plugin.rb +227 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_audit_client_plugin.rb +349 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_bulk_upload_client_plugin.rb +109 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_bulk_upload_csv_client_plugin.rb +55 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_bulk_upload_filter_client_plugin.rb +46 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_bulk_upload_xml_client_plugin.rb +40 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_caption_client_plugin.rb +406 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_caption_search_client_plugin.rb +138 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_code_cue_point_client_plugin.rb +97 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_content_distribution_client_plugin.rb +1717 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_cue_point_client_plugin.rb +290 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_document_client_plugin.rb +522 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_drm_client_plugin.rb +204 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_drop_folder_client_plugin.rb +810 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_drop_folder_xml_bulk_upload_client_plugin.rb +39 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_email_notification_client_plugin.rb +276 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb +405 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_external_media_client_plugin.rb +203 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_file_sync_client_plugin.rb +151 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_http_notification_client_plugin.rb +309 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_kontiki_client_plugin.rb +72 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_like_client_plugin.rb +82 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_metadata_client_plugin.rb +788 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_multi_centers_client_plugin.rb +45 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_short_link_client_plugin.rb +231 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_tag_search_client_plugin.rb +145 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_var_console_client_plugin.rb +238 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_velocix_client_plugin.rb +40 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_virus_scan_client_plugin.rb +263 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_webex_drop_folder_client_plugin.rb +121 -0
- data/vendor/kaltura-ruby-client/lib/kaltura_plugins/kaltura_widevine_client_plugin.rb +195 -0
- data/vendor/kaltura-ruby-client/license.txt +674 -0
- data/vendor/kaltura-ruby-client/test/access_control_service_test.rb +75 -0
- data/vendor/kaltura-ruby-client/test/base_entry_service_test.rb +267 -0
- data/vendor/kaltura-ruby-client/test/configuration_test.rb +178 -0
- data/vendor/kaltura-ruby-client/test/cue_point_service_test.rb +67 -0
- data/vendor/kaltura-ruby-client/test/data_service_test.rb +76 -0
- data/vendor/kaltura-ruby-client/test/document_service_test.rb +41 -0
- data/vendor/kaltura-ruby-client/test/media/test.mov +0 -0
- data/vendor/kaltura-ruby-client/test/media/test.pdf +0 -0
- data/vendor/kaltura-ruby-client/test/media/test.png +0 -0
- data/vendor/kaltura-ruby-client/test/media/test.swf +0 -0
- data/vendor/kaltura-ruby-client/test/media/test.wmv +0 -0
- data/vendor/kaltura-ruby-client/test/media_service_test.rb +294 -0
- data/vendor/kaltura-ruby-client/test/metadata_profile_service_test.rb +63 -0
- data/vendor/kaltura-ruby-client/test/test_helper.rb +59 -0
- metadata +220 -0
data/spec/entry_spec.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'active_record'
|
3
|
+
|
4
|
+
class Video < ActiveRecord::Base
|
5
|
+
include KalturaBox::Entry
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "KalturaBox::Entry" do
|
9
|
+
|
10
|
+
before(:each) { KalturaBoxTest.setup! }
|
11
|
+
|
12
|
+
describe "class methods" do
|
13
|
+
|
14
|
+
let(:videos) { Video.video_list }
|
15
|
+
|
16
|
+
context "video_list" do
|
17
|
+
it { expect(videos.class).to eq Array }
|
18
|
+
end
|
19
|
+
|
20
|
+
context "update all videos" do
|
21
|
+
before(:each) { KalturaBoxTest.setup_db! }
|
22
|
+
it { expect{Video.update_all_videos!}.to change{Video.count}.from(0).to(videos.count) }
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "instance methods" do
|
28
|
+
before(:all) { KalturaBoxTest.setup_db! }
|
29
|
+
|
30
|
+
let(:video) { Video.new(entry_id: "0_7ivwzhbh") }
|
31
|
+
|
32
|
+
context "get" do
|
33
|
+
it { expect(video.get.id).to eq "0_7ivwzhbh" }
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,256 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class Video < ActiveRecord::Base
|
4
|
+
include KalturaBox::Entry
|
5
|
+
end
|
6
|
+
|
7
|
+
describe "KalturaBox::Entry::Metadata" do
|
8
|
+
|
9
|
+
before(:each) { KalturaBoxTest.setup! }
|
10
|
+
before(:all) { KalturaBoxTest.setup_db! }
|
11
|
+
|
12
|
+
describe "getter/setter methods" do
|
13
|
+
|
14
|
+
it "should respond to getting valid entry attributes" do
|
15
|
+
test = Video.new
|
16
|
+
expect(test).to respond_to :get_name
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should respond to getting valid entry attributes" do
|
20
|
+
test = Video.new
|
21
|
+
expect(test).to respond_to :get_description
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should respond to getting valid entry attributes" do
|
25
|
+
test = Video.new
|
26
|
+
expect(test).to respond_to :get_categories
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should respond to setting valid entry attributes" do
|
30
|
+
test = Video.new
|
31
|
+
expect(test).to respond_to :set_description
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should respond to setting valid entry attributes" do
|
35
|
+
test = Video.new
|
36
|
+
expect(test).to respond_to :set_name
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should respond to setting valid entry attributes" do
|
40
|
+
test = Video.new
|
41
|
+
expect(test).to respond_to :set_categories
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should respond to adding valid entry attributes" do
|
45
|
+
test = Video.new
|
46
|
+
expect(test).to respond_to :add_categories
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should respond to adding valid entry attributes" do
|
50
|
+
test = Video.new
|
51
|
+
expect(test).to respond_to :add_tags
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should respond to adding valid entry attributes" do
|
55
|
+
test = Video.new
|
56
|
+
expect(test).to respond_to :add_admin_tags
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should not respond to getting invalid entry attributes" do
|
60
|
+
test = Video.new
|
61
|
+
expect(test).to_not respond_to :get_barack_obama
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should not respond to setting invalid entry attributes" do
|
65
|
+
test = Video.new
|
66
|
+
expect(test).to_not respond_to :set_magic
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should not respond to adding invalid entry attributes" do
|
70
|
+
test = Video.new
|
71
|
+
expect(test).to_not respond_to :add_waffles
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should not respond to adding invalid entry attributes" do
|
75
|
+
test = Video.new
|
76
|
+
expect(test).to_not respond_to :add_category
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should not respond to adding invalid entry attributes" do
|
80
|
+
test = Video.new
|
81
|
+
expect(test).to_not respond_to :add_tag
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should not respond to adding invalid entry attributes" do
|
85
|
+
test = Video.new
|
86
|
+
expect(test).to_not respond_to :add_admin_tag
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should not respond to adding valid entry attributes, but improperly typed" do
|
90
|
+
test = Video.new
|
91
|
+
expect(test).to_not respond_to :add_name
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should not respond to adding valid entry attributes, but improperly typed" do
|
95
|
+
test = Video.new
|
96
|
+
expect(test).to_not respond_to :add_names
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
describe "methods with @entry_id" do
|
102
|
+
|
103
|
+
let(:test_video) { Video.new(entry_id: @entry_id) }
|
104
|
+
|
105
|
+
before(:each) { @entry_id = Video.upload(KalturaBoxTest.sample_video, source: :file) }
|
106
|
+
|
107
|
+
it "should set the name field when asked kindly" do
|
108
|
+
expect(test_video.set_name("waffles")).to eq "waffles"
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should set the desription field when asked kindly" do
|
112
|
+
expect(test_video.set_description("The beginning of the end of the beginning")).to eq "The beginning of the end of the beginning"
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should be a little weirder when setting a group of tags" do
|
116
|
+
expect(test_video.set_tags("waffles,awesome,rock,hard")).to eq "waffles, awesome, rock, hard"
|
117
|
+
expect(test_video.get_tags).to eq "waffles, awesome, rock, hard"
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should just be weird with tags, admin tags don't act this way either" do
|
121
|
+
expect(test_video.set_admin_tags("waffles,awesome,rock,hard")).to eq "waffles,awesome,rock,hard"
|
122
|
+
expect(test_video.get_admin_tags).to eq "waffles,awesome,rock,hard"
|
123
|
+
end
|
124
|
+
|
125
|
+
it "shouldn't act like tags with categories" do
|
126
|
+
expect(test_video.set_categories("waffles,awesome,rock,hard")).to eq "waffles,awesome,rock,hard"
|
127
|
+
end
|
128
|
+
|
129
|
+
it "should raise a Kaltura::APIError when you give it a bogus entry" do
|
130
|
+
test = Video.new(entry_id: "waffles")
|
131
|
+
expect { test.set_name("waffles") }.to raise_error(Kaltura::KalturaAPIError)
|
132
|
+
end
|
133
|
+
|
134
|
+
it "should not increment the version when you perform set actions" do
|
135
|
+
version_count = test_video.get_version.to_i
|
136
|
+
|
137
|
+
test_video.set_name("my new name")
|
138
|
+
expect(test_video.get_version.to_i).to eq version_count
|
139
|
+
end
|
140
|
+
|
141
|
+
it "should not increment the version when you perform set actions on tags" do
|
142
|
+
version_count = test_video.get_version.to_i
|
143
|
+
|
144
|
+
test_video.set_tags("buttons,kittens,pirates")
|
145
|
+
expect(test_video.get_version.to_i).to eq version_count
|
146
|
+
end
|
147
|
+
|
148
|
+
xit "should be making KMC categories for every category you set unless it already exists." do
|
149
|
+
categories = "waffles#{rand(10)},pirates#{rand(18)},peanuts#{rand(44)}"
|
150
|
+
categories.split(",").each do |category|
|
151
|
+
expect(test_video.category_exists?(category)).to be_false
|
152
|
+
end
|
153
|
+
|
154
|
+
test_video.set_categories(categories)
|
155
|
+
|
156
|
+
categories.split(",").each do |category|
|
157
|
+
cat = test_video.category_exists?(category)
|
158
|
+
expect(cat).to be_false
|
159
|
+
end
|
160
|
+
|
161
|
+
bob = KalturaBox.client.category_service.list.objects
|
162
|
+
bob.each do |cat|
|
163
|
+
if cat.name =~/^(waffles|pirates|peanuts)(.*)/
|
164
|
+
KalturaBox.client.category_service.delete(cat.id)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
end
|
169
|
+
|
170
|
+
it "should allow you to add tags onto an existing tag string without knowing the original tags" do
|
171
|
+
original_tags = test_video.set_tags("gorillaz, pop, damon, albarn")
|
172
|
+
|
173
|
+
expect(test_video.add_tags("mos,def")).to eq original_tags + ", mos, def"
|
174
|
+
end
|
175
|
+
|
176
|
+
it "no longer responds to adding a single tag. dynamic dispatches are cooler than syntax sugar." do
|
177
|
+
original_tags = test_video.set_tags("gorillaz, pop, damon, albarn")
|
178
|
+
|
179
|
+
expect{test_video.add_tag("mos")}.to raise_error
|
180
|
+
end
|
181
|
+
|
182
|
+
it "should allow you to add admin tags onto an existing tag string without knowing the original tags" do
|
183
|
+
original_tags = test_video.set_admin_tags("gorillaz,pop,damon,albarn")
|
184
|
+
|
185
|
+
expect(test_video.add_admin_tags("mos,def")).to eq original_tags + ",mos,def"
|
186
|
+
end
|
187
|
+
|
188
|
+
it "no longer responds to adding a single admin tag" do
|
189
|
+
original_tags = test_video.set_admin_tags("gorillaz, pop, damon, albarn")
|
190
|
+
|
191
|
+
expect{test_video.add_admin_tag("mos")}.to raise_error
|
192
|
+
end
|
193
|
+
|
194
|
+
xit "should let you add categories onto an existing category string as well." do
|
195
|
+
original_categories = test_video.set_categories("peanuts#{rand(10)}")
|
196
|
+
|
197
|
+
new_cats = "pirates#{rand(10)},waffles#{rand(10)}"
|
198
|
+
expect(test_video.add_categories(new_cats)).to eq original_categories + ",#{new_cats}"
|
199
|
+
check_string = original_categories + ",#{new_cats}"
|
200
|
+
check_string.split(",").each do |category|
|
201
|
+
cat = test_video.category_exists?(category)
|
202
|
+
expect(cat).to_not be_false
|
203
|
+
end
|
204
|
+
bob = KalturaBox.client.category_service.list.objects
|
205
|
+
bob.each do |cat|
|
206
|
+
if cat.name =~/^(waffles|pirates|peanuts)(.*)/
|
207
|
+
KalturaBox.client.category_service.delete(cat.id)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
xit "should create categories for each one you add if they don't exist." do
|
213
|
+
original_categories = test_video.set_categories("peanuts#{rand(10)}")
|
214
|
+
|
215
|
+
new_cats = "pirates#{rand(10)},waffles#{rand(10)}"
|
216
|
+
test_video.add_categories(new_cats)
|
217
|
+
check_string = original_categories + ",#{new_cats}"
|
218
|
+
check_string.split(",").each do |category|
|
219
|
+
cat = test_video.category_exists?(category)
|
220
|
+
expect(cat).to_not be_false
|
221
|
+
end
|
222
|
+
bob = KalturaBox.client.category_service.list.objects
|
223
|
+
bob.each do |cat|
|
224
|
+
if cat.name =~/^(waffles|pirates|peanuts)(.*)/
|
225
|
+
KalturaBox.client.category_service.delete(cat.id)
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
xit "should no longer respond to adding a single category" do
|
231
|
+
original_categories = test_video.set_categories("peanuts#{rand(10)},pirates#{rand(10)}")
|
232
|
+
|
233
|
+
new_cat = "waffles#{rand(10)}"
|
234
|
+
expect{test_video.add_category(new_cat)}.to raise_error
|
235
|
+
|
236
|
+
bob = KalturaBox.client.category_service.list.objects
|
237
|
+
bob.each do |cat|
|
238
|
+
if cat.name =~/^(waffles|pirates|peanuts)(.*)/
|
239
|
+
KalturaBox.client.category_service.delete(cat.id)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
it "should let you set multiple fields at once with set()" do
|
245
|
+
name = "Mr Peanut's wild ride"
|
246
|
+
description = "Man this is a random name"
|
247
|
+
waffles = "Man waffles isn't an attribute"
|
248
|
+
test_video.set(@entry_id, :name=>name,:description=>description,:waffles=>waffles)
|
249
|
+
|
250
|
+
expect(test_video.get_name).to eq name
|
251
|
+
expect(test_video.get_description).to eq description
|
252
|
+
end
|
253
|
+
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
|
4
|
+
require 'rspec'
|
5
|
+
require 'kaltura_box'
|
6
|
+
|
7
|
+
module KalturaBoxTest
|
8
|
+
def self.setup!
|
9
|
+
KalturaBox.config do |c|
|
10
|
+
c.login_email = 'shinn@tinkerbox.com.sg'
|
11
|
+
c.login_password = 'enCdU64oGJQU+V'
|
12
|
+
c.partner_id = '1761822'
|
13
|
+
c.subpartner_id = '176182200'
|
14
|
+
c.administrator_secret = '694dec8e14bc48ee65dedb215fe655fc'
|
15
|
+
c.user_secret = '081e5b61615ef172b6c8e301d9712f57'
|
16
|
+
c.thumb_width = '300'
|
17
|
+
c.thumb_height = '300'
|
18
|
+
c.player_conf_id = '24691582'
|
19
|
+
c.service_url = 'http://www.kaltura.com'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.setup_db!
|
24
|
+
ActiveRecord::Base.logger = Logger.new(STDERR)
|
25
|
+
ActiveRecord::Base.establish_connection(
|
26
|
+
adapter: "sqlite3",
|
27
|
+
database: ":memory:"
|
28
|
+
)
|
29
|
+
|
30
|
+
migration = Class.new(ActiveRecord::Migration) do
|
31
|
+
|
32
|
+
def change
|
33
|
+
create_table :videos, force: true do |t|
|
34
|
+
t.string :entry_id
|
35
|
+
t.string :title
|
36
|
+
t.string :description
|
37
|
+
t.string :thumbnail_url
|
38
|
+
t.string :data_url
|
39
|
+
t.string :download_url
|
40
|
+
t.string :ms_duration
|
41
|
+
t.string :tags
|
42
|
+
t.string :plays
|
43
|
+
t.string :views
|
44
|
+
|
45
|
+
t.timestamps
|
46
|
+
end
|
47
|
+
|
48
|
+
create_table :categories, force: true do |t|
|
49
|
+
t.string :name
|
50
|
+
t.string :full_name
|
51
|
+
t.string :description
|
52
|
+
t.integer :ref_id
|
53
|
+
t.string :entries_count
|
54
|
+
t.integer :video_id
|
55
|
+
|
56
|
+
t.timestamps
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
migration.new.migrate(:up)
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.sample_video
|
66
|
+
File.open(File.join(File.dirname(__FILE__),'support','video.flv'))
|
67
|
+
end
|
68
|
+
end
|
Binary file
|
@@ -0,0 +1,20 @@
|
|
1
|
+
This source contains:
|
2
|
+
- The Kaltura client library (kaltura_client_base.rb)
|
3
|
+
- Auto generated core APIs (kaltura_client.rb)
|
4
|
+
- Auto generated plugin APIs (kaltura_plugins/*.rb)
|
5
|
+
- Ruby library test code and data files (test/*)
|
6
|
+
|
7
|
+
== DEPENDENCIES ==
|
8
|
+
|
9
|
+
RAKE (http://rake.rubyforge.org/)
|
10
|
+
Shoulda (gem install shoulda)
|
11
|
+
Rest_client (gem install rest-client)
|
12
|
+
|
13
|
+
== RUNNING THE CLIENT LIBRARY TESTS ==
|
14
|
+
|
15
|
+
IMPORTANT: never run the tests of the client library against a production account -
|
16
|
+
these tests perform modifications to account profiles.
|
17
|
+
|
18
|
+
Update kaltura.yml with your account information
|
19
|
+
Change directory to kaltura/ruby
|
20
|
+
Execute the command: rake test
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
require 'rake/testtask'
|
6
|
+
|
7
|
+
puts "\e[1;33;40mThese tests perform modifications to account settings and delete profiles associated with the account -
|
8
|
+
DO NOT RUN THEM ON A PRODUCTION ACCOUNT!\e[0m"
|
9
|
+
print "Do you want to continue (y/n) ?"
|
10
|
+
input = $stdin.gets.chomp!
|
11
|
+
if (input[0] == 'y')
|
12
|
+
Rake::TestTask.new(:test) do |test|
|
13
|
+
test.libs << '.' << 'test'
|
14
|
+
test.pattern = 'test/**/*_test.rb'
|
15
|
+
test.verbose = false
|
16
|
+
end
|
17
|
+
else
|
18
|
+
exit
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
spec = Gem::Specification.new do |s|
|
4
|
+
s.name = "kaltura-ruby-client"
|
5
|
+
s.version = "1.0"
|
6
|
+
s.date = '2012-04-16'
|
7
|
+
s.author = "Kaltura Inc."
|
8
|
+
s.email = "info@kaltura.com"
|
9
|
+
s.homepage = "http://www.kaltura.com/"
|
10
|
+
s.summary = "A gem implementation of Kaltura's Ruby Client"
|
11
|
+
s.description = "A gem implementation of Kaltura's Ruby Client."
|
12
|
+
s.files = FileList["lib/**/*.rb", "license.txt","Rakefile","README", "kaltura.yml"].to_a
|
13
|
+
s.test_files = FileList["{test}/test_helper.rb", "{test}/**/*test.rb", "{test}/media/*"].to_a
|
14
|
+
s.add_dependency('rest-client')
|
15
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# ===================================================================================================
|
2
|
+
# _ __ _ _
|
3
|
+
# | |/ /__ _| | |_ _ _ _ _ __ _
|
4
|
+
# | ' </ _` | | _| || | '_/ _` |
|
5
|
+
# |_|\_\__,_|_|\__|\_,_|_| \__,_|
|
6
|
+
#
|
7
|
+
# This file is part of the Kaltura Collaborative Media Suite which allows users
|
8
|
+
# to do with audio, video, and animation what Wiki platfroms allow them to do with
|
9
|
+
# text.
|
10
|
+
#
|
11
|
+
# Copyright (C) 2006-2011 Kaltura Inc.
|
12
|
+
#
|
13
|
+
# This program is free software: you can redistribute it and/or modify
|
14
|
+
# it under the terms of the GNU Affero General Public License as
|
15
|
+
# published by the Free Software Foundation, either version 3 of the
|
16
|
+
# License, or (at your option) any later version.
|
17
|
+
#
|
18
|
+
# This program is distributed in the hope that it will be useful,
|
19
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21
|
+
# GNU Affero General Public License for more details.
|
22
|
+
#
|
23
|
+
# You should have received a copy of the GNU Affero General Public License
|
24
|
+
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
25
|
+
#
|
26
|
+
# @ignore
|
27
|
+
# ===================================================================================================
|
28
|
+
module Kaltura
|
29
|
+
require 'kaltura_client.rb'
|
30
|
+
Dir[File.dirname(__FILE__) + '/kaltura_plugins/*.rb'].each {|file| require file }
|
31
|
+
end
|