granicus-platform-api 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -4
- data/granicus-platform-api.gemspec +1 -2
- data/lib/granicus-platform-api/client.rb +76 -12
- data/lib/granicus-platform-api/entities.rb +147 -1
- data/lib/granicus-platform-api/version.rb +1 -1
- data/spec/granicus-platform-api_spec.rb +43 -55
- data/spec/helper.rb +4 -0
- metadata +20 -31
data/Gemfile.lock
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
granicus-platform-api (0.1.
|
4
|
+
granicus-platform-api (0.1.1)
|
5
5
|
hashie (~> 1.0.0)
|
6
|
-
multi_xml (~> 0.2.2)
|
7
6
|
savon (~> 0.9.2)
|
8
7
|
|
9
8
|
GEM
|
@@ -17,7 +16,6 @@ GEM
|
|
17
16
|
httpi (0.9.4)
|
18
17
|
pyu-ntlm-http (>= 0.1.3.1)
|
19
18
|
rack
|
20
|
-
multi_xml (0.2.2)
|
21
19
|
nokogiri (1.4.4)
|
22
20
|
nori (1.0.1)
|
23
21
|
pyu-ntlm-http (0.1.3.1)
|
@@ -36,6 +34,9 @@ GEM
|
|
36
34
|
httpi (>= 0.7.8)
|
37
35
|
nokogiri (>= 1.4.0)
|
38
36
|
nori (>= 0.2.0)
|
37
|
+
simplecov (0.4.2)
|
38
|
+
simplecov-html (~> 0.4.4)
|
39
|
+
simplecov-html (0.4.4)
|
39
40
|
|
40
41
|
PLATFORMS
|
41
42
|
ruby
|
@@ -43,6 +44,6 @@ PLATFORMS
|
|
43
44
|
DEPENDENCIES
|
44
45
|
granicus-platform-api!
|
45
46
|
hashie (~> 1.0.0)
|
46
|
-
multi_xml (~> 0.2.2)
|
47
47
|
rspec (~> 2.6)
|
48
48
|
savon (~> 0.9.2)
|
49
|
+
simplecov (~> 0.4.0)
|
@@ -20,11 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
22
|
s.add_development_dependency('rspec', '~> 2.6')
|
23
|
+
s.add_development_dependency('simplecov', '~> 0.4.0')
|
23
24
|
s.add_development_dependency('hashie', '~> 1.0.0')
|
24
25
|
s.add_development_dependency('savon', '~> 0.9.2')
|
25
|
-
s.add_development_dependency('multi_xml', '~> 0.2.2')
|
26
26
|
|
27
27
|
s.add_dependency('savon', '~> 0.9.2')
|
28
28
|
s.add_dependency('hashie', '~> 1.0.0')
|
29
|
-
s.add_dependency('multi_xml', '~> 0.2.2')
|
30
29
|
end
|
@@ -1,6 +1,4 @@
|
|
1
1
|
require 'savon'
|
2
|
-
require 'hashie'
|
3
|
-
require 'multi_xml'
|
4
2
|
|
5
3
|
module GranicusPlatformAPI
|
6
4
|
class Client
|
@@ -19,9 +17,27 @@ module GranicusPlatformAPI
|
|
19
17
|
|
20
18
|
self.typegenerators = {}
|
21
19
|
|
20
|
+
self.typegenerators["AgendaItem"] = lambda { AgendaItem.new }
|
21
|
+
self.typegenerators["Attendee"] = lambda { Attendee.new }
|
22
|
+
self.typegenerators["AttendeeStatus"] = lambda { AttendeeStatus.new }
|
22
23
|
self.typegenerators["CameraData"] = lambda { CameraData.new }
|
24
|
+
self.typegenerators["CaptionData"] = lambda { CaptionData.new }
|
25
|
+
self.typegenerators["ClipData"] = lambda { ClipData.new }
|
26
|
+
self.typegenerators["Document"] = lambda { Document.new }
|
23
27
|
self.typegenerators["EventData"] = lambda { EventData.new }
|
24
|
-
self.typegenerators["
|
28
|
+
self.typegenerators["FolderData"] = lambda { FolderData.new }
|
29
|
+
self.typegenerators["GroupData"] = lambda { GroupData.new }
|
30
|
+
self.typegenerators["KeyMapping"] = lambda { KeyMapping.new }
|
31
|
+
self.typegenerators["MetaDataData"] = lambda { MetaDataData.new }
|
32
|
+
self.typegenerators["Motion"] = lambda { Motion.new }
|
33
|
+
self.typegenerators["Note"] = lambda { Note.new }
|
34
|
+
self.typegenerators["Rollcall"] = lambda { Rollcall.new }
|
35
|
+
self.typegenerators["ServerData"] = lambda { ServerData.new }
|
36
|
+
self.typegenerators["ServerInterfaceData"] = lambda { ServerInterfaceData.new }
|
37
|
+
self.typegenerators["TemplateData"] = lambda { TemplateData.new }
|
38
|
+
self.typegenerators["ViewData"] = lambda { ViewData.new }
|
39
|
+
self.typegenerators["VoteEntry"] = lambda { VoteEntry.new }
|
40
|
+
self.typegenerators["VoteRecord"] = lambda { VoteRecord.new }
|
25
41
|
|
26
42
|
# classmap for generating proper attributes! hash within savon calls
|
27
43
|
def self.classmap
|
@@ -32,15 +48,36 @@ module GranicusPlatformAPI
|
|
32
48
|
@@classmap = obj
|
33
49
|
end
|
34
50
|
|
51
|
+
# built-in types
|
35
52
|
self.classmap = {}
|
36
53
|
self.classmap['Fixnum'] = "xsd:int"
|
37
54
|
self.classmap['String'] = "xsd:string"
|
38
55
|
self.classmap['TrueClass'] = 'xsd:boolean'
|
39
56
|
self.classmap['FalseClass'] = 'xsd:boolean'
|
40
57
|
self.classmap['Time'] = 'xsd:dateTime'
|
58
|
+
|
59
|
+
# start custom types
|
60
|
+
self.classmap['AgendaItem'] = 'granicus:AgendaItem'
|
61
|
+
self.classmap['Attendee'] = 'granicus:Attendee'
|
62
|
+
self.classmap['AttendeeStatus'] = 'granicus:AttendeeStatus'
|
41
63
|
self.classmap['CameraData'] = 'granicus:CameraData'
|
64
|
+
self.classmap['CaptionData'] = 'granicus:CaptionData'
|
65
|
+
self.classmap['ClipData'] = 'granicus:ClipData'
|
66
|
+
self.classmap['Document'] = 'granicus:Document'
|
42
67
|
self.classmap['EventData'] = 'granicus:EventData'
|
43
|
-
self.classmap['
|
68
|
+
self.classmap['FolderData'] = 'granicus:FolderData'
|
69
|
+
self.classmap['GroupData'] = 'granicus:GroupData'
|
70
|
+
self.classmap['KeyMapping'] = 'granicus:KeyMapping'
|
71
|
+
self.classmap['MetaDataData'] = 'granicus:MetaDataData'
|
72
|
+
self.classmap['Motion'] = 'granicus:Motion'
|
73
|
+
self.classmap['Note'] = 'granicus:Note'
|
74
|
+
self.classmap['Rollcall'] = 'granicus:Rollcall'
|
75
|
+
self.classmap['ServerData'] = 'granicus:ServerData'
|
76
|
+
self.classmap['ServerInterfaceData'] = 'granicus:ServerInterfaceData'
|
77
|
+
self.classmap['TemplateData'] = 'granicus:TemplateData'
|
78
|
+
self.classmap['ViewData'] = 'granicus:ViewData'
|
79
|
+
self.classmap['VoteEntry'] = 'granicus:VoteEntry'
|
80
|
+
self.classmap['VoteRecord'] = 'granicus:VoteRecord'
|
44
81
|
|
45
82
|
# create a connected client
|
46
83
|
def initialize(granicus_site,username,password,options={})
|
@@ -55,7 +92,7 @@ module GranicusPlatformAPI
|
|
55
92
|
@client = Savon::Client.new do |wsdl, http|
|
56
93
|
wsdl.document = File.expand_path("../granicus-platform-api.xml", __FILE__)
|
57
94
|
wsdl.endpoint = "http://#{granicus_site}/SDK/User/index.php"
|
58
|
-
http.proxy = options[:proxy]
|
95
|
+
http.proxy = options[:proxy] if not options[:proxy].nil?
|
59
96
|
end
|
60
97
|
|
61
98
|
# call login
|
@@ -77,10 +114,25 @@ module GranicusPlatformAPI
|
|
77
114
|
call_soap_method(:get_cameras,'//ns5:GetCamerasResponse/cameras')
|
78
115
|
end
|
79
116
|
|
80
|
-
#
|
117
|
+
# create a camera
|
118
|
+
def create_camera(camera)
|
119
|
+
call_soap_method(:create_camera,'//ns4:CreateCameraResponse/CameraID',{ :camera_data => camera })
|
120
|
+
end
|
121
|
+
|
122
|
+
# return the requested camera
|
81
123
|
def get_camera(camera_id)
|
82
124
|
call_soap_method(:get_camera,'//ns5:GetCameraResponse/camera',{ :camera_id => camera_id })
|
83
125
|
end
|
126
|
+
|
127
|
+
# update a camera
|
128
|
+
def update_camera(camera)
|
129
|
+
call_soap_method(:update_camera,'//ns4:UpdateCameraResponse',{ :camera => camera })
|
130
|
+
end
|
131
|
+
|
132
|
+
# delete the requested camera
|
133
|
+
def delete_camera(camera_id)
|
134
|
+
call_soap_method(:delete_camera,'//ns4:DeleteCameraResponse',{ :camera_id => camera_id})
|
135
|
+
end
|
84
136
|
|
85
137
|
# return all of the events
|
86
138
|
def get_events
|
@@ -92,6 +144,11 @@ module GranicusPlatformAPI
|
|
92
144
|
call_soap_method(:get_events_by_foreign_id,'//ns5:GetEventsByForeignIDResponse/events',{ :foreign_id => foreign_id })
|
93
145
|
end
|
94
146
|
|
147
|
+
# create an event
|
148
|
+
def create_event(event)
|
149
|
+
call_soap_method(:create_event,'//ns4:CreateEventResponse/EventID',{ :event_data => event })
|
150
|
+
end
|
151
|
+
|
95
152
|
# return the requested event
|
96
153
|
def get_event(event_id)
|
97
154
|
call_soap_method(:get_event,'//ns5:GetEventResponse/event',{ :event_id => event_id })
|
@@ -101,6 +158,11 @@ module GranicusPlatformAPI
|
|
101
158
|
def update_event(event)
|
102
159
|
call_soap_method(:update_event,'//ns4:UpdateEventResponse',{ :event => event })
|
103
160
|
end
|
161
|
+
|
162
|
+
# delete the requested event
|
163
|
+
def delete_event(event_id)
|
164
|
+
call_soap_method(:delete_event,'//ns4:DeleteEventResponse',{ :event_id => event_id})
|
165
|
+
end
|
104
166
|
|
105
167
|
# return all of the event meta data
|
106
168
|
def get_event_meta_data(event_id)
|
@@ -116,6 +178,11 @@ module GranicusPlatformAPI
|
|
116
178
|
def get_clip_meta_data(clip_id)
|
117
179
|
call_soap_method(:get_clip_meta_data,'//ns5:GetClipMetaDataResponse/metadata',{ :clip_id => clip_id })
|
118
180
|
end
|
181
|
+
|
182
|
+
# get meta data by id
|
183
|
+
def get_meta_data(meta_id)
|
184
|
+
call_soap_method(:get_meta_data,'//ns5:GetMetaDataResponse/MetaData', { :meta_data_id => meta_id })
|
185
|
+
end
|
119
186
|
|
120
187
|
# return all of the folders
|
121
188
|
def get_folders
|
@@ -178,7 +245,7 @@ module GranicusPlatformAPI
|
|
178
245
|
attributes = {}
|
179
246
|
hash.each do |key,value|
|
180
247
|
case value.class.to_s
|
181
|
-
when
|
248
|
+
when /GranicusPlatformAPI::/, 'Hash'
|
182
249
|
hash[key] = prepare_request value
|
183
250
|
when 'Array'
|
184
251
|
hash[key] = prepare_array value
|
@@ -191,7 +258,7 @@ module GranicusPlatformAPI
|
|
191
258
|
def prepare_array(array)
|
192
259
|
array.each_index do |index|
|
193
260
|
case array[index].class.to_s
|
194
|
-
when
|
261
|
+
when /GranicusPlatformAPI::/, 'Hash'
|
195
262
|
array[index] = prepare_request array[index]
|
196
263
|
end
|
197
264
|
end
|
@@ -200,8 +267,6 @@ module GranicusPlatformAPI
|
|
200
267
|
|
201
268
|
def attribute_of(value)
|
202
269
|
case value.class.to_s
|
203
|
-
when 'Hashie::Mash','Hash'
|
204
|
-
nil
|
205
270
|
when 'Array'
|
206
271
|
xsd_type = self.class.classmap[value[0].class.to_s.split('::').last]
|
207
272
|
if xsd_type.nil?
|
@@ -244,14 +309,13 @@ module GranicusPlatformAPI
|
|
244
309
|
node.to_s
|
245
310
|
end
|
246
311
|
else
|
247
|
-
# we have a custom type,
|
312
|
+
# we have a custom type, attempt to generate it. if that fails use a hash
|
248
313
|
proc = self.class.typegenerators[type]
|
249
314
|
value = {}
|
250
315
|
unless proc.nil?
|
251
316
|
value = proc.call
|
252
317
|
else
|
253
318
|
puts "Unknown custom type: #{type}"
|
254
|
-
value = ::Hashie::Mash.new
|
255
319
|
end
|
256
320
|
node.children.each do |value_node|
|
257
321
|
value[value_node.name] = handle_response value_node
|
@@ -1,6 +1,11 @@
|
|
1
1
|
require 'hashie'
|
2
2
|
|
3
3
|
module GranicusPlatformAPI
|
4
|
+
class AgendaItem < Hashie::Dash
|
5
|
+
property :Department
|
6
|
+
property :Actions
|
7
|
+
end
|
8
|
+
|
4
9
|
class Attendee < Hashie::Dash
|
5
10
|
property :ID
|
6
11
|
property :Name
|
@@ -9,17 +14,63 @@ module GranicusPlatformAPI
|
|
9
14
|
property :Chair
|
10
15
|
end
|
11
16
|
|
17
|
+
class AttendeeStatus < Hashie::Dash
|
18
|
+
property :Name
|
19
|
+
property :Status
|
20
|
+
end
|
21
|
+
|
12
22
|
class CameraData < Hashie::Dash
|
13
23
|
property :ID
|
14
24
|
property :Type
|
15
25
|
property :Name
|
16
26
|
property :InternalIP
|
17
|
-
|
27
|
+
property :ExternalIP
|
18
28
|
property :BroadcastPort
|
19
29
|
property :ControlPort
|
20
30
|
property :Identifier
|
21
31
|
end
|
22
32
|
|
33
|
+
class CaptionData < Hashie::Dash
|
34
|
+
property :Caption
|
35
|
+
property :TimeStamp
|
36
|
+
end
|
37
|
+
|
38
|
+
class ClipData < Hashie::Dash
|
39
|
+
property :ID
|
40
|
+
property :UID
|
41
|
+
property :ForeignID
|
42
|
+
property :Type
|
43
|
+
property :Name
|
44
|
+
property :Description
|
45
|
+
property :Keywords
|
46
|
+
property :Date
|
47
|
+
property :CameraID
|
48
|
+
property :FolderID
|
49
|
+
property :FileName
|
50
|
+
property :MinutesType
|
51
|
+
property :MinutesFile
|
52
|
+
property :AgendaType
|
53
|
+
property :AgendaFile
|
54
|
+
property :Duration
|
55
|
+
property :Status
|
56
|
+
property :StartTime
|
57
|
+
property :LastModified
|
58
|
+
property :Attendees
|
59
|
+
property :MotionTypes
|
60
|
+
property :Street1
|
61
|
+
property :Street2
|
62
|
+
property :City
|
63
|
+
property :State
|
64
|
+
property :Zip
|
65
|
+
property :AgendaTitle
|
66
|
+
property :AgendaPostedDate
|
67
|
+
end
|
68
|
+
|
69
|
+
class Document < Hashie::Dash
|
70
|
+
property :Description
|
71
|
+
property :Location
|
72
|
+
end
|
73
|
+
|
23
74
|
class EventData < Hashie::Dash
|
24
75
|
property :ID
|
25
76
|
property :UID
|
@@ -59,4 +110,99 @@ module GranicusPlatformAPI
|
|
59
110
|
property :Views
|
60
111
|
property :Servers
|
61
112
|
end
|
113
|
+
|
114
|
+
class GroupData < Hashie::Dash
|
115
|
+
property :ID
|
116
|
+
property :Name
|
117
|
+
property :Description
|
118
|
+
property :CreatedDate
|
119
|
+
end
|
120
|
+
|
121
|
+
class KeyMapping < Hashie::Dash
|
122
|
+
property :ForeignID
|
123
|
+
property :GranicusID
|
124
|
+
end
|
125
|
+
|
126
|
+
class MetaDataData < Hashie::Dash
|
127
|
+
property :ID
|
128
|
+
property :UID
|
129
|
+
property :ParentID
|
130
|
+
property :ParentUID
|
131
|
+
property :ForeignID
|
132
|
+
property :SourceID
|
133
|
+
property :Name
|
134
|
+
property :TimeStamp
|
135
|
+
property :OrderID
|
136
|
+
property :Payload
|
137
|
+
property :Children
|
138
|
+
end
|
139
|
+
|
140
|
+
class Motion < Hashie::Dash
|
141
|
+
property :Mover
|
142
|
+
property :Seconder
|
143
|
+
property :Type
|
144
|
+
property :MotionText
|
145
|
+
end
|
146
|
+
|
147
|
+
class Note < Hashie::Dash
|
148
|
+
property :NoteText
|
149
|
+
property :EditorsNotes
|
150
|
+
property :Private
|
151
|
+
end
|
152
|
+
|
153
|
+
class Rollcall < Hashie::Dash
|
154
|
+
property :Attendees
|
155
|
+
end
|
156
|
+
|
157
|
+
class ServerData < Hashie::Dash
|
158
|
+
property :ID
|
159
|
+
property :Name
|
160
|
+
property :ControlPort
|
161
|
+
property :FirewallCompatibility
|
162
|
+
property :Multicast
|
163
|
+
property :LoadBalancerScore
|
164
|
+
property :ReplicationUN
|
165
|
+
property :ReplicationPW
|
166
|
+
property :CreatedDate
|
167
|
+
end
|
168
|
+
|
169
|
+
class ServerInterfaceData < Hashie::Dash
|
170
|
+
property :ID
|
171
|
+
property :ServerID
|
172
|
+
property :Name
|
173
|
+
property :Host
|
174
|
+
property :ControlPort
|
175
|
+
property :Directory
|
176
|
+
property :ReplicationUN
|
177
|
+
property :ReplicationPW
|
178
|
+
end
|
179
|
+
|
180
|
+
class TemplateData < Hashie::Dash
|
181
|
+
property :ID
|
182
|
+
property :Name
|
183
|
+
property :Description
|
184
|
+
property :Type
|
185
|
+
property :LastModified
|
186
|
+
property :CreatedDate
|
187
|
+
end
|
188
|
+
|
189
|
+
class ViewData < Hashie::Dash
|
190
|
+
property :ID
|
191
|
+
property :ForeignID
|
192
|
+
property :Name
|
193
|
+
property :IsActive
|
194
|
+
property :Events
|
195
|
+
property :Folders
|
196
|
+
end
|
197
|
+
|
198
|
+
class VoteEntry < Hashie::Dash
|
199
|
+
property :Name
|
200
|
+
property :Vote
|
201
|
+
end
|
202
|
+
|
203
|
+
class VoteRecord < Hashie::Dash
|
204
|
+
property :MotionID
|
205
|
+
property :Passed
|
206
|
+
property :Votes
|
207
|
+
end
|
62
208
|
end
|
@@ -19,53 +19,54 @@ SERVER_ID = 2
|
|
19
19
|
client = GranicusPlatformAPI::Client.new GRANICUS_SITE, GRANICUS_LOGIN, GRANICUS_PASSWORD, {:proxy => 'http://localhost:8888'}
|
20
20
|
|
21
21
|
# The projects method
|
22
|
-
describe GranicusPlatformAPI, "::Client.
|
22
|
+
describe GranicusPlatformAPI, "::Client.new" do
|
23
23
|
it "should log me in" do
|
24
24
|
logon = client.get_current_user_logon
|
25
25
|
logon.should == GRANICUS_LOGIN
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
describe GranicusPlatformAPI, "::Client
|
29
|
+
describe GranicusPlatformAPI, "::Client Camera Methods" do
|
30
30
|
it "should get my cameras" do
|
31
31
|
cameras = client.get_cameras
|
32
32
|
found = cameras.find {|c| c.ID == CAMERA_ID }
|
33
33
|
found.should_not == nil
|
34
34
|
end
|
35
|
-
|
36
|
-
|
37
|
-
describe GranicusPlatformAPI, "::Client.get_camera" do
|
38
|
-
it "should get the requested camera" do
|
35
|
+
it "should create, retreive, update and delete a camera" do
|
39
36
|
camera = client.get_camera CAMERA_ID
|
40
|
-
|
37
|
+
new_camera_id = client.create_camera camera
|
38
|
+
camera2 = client.get_camera new_camera_id
|
39
|
+
camera2.Name = 'test my new camera'
|
40
|
+
client.update_camera camera2
|
41
|
+
camera3 = client.get_camera new_camera_id
|
42
|
+
camera3.Name.should == 'test my new camera'
|
43
|
+
client.delete_camera new_camera_id
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
44
|
-
describe GranicusPlatformAPI, "::Client
|
45
|
-
it "should get
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
describe GranicusPlatformAPI, "::Client Event Methods" do
|
48
|
+
it "should get all events" do
|
49
|
+
events = client.get_events
|
50
|
+
found = events.find {|e| e.ID == EVENT_ID }
|
51
|
+
found.should_not == nil
|
52
|
+
end
|
53
|
+
it "should get the requested event" do
|
54
|
+
event = client.get_event EVENT_ID
|
55
|
+
event.UID = ''
|
56
|
+
new_event_id = client.create_event event
|
57
|
+
event2 = client.get_event new_event_id
|
58
|
+
event2.Name = 'test my new event'
|
59
|
+
client.update_event event2
|
60
|
+
event3 = client.get_event new_event_id
|
61
|
+
event3.Name.should == 'test my new event'
|
62
|
+
client.delete_event new_event_id
|
49
63
|
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe GranicusPlatformAPI, "::Client.get_events_by_foreign_id" do
|
53
64
|
it "should get all events with matching foreign id" do
|
54
65
|
events = client.get_events_by_foreign_id EVENT_FOREIGN_ID
|
55
66
|
events.each do |event|
|
56
67
|
event.ForeignID.should == EVENT_FOREIGN_ID
|
57
68
|
end
|
58
69
|
end
|
59
|
-
end
|
60
|
-
|
61
|
-
describe GranicusPlatformAPI, "::Client.get_event" do
|
62
|
-
it "should get the requested event" do
|
63
|
-
event = client.get_event EVENT_ID
|
64
|
-
event.ID.should == EVENT_ID
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe GranicusPlatformAPI, "::Client.update_event" do
|
69
70
|
it "should update a simple property on requested event" do
|
70
71
|
event = client.get_event UPDATE_EVENT_ID
|
71
72
|
event.ID.should == UPDATE_EVENT_ID
|
@@ -86,85 +87,72 @@ describe GranicusPlatformAPI, "::Client.update_event" do
|
|
86
87
|
event.Attendees[0].Name = 'my test'
|
87
88
|
client.update_event event
|
88
89
|
end
|
89
|
-
|
90
|
-
|
91
|
-
describe GranicusPlatformAPI, "::Client.get_event_by_uid" do
|
92
|
-
it "should get the requested event" do
|
90
|
+
|
91
|
+
it "should get the requested event by UID" do
|
93
92
|
event = client.get_event_by_uid EVENT_UID
|
94
93
|
event.UID.should == EVENT_UID
|
95
94
|
end
|
96
|
-
|
97
|
-
|
98
|
-
describe GranicusPlatformAPI, "::Client.set_event_agenda_url" do
|
99
|
-
it "not return an error" do
|
95
|
+
|
96
|
+
it "set the event agenda url" do
|
100
97
|
event = client.set_event_agenda_url EVENT_ID, "http://github.com/gov20cto/granicus-platform-api"
|
101
98
|
end
|
102
99
|
end
|
103
100
|
|
104
|
-
describe GranicusPlatformAPI, "::Client
|
101
|
+
describe GranicusPlatformAPI, "::Client Folder Methods" do
|
105
102
|
it "should get my folders" do
|
106
103
|
folders = client.get_folders
|
107
104
|
folders[0].ID.should == FOLDER_ID
|
108
105
|
end
|
109
106
|
end
|
110
107
|
|
111
|
-
describe GranicusPlatformAPI, "::Client
|
108
|
+
describe GranicusPlatformAPI, "::Client Clip Methods" do
|
112
109
|
it "should get clips from the given folder" do
|
113
110
|
clips = client.get_clips FOLDER_ID
|
114
111
|
clips.each do |clip|
|
115
112
|
clip.FolderID.should == FOLDER_ID
|
116
113
|
end
|
117
114
|
end
|
118
|
-
end
|
119
|
-
|
120
|
-
describe GranicusPlatformAPI, "::Client.get_clips_by_foreign_id" do
|
121
115
|
it "should get all clips with matching foreign id" do
|
122
116
|
clips = client.get_clips_by_foreign_id CLIP_FOREIGN_ID
|
123
117
|
clips.each do |clip|
|
124
118
|
clip.ForeignID.should == CLIP_FOREIGN_ID
|
125
119
|
end
|
126
120
|
end
|
127
|
-
end
|
128
|
-
|
129
|
-
describe GranicusPlatformAPI, "::Client.get_clip" do
|
130
121
|
it "should get the requested clip" do
|
131
122
|
clip = client.get_clip CLIP_ID
|
132
123
|
clip.ID.should == CLIP_ID
|
133
124
|
end
|
134
|
-
|
135
|
-
|
136
|
-
describe GranicusPlatformAPI, "::Client.get_clip_by_uid" do
|
137
|
-
it "should get the requested clip" do
|
125
|
+
it "should get the requested clip by UID" do
|
138
126
|
clip = client.get_clip_by_uid CLIP_UID
|
139
127
|
clip.ID.should == CLIP_UID
|
140
128
|
end
|
141
129
|
end
|
142
130
|
|
143
|
-
describe GranicusPlatformAPI, "::Client
|
144
|
-
it "should get
|
131
|
+
describe GranicusPlatformAPI, "::Client MetaData Methods" do
|
132
|
+
it "should get an event's meta data" do
|
145
133
|
metadata = client.get_event_meta_data EVENT_ID
|
146
134
|
found = metadata.find {|m| m.ID == EVENT_META_ID }
|
147
135
|
found.should_not == nil
|
148
136
|
end
|
149
|
-
|
150
|
-
|
151
|
-
describe GranicusPlatformAPI, "::Client.get_clip_meta_data" do
|
152
|
-
it "should get my clip meta data" do
|
137
|
+
it "should get a clip's meta data" do
|
153
138
|
metadata = client.get_clip_meta_data CLIP_ID
|
154
139
|
found = metadata.find {|m| m.ID == CLIP_META_ID }
|
155
140
|
found.should_not == nil
|
156
141
|
end
|
142
|
+
|
143
|
+
it "should get the requested meta data" do
|
144
|
+
metadata = client.get_meta_data CLIP_META_ID
|
145
|
+
metadata.ID = CLIP_META_ID
|
146
|
+
puts metadata
|
147
|
+
end
|
157
148
|
end
|
158
149
|
|
159
|
-
describe GranicusPlatformAPI, "::Client
|
150
|
+
describe GranicusPlatformAPI, "::Client Server Methods" do
|
160
151
|
it "should get all servers" do
|
161
152
|
servers = client.get_servers
|
162
153
|
found = servers.find {|s| s.ID == SERVER_ID }
|
163
154
|
found.should_not == nil
|
164
155
|
end
|
165
|
-
end
|
166
|
-
|
167
|
-
describe GranicusPlatformAPI, "::Client.get_server" do
|
168
156
|
it "should get the requested server" do
|
169
157
|
server = client.get_server SERVER_ID
|
170
158
|
server.ID.should == SERVER_D
|
data/spec/helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: granicus-platform-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-06-
|
12
|
+
date: 2011-06-28 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2164634720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,43 +21,43 @@ dependencies:
|
|
21
21
|
version: '2.6'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2164634720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement: &
|
26
|
+
name: simplecov
|
27
|
+
requirement: &2164634220 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 0.4.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2164634220
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement: &
|
37
|
+
name: hashie
|
38
|
+
requirement: &2164633760 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 1.0.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2164633760
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: &
|
48
|
+
name: savon
|
49
|
+
requirement: &2164633300 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.9.2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2164633300
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: savon
|
60
|
-
requirement: &
|
60
|
+
requirement: &2164632840 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.9.2
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2164632840
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: hashie
|
71
|
-
requirement: &
|
71
|
+
requirement: &2164632380 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,18 +76,7 @@ dependencies:
|
|
76
76
|
version: 1.0.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
|
-
name: multi_xml
|
82
|
-
requirement: &2156840900 !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
|
-
requirements:
|
85
|
-
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: 0.2.2
|
88
|
-
type: :runtime
|
89
|
-
prerelease: false
|
90
|
-
version_requirements: *2156840900
|
79
|
+
version_requirements: *2164632380
|
91
80
|
description: Wrapper for the Granicus Open Platform API v1.x
|
92
81
|
email: javier@granicus.com
|
93
82
|
executables: []
|