kaltura_fu 0.1.1.prel → 0.1.2.prel

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -1,4 +1,4 @@
1
- kaltura_fu
1
+ Kaltura_Fu
2
2
  --------------
3
3
  **Homepage**: [http://www.velir.com](http://www.velir.com)
4
4
  **Author**: [Patrick Robertson](mailto:patrick.robertson@velir.com)
@@ -9,58 +9,25 @@ About Kaltura
9
9
  ----------------
10
10
  [Kaltura](http://kaltura.org/) is an open source video streaming service.
11
11
 
12
- About kaltura_fu
12
+ About Kaltura_Fu
13
13
  ------------------
14
14
 
15
- kaltura_fu is a rails plugin that extends the basic functionality of the Kaltura ruby client and adds in some Rails view helpers to generate video players, thumbnails, and the uploader.
15
+ kaltura_fu is a gem for rails that extends the basic functionality of the Kaltura ruby client and adds in some Rails view helpers to generate video players, thumbnails, and the uploader. The Kaltura session and client are managed in a singleton pattern, and there are additional modules that allow you to more perform basic API actions in a more efficient manner.
16
16
 
17
17
  Installation:
18
18
  -------------
19
- Install the plugin with the command
20
- script/plugin install git@github.com:patricksrobertson/kaltura_fu.git
21
- Run
22
- rake kaltura_fu:install:all
23
- This will install the config/kaltura.yml file into your application's root directory and the kaltura_upload.js into the application's public/javascripts directory. You may choose to run these commands instead:
24
- rake kaltura_fu:install:config
25
- rake kaltura_fu:install:js
19
+ Install the gem with the command:
20
+
21
+ gem install kaltura_fu --pre
22
+ Run:
23
+
24
+ script/generate kaltura_fu_install
25
+
26
+ This will install the kaltura.yml file into your application's config directory and the kaltura_upload.js into the application's public/javascripts directory.
26
27
 
27
28
 
28
- Usage:
29
+ Documentation:
29
30
  ------
30
- Kaltura_fu provides four ActionView helper methods presently:
31
+ The full documentation is located [here](http://rdoc.info/github/Velir/kaltura_fu/).
31
32
 
32
- * include_kaltura_fu
33
- * kaltura_thumbnail(entry_id, options={})
34
- * kaltura_player_embed(entry_id,options={})
35
- * kaltura_upload_embed(options={})
36
-
37
- include_kaltura_fu embeds the kaltura_upload.js into the header.
38
-
39
- kaltura_thumbnail(entry_id, options={}) has the following parameters:
40
-
41
- * entry_id - The Kaltura entry_id of which you want to display a thumbnail
42
- * hash of options. The supported options are:
43
-
44
- * :size=> Array of integers. [width,height]. This can be defaulted in the config with thumb_width and thumb_height.
45
- * :second=> Integer. Specify the second of the video to create the thumbnail with.
46
-
47
- kaltura_player_embed(entry_id,options={}) has the following parameters:
48
-
49
- * entry_id - The Kaltura entry_id that you want to display in the player.
50
- * hash of options. The supported options are:
51
-
52
- * :div_id=> String. Specifies the div ID of the object that will be embeded. Defaults to kplayer.
53
- * :player_conf_id=> String. The configuration ID of the player to use. This can be defaulted in the config with player_conf_id.
54
-
55
- kaltura_upload_embed(options={}) has the following parameters:
56
-
57
- * hash of options: The supported options are:
58
-
59
- * none at this time.
60
-
61
-
62
- To Do's
63
- -------
64
- * Buff the options for the upload script a bit more.
65
-
66
- Copyright (c) 2010 [Patrick Robertson](http://www.velir.com), released under the MIT license
33
+ Copyright (c) 2010 [Velir Studios](http://www.velir.com), released under the MIT license
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 1
4
+ :patch: 2
5
5
  :build: prel
data/kaltura_fu.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{kaltura_fu}
8
- s.version = "0.1.1.prel"
8
+ s.version = "0.1.2.prel"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Patrick Robertson"]
12
- s.date = %q{2010-10-07}
12
+ s.date = %q{2010-10-11}
13
13
  s.email = %q{patrick.robertson@velir.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown"
@@ -27,13 +27,13 @@ Gem::Specification.new do |s|
27
27
  "kaltura_fu.gemspec",
28
28
  "lib/kaltura_fu.rb",
29
29
  "lib/kaltura_fu/category.rb",
30
+ "lib/kaltura_fu/railtie.rb",
30
31
  "lib/kaltura_fu/report.rb",
31
32
  "lib/kaltura_fu/video.rb",
32
33
  "lib/kaltura_fu/view_helpers.rb",
33
34
  "rails/init.rb",
34
35
  "spec/kaltura_fu_spec.rb",
35
36
  "spec/spec_helper.rb",
36
- "tasks/kaltura_fu_tasks.rake",
37
37
  "test/kaltura_fu_test.rb",
38
38
  "test/test_helper.rb",
39
39
  "uninstall.rb"
@@ -0,0 +1,28 @@
1
+ require 'kaltura_fu'
2
+ require 'kaltura_fu/view_helpers'
3
+ require 'rails'
4
+
5
+ module KalturaFu
6
+ class Railtie < Rails::Railtie
7
+ initializer 'install kaltura_fu' do
8
+ $: << File.dirname(__FILE__) + '/../lib'
9
+
10
+ ActionView::Base.send :include, KalturaFu::ViewHelpers
11
+
12
+ kaltura_yml = File.join(RAILS_ROOT,'config','kaltura.yml')
13
+
14
+ unless File.exists?(kaltura_yml)
15
+ raise RuntimeError, "Unable to find \"config/kaltura.yml\" file."
16
+ end
17
+
18
+
19
+ KalturaFu.config = YAML.load_file(kaltura_yml).recursively_symbolize_keys[RAILS_ENV.to_sym]
20
+
21
+
22
+ unless[:partner_id,:subpartner_id,:administrator_secret].all? {|key| KalturaFu.config.key?(key)}
23
+ raise RuntimeError, "Kaltura config requires :partner_id, :subpartner_id,"+
24
+ "and :administrator_secret keys"
25
+ end
26
+ end
27
+ end
28
+ end
data/lib/kaltura_fu.rb CHANGED
@@ -31,6 +31,8 @@ end
31
31
  # KalturaFu.clear_session_key! #=> nil
32
32
  ##
33
33
  module KalturaFu
34
+
35
+ require 'kaltura_fu/railtie' if defined?(Rails) && Rails.version.split(".").first == "3"
34
36
  autoload :Video, 'kaltura_fu/video'
35
37
  autoload :Category, 'kaltura_fu/category'
36
38
  autoload :Report, 'kaltura_fu/report'
data/rails/init.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  $: << File.dirname(__FILE__) + '/../lib'
2
2
 
3
3
  require 'rubygems'
4
- #require 'kaltura-ruby'
4
+ require 'kaltura-ruby'
5
5
  require 'kaltura_fu'
6
6
 
7
7
  ActionView::Base.send :include, KalturaFu::ViewHelpers
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaltura_fu
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1876988247
4
+ hash: -1876988251
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
9
+ - 2
10
10
  - prel
11
- version: 0.1.1.prel
11
+ version: 0.1.2.prel
12
12
  platform: ruby
13
13
  authors:
14
14
  - Patrick Robertson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-07 00:00:00 -04:00
19
+ date: 2010-10-11 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -56,13 +56,13 @@ files:
56
56
  - kaltura_fu.gemspec
57
57
  - lib/kaltura_fu.rb
58
58
  - lib/kaltura_fu/category.rb
59
+ - lib/kaltura_fu/railtie.rb
59
60
  - lib/kaltura_fu/report.rb
60
61
  - lib/kaltura_fu/video.rb
61
62
  - lib/kaltura_fu/view_helpers.rb
62
63
  - rails/init.rb
63
64
  - spec/kaltura_fu_spec.rb
64
65
  - spec/spec_helper.rb
65
- - tasks/kaltura_fu_tasks.rake
66
66
  - test/kaltura_fu_test.rb
67
67
  - test/test_helper.rb
68
68
  - uninstall.rb
@@ -1,45 +0,0 @@
1
- require 'fileutils'
2
- CONFIG = File.join Rails.root, "config"
3
- PUBLIC = File.join Rails.root, "public"
4
- JS = File.join PUBLIC, "javascripts"
5
- KALTURA_FU_PATH = File.join Rails.root, "vendor","plugins", "kaltura_fu"
6
-
7
- namespace :kaltura_fu do
8
-
9
- namespace :install do
10
-
11
- desc 'Install the Kaltura Config File'
12
- task :config do
13
- config_file = File.join(KALTURA_FU_PATH,"config","kaltura.yml")
14
-
15
- existing_config_file = File.join(CONFIG,"kaltura.yml")
16
- unless File.exists?(existing_config_file)
17
- FileUtils.cp_r config_file, CONFIG
18
- puts "Config File Loaded"
19
- else
20
- puts "Config File Already Exists"
21
- end
22
- end
23
-
24
- task :js do
25
- source_js_file = File.join(KALTURA_FU_PATH,"javascripts","kaltura_upload.js")
26
- target_js_file = File.join(JS,"kaltura_upload.js")
27
-
28
- unless File.exists?(target_js_file)
29
- FileUtils.cp_r source_js_file, JS
30
- puts "JS Files Loaded"
31
- else
32
- puts "JS Files already exist"
33
- end
34
- end
35
-
36
- task :all,
37
- :needs => ['kaltura_fu:install:config','kaltura_fu:install:js'] do
38
- puts "Kaltura Fu has been installed!"
39
- puts "---"
40
- end
41
-
42
- end
43
-
44
- end
45
-