streamapi 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,17 +26,17 @@ module StreamAPI
26
26
  attr_accessor :api_key, :secret_key, :site_id, :site_user_id, :username, :timeout, :debug
27
27
 
28
28
  def initialize(options={})
29
- raise(InvalidApiKeyError, "Missing api_key!") if options[:api_key].nil?
30
- raise(InvalidSecretKeyError, "Missing secret_key!") if options[:secret_key].nil?
31
- raise(InvalidSiteIdError, "Missing site_id!") if options[:site_id].nil?
29
+ raise(InvalidApiKeyError, "Missing api_key!") if options[:api_key].nil?
30
+ raise(InvalidSecretKeyError, "Missing secret_key!") if options[:secret_key].nil?
31
+ raise(InvalidSiteIdError, "Missing site_id!") if options[:site_id].nil?
32
32
 
33
- @api_key = options[:api_key]
34
- @@api_key = @api_key
35
- @secret_key = options[:secret_key]
36
- @site_id = options[:site_id]
37
- @username = options[:username] if options.has_key?('username')
33
+ @api_key = options[:api_key]
34
+ @@api_key = @api_key
35
+ @secret_key = options[:secret_key]
36
+ @site_id = options[:site_id]
37
+ @username = options[:username] if options.has_key?('username')
38
38
 
39
- return self
39
+ return self
40
40
  end
41
41
 
42
42
  def get_public_host_id(private_host_id = nil, site_user_id = nil)
@@ -49,12 +49,12 @@ module StreamAPI
49
49
  end
50
50
 
51
51
  def create_session(username = nil, fme_key = nil, is_video_private = nil, public_host_id = nil, site_user_id = nil)
52
- response = self.class.post("/session/create", :query=>preprocess_options({:username=>username,
52
+ response = self.class.post("/session/create", :query=>preprocess_options({:username=>username,
53
53
  :is_video_private=>is_video_private, :public_host_id=>public_host_id, :site_user_id=>site_user_id}))
54
54
  end
55
55
 
56
56
  def create_user(username)
57
- response = self.class.post("/session/create", :query => preprocess_options({:username => username}))
57
+ response = self.class.post("/session/create", :query => preprocess_options({:username => username}))
58
58
  end
59
59
 
60
60
  def get_live_session_status(public_host_id)
@@ -70,13 +70,11 @@ module StreamAPI
70
70
  def list_themes()
71
71
  themes = []
72
72
  response = self.class.get("/theme/list", :query => preprocess_options)
73
- # iterate themes
74
73
  end
75
74
 
76
75
  def list_live_sessions()
77
- live_sessions = []
78
- response = self.class.get("/session/live/list", :query => preprocess_options)
79
- # iterate results
76
+ live_sessions = []
77
+ response = self.class.get("/session/live/list", :query => preprocess_options)
80
78
  end
81
79
 
82
80
  def preprocess_options(options=nil)
@@ -91,8 +89,8 @@ module StreamAPI
91
89
  end
92
90
 
93
91
  def self.sign(options,secret,rid)
94
- options.delete_if{ options.has_key?('sig') }
95
- MD5.hexdigest(options.sort().collect{|v| v[1]}.join+secret+rid.to_s)
92
+ options.delete_if{ options.has_key?('sig') }
93
+ Digest::MD5.hexdigest(options.sort().collect{|v| v[1]}.join+secret+rid.to_s)
96
94
  end
97
95
  end
98
96
  end
@@ -1,3 +1,3 @@
1
1
  module Streamapi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/streamapi.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- require 'md5'
2
+ require 'digest/md5'
3
3
  require 'httparty'
4
4
  require 'streamapi/client'
5
5
  require 'streamapi/embed'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Panagiotis Papadoulos
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-04 00:00:00 +02:00
17
+ date: 2010-11-05 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20