canvas_webex 0.3.2 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/cisco_webex_conference.rb +5 -3
- data/lib/canvas_webex/meeting.rb +18 -1
- data/lib/canvas_webex/service.rb +9 -0
- data/lib/canvas_webex/version.rb +1 -1
- data/spec/fixtures/list_timezones.xml +23 -0
- data/spec/lib/canvas_webex/meeting_spec.rb +6 -0
- data/spec/lib/canvas_webex/service_spec.rb +7 -1
- metadata +4 -2
@@ -34,7 +34,7 @@ class CiscoWebexConference < WebConference
|
|
34
34
|
unless self.conference_key.present?
|
35
35
|
options = {}
|
36
36
|
options[:duration] = self.duration || 999999
|
37
|
-
options[:emails] = settings[:external_emails].nil? ? [] : settings[:external_emails].strip.split('
|
37
|
+
options[:emails] = settings[:external_emails].nil? ? [] : settings[:external_emails].strip.split(';')
|
38
38
|
webex_meeting = CanvasWebex::Meeting.create(self.title, options)
|
39
39
|
self.conference_key = webex_meeting.meeting_key
|
40
40
|
save
|
@@ -46,7 +46,9 @@ class CiscoWebexConference < WebConference
|
|
46
46
|
#
|
47
47
|
# Returns conference status as a symbol (either :active or :closed).
|
48
48
|
def conference_status
|
49
|
-
if
|
49
|
+
if self.started_at.nil?
|
50
|
+
:created
|
51
|
+
elsif meeting || !self.started_at.nil? && !self.ended_at
|
50
52
|
:active
|
51
53
|
else
|
52
54
|
unless self.ended_at
|
@@ -113,4 +115,4 @@ class CiscoWebexConference < WebConference
|
|
113
115
|
end
|
114
116
|
|
115
117
|
|
116
|
-
end
|
118
|
+
end
|
data/lib/canvas_webex/meeting.rb
CHANGED
@@ -49,10 +49,14 @@ module CanvasWebex
|
|
49
49
|
def self.recordings(meeting_key, client = CanvasWebex.client)
|
50
50
|
if response = meeting_key && client.list_recordings(meeting_key)
|
51
51
|
response.search('recording').map do |rec_xml|
|
52
|
+
created_ts = rec_xml.at_xpath('createTime').try(:text)
|
53
|
+
tz_id = rec_xml.at_xpath('timeZoneID').try(:text)
|
54
|
+
created_at = parse_time_stamp(tz_id, created_ts)
|
52
55
|
recording = {
|
53
56
|
recording_id: rec_xml.at_xpath('recordingID').try(:text),
|
54
57
|
title: rec_xml.at_xpath('name').try(:text),
|
55
|
-
playback_url: rec_xml.at_xpath('streamURL').try(:text)
|
58
|
+
playback_url: rec_xml.at_xpath('streamURL').try(:text),
|
59
|
+
created_at: parse_time_stamp(tz_id, created_ts).to_s
|
56
60
|
}
|
57
61
|
if duration = rec_xml.at_xpath('duration').try(:text)
|
58
62
|
recording[:duration_minutes] = duration.to_i / 60
|
@@ -64,6 +68,19 @@ module CanvasWebex
|
|
64
68
|
end
|
65
69
|
end
|
66
70
|
|
71
|
+
def self.parse_time_stamp(time_zone, time_stamp, client = CanvasWebex.client)
|
72
|
+
if response = client.list_time_zone(time_zone, time_stamp)
|
73
|
+
if m_offset = response.at_xpath('timeZone/gmtOffset').try(:text).try(:to_i)
|
74
|
+
offset_string = "%+0#3d:00" %[(m_offset / 60)]
|
75
|
+
DateTime.strptime(time_stamp + offset_string, '%m/%d/%Y %H:%M:%S%z')
|
76
|
+
else
|
77
|
+
DateTime.strptime(time_stamp, '%m/%d/%Y %H:%M:%S')
|
78
|
+
end
|
79
|
+
else
|
80
|
+
""
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
67
84
|
# Public: Create a new Meeting
|
68
85
|
#
|
69
86
|
# meeting_xml - The xml returned for a meeting (must already exist).
|
data/lib/canvas_webex/service.rb
CHANGED
@@ -94,6 +94,15 @@ module CanvasWebex
|
|
94
94
|
request(body)
|
95
95
|
end
|
96
96
|
|
97
|
+
def list_time_zone(id, date)
|
98
|
+
body = xml_request do |xml|
|
99
|
+
xml.bodyContent('xsi:type' => 'site.LstTimeZone'){
|
100
|
+
xml.timeZoneID id
|
101
|
+
xml.date date
|
102
|
+
}
|
103
|
+
end
|
104
|
+
request(body)
|
105
|
+
end
|
97
106
|
|
98
107
|
def xml_request(email = nil)
|
99
108
|
Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
|
data/lib/canvas_webex/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<serv:message xmlns:serv="http://www.webex.com/schemas/2002/06/service" xmlns:com="http://www.webex.com/schemas/2002/06/common" xmlns:ns1="http://www.webex.com/schemas/2002/06/service/site" xmlns:event="http://www.webex.com/schemas/2002/06/service/event">
|
3
|
+
<serv:header>
|
4
|
+
<serv:response>
|
5
|
+
<serv:result>SUCCESS</serv:result>
|
6
|
+
<serv:gsbStatus>PRIMARY</serv:gsbStatus>
|
7
|
+
</serv:response>
|
8
|
+
</serv:header>
|
9
|
+
<serv:body>
|
10
|
+
<serv:bodyContent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:lstTimeZoneResponse">
|
11
|
+
<ns1:timeZone>
|
12
|
+
<ns1:timeZoneID>4</ns1:timeZoneID>
|
13
|
+
<ns1:gmtOffset>-480</ns1:gmtOffset>
|
14
|
+
<ns1:description>GMT-08:00, Pacific (San Francisco)</ns1:description>
|
15
|
+
<ns1:shortName>San Francisco</ns1:shortName>
|
16
|
+
<ns1:hideTimeZoneName>false</ns1:hideTimeZoneName>
|
17
|
+
<ns1:fallInDST>false</ns1:fallInDST>
|
18
|
+
<ns1:standardLabel>Standard</ns1:standardLabel>
|
19
|
+
<ns1:daylightLabel>Daylight</ns1:daylightLabel>
|
20
|
+
</ns1:timeZone>
|
21
|
+
</serv:bodyContent>
|
22
|
+
</serv:body>
|
23
|
+
</serv:message>
|
@@ -28,4 +28,10 @@ describe CanvasWebex::Meeting do
|
|
28
28
|
subject.status.should == "NOT_INPROGRESS"
|
29
29
|
end
|
30
30
|
|
31
|
+
it 'parses a cisco timestamp' do
|
32
|
+
stub_call('list_timezones')
|
33
|
+
ts = CanvasWebex::Meeting.parse_time_stamp(4, '01/26/2006 21:00:00', client)
|
34
|
+
ts.to_s.should == '2006-01-26T21:00:00-08:00'
|
35
|
+
end
|
36
|
+
|
31
37
|
end
|
@@ -35,12 +35,18 @@ describe CanvasWebex::Service do
|
|
35
35
|
result.name.should == 'bodyContent'
|
36
36
|
end
|
37
37
|
|
38
|
-
it '
|
38
|
+
it 'gets a create a meeting response body' do
|
39
39
|
stub_call('create_meeting')
|
40
40
|
result = subject.create_meeting('test')
|
41
41
|
result.name.should == 'bodyContent'
|
42
42
|
end
|
43
43
|
|
44
|
+
it 'gets a time zone' do
|
45
|
+
stub_call('list_timezones')
|
46
|
+
result = subject.list_time_zone(4, '01/26/2006 21:00:00')
|
47
|
+
result.name.should == 'bodyContent'
|
48
|
+
end
|
49
|
+
|
44
50
|
|
45
51
|
end
|
46
52
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canvas_webex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.4'
|
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: 2013-11-
|
12
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- spec/fixtures/get_meeting.xml
|
119
119
|
- spec/fixtures/host_meeting_url.xml
|
120
120
|
- spec/fixtures/join_meeting_url.xml
|
121
|
+
- spec/fixtures/list_timezones.xml
|
121
122
|
- spec/fixtures/meeting_list.xml
|
122
123
|
- spec/fixtures/recording_list.xml
|
123
124
|
- spec/lib/canvas_webex/meeting_spec.rb
|
@@ -153,6 +154,7 @@ test_files:
|
|
153
154
|
- spec/fixtures/get_meeting.xml
|
154
155
|
- spec/fixtures/host_meeting_url.xml
|
155
156
|
- spec/fixtures/join_meeting_url.xml
|
157
|
+
- spec/fixtures/list_timezones.xml
|
156
158
|
- spec/fixtures/meeting_list.xml
|
157
159
|
- spec/fixtures/recording_list.xml
|
158
160
|
- spec/lib/canvas_webex/meeting_spec.rb
|