zoomus 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/zoomus.rb +11 -0
- data/lib/zoomus/actions/meeting.rb +6 -0
- data/lib/zoomus/client.rb +0 -1
- data/lib/zoomus/interface.rb +9 -0
- data/spec/fixtures/meeting_update.json +4 -0
- data/spec/lib/zoomus/actions/{meeting_spec.rb → meeting/create_spec.rb} +3 -26
- data/spec/lib/zoomus/actions/meeting/list_spec.rb +31 -0
- data/spec/lib/zoomus/actions/meeting/update_spec.rb +49 -0
- data/spec/lib/zoomus/actions/{user_spec.rb → user/create_spec.rb} +0 -18
- data/spec/lib/zoomus/actions/user/list_spec.rb +26 -0
- data/zoomus.gemspec +1 -1
- metadata +19 -10
data/lib/zoomus.rb
CHANGED
@@ -4,9 +4,20 @@ require 'zoomus/actions/meeting'
|
|
4
4
|
require 'zoomus/client'
|
5
5
|
|
6
6
|
module Zoomus
|
7
|
+
|
7
8
|
class << self
|
8
9
|
def new(*arg)
|
9
10
|
Zoomus::Client.new(*arg)
|
10
11
|
end
|
11
12
|
end
|
13
|
+
|
14
|
+
def self.included(base)
|
15
|
+
base.class_eval do
|
16
|
+
attr_accessor :zoomus_singleton
|
17
|
+
def zoomus_setup(api_key, api_secret)
|
18
|
+
@zoomus_singleton = Client.new(api_key, api_secret)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
12
23
|
end
|
@@ -14,6 +14,12 @@ module Zoomus
|
|
14
14
|
parse_response self.class.post("/meeting/create", :query => options)
|
15
15
|
end
|
16
16
|
|
17
|
+
def meeting_update(*args)
|
18
|
+
options = args.extract_options!
|
19
|
+
require_params([:id, :host_id, :topic, :type], options)
|
20
|
+
parse_response self.class.post("/meeting/update", :query => options)
|
21
|
+
end
|
22
|
+
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|
data/lib/zoomus/client.rb
CHANGED
@@ -7,29 +7,7 @@ describe Zoomus::Actions::Meeting do
|
|
7
7
|
@host_id = "ufR93M2pRyy8ePFN92dttq"
|
8
8
|
end
|
9
9
|
|
10
|
-
describe "#
|
11
|
-
before :each do
|
12
|
-
stub_request(:post, zoomus_url("/meeting/list")).to_return(:body => json_response("meeting_list"))
|
13
|
-
end
|
14
|
-
|
15
|
-
it "requires a 'host_id' argument" do
|
16
|
-
expect{@zc.meeting_list()}.to raise_error(ArgumentError)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "returns a hash" do
|
20
|
-
expect(@zc.meeting_list(:host_id => @host_id)).to be_kind_of(Hash)
|
21
|
-
end
|
22
|
-
|
23
|
-
it "returns 'total_records'" do
|
24
|
-
expect(@zc.meeting_list(:host_id => @host_id)["total_records"]).to eq(1)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "returns 'meetings' Array" do
|
28
|
-
expect(@zc.meeting_list(:host_id => @host_id)["meetings"]).to be_kind_of(Array)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe "#meeting_list action" do
|
10
|
+
describe "#meeting_create action" do
|
33
11
|
before :each do
|
34
12
|
stub_request(:post, zoomus_url("/meeting/create")).to_return(:body => json_response("meeting_create"))
|
35
13
|
end
|
@@ -39,11 +17,11 @@ describe Zoomus::Actions::Meeting do
|
|
39
17
|
end
|
40
18
|
|
41
19
|
it "requires a 'topic' argument" do
|
42
|
-
expect{@zc.meeting_create(:host_id =>
|
20
|
+
expect{@zc.meeting_create(:host_id => @host_id, :type => "Foo")}.to raise_error(ArgumentError)
|
43
21
|
end
|
44
22
|
|
45
23
|
it "requires a 'type' argument" do
|
46
|
-
expect{@zc.meeting_create(:host_id =>
|
24
|
+
expect{@zc.meeting_create(:host_id => @host_id, :topic => "Foo")}.to raise_error(ArgumentError)
|
47
25
|
end
|
48
26
|
|
49
27
|
it "returns a hash" do
|
@@ -72,4 +50,3 @@ describe Zoomus::Actions::Meeting do
|
|
72
50
|
end
|
73
51
|
end
|
74
52
|
end
|
75
|
-
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Zoomus::Actions::Meeting do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@zc = zoomus_client
|
7
|
+
@host_id = "ufR93M2pRyy8ePFN92dttq"
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "#meeting_list action" do
|
11
|
+
before :each do
|
12
|
+
stub_request(:post, zoomus_url("/meeting/list")).to_return(:body => json_response("meeting_list"))
|
13
|
+
end
|
14
|
+
|
15
|
+
it "requires a 'host_id' argument" do
|
16
|
+
expect{@zc.meeting_list()}.to raise_error(ArgumentError)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "returns a hash" do
|
20
|
+
expect(@zc.meeting_list(:host_id => @host_id)).to be_kind_of(Hash)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "returns 'total_records'" do
|
24
|
+
expect(@zc.meeting_list(:host_id => @host_id)["total_records"]).to eq(1)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "returns 'meetings' Array" do
|
28
|
+
expect(@zc.meeting_list(:host_id => @host_id)["meetings"]).to be_kind_of(Array)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Zoomus::Actions::Meeting do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@zc = zoomus_client
|
7
|
+
@host_id = "ufR93M2pRyy8ePFN92dttq"
|
8
|
+
@id = "252482092"
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#meeting_update action" do
|
12
|
+
before :each do
|
13
|
+
stub_request(:post, zoomus_url("/meeting/update")).to_return(:body => json_response("meeting_update"))
|
14
|
+
end
|
15
|
+
|
16
|
+
it "requires a 'host_id' argument" do
|
17
|
+
expect{@zc.meeting_update(:id => @id, :type => 1, :topic => "Foo")}.to raise_error(ArgumentError)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires a 'topic' argument" do
|
21
|
+
expect{@zc.meeting_update(:id => @id, :host_id => @host_id, :type => "Foo")}.to raise_error(ArgumentError)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "requires a 'type' argument" do
|
25
|
+
expect{@zc.meeting_update(:id => @id, :host_id => @host_id, :topic => "Foo")}.to raise_error(ArgumentError)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "requires a 'meeting id' argument" do
|
29
|
+
expect{@zc.meeting_update(:host_id => @host_id, :topic => "Foo", :type => 1)}.to raise_error(ArgumentError)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "returns a hash" do
|
33
|
+
expect(@zc.meeting_update(:host_id => @host_id,
|
34
|
+
:id => @id,
|
35
|
+
:type => 1,
|
36
|
+
:topic => "Foo")).to be_kind_of(Hash)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "returns id and updated_at attributes" do
|
40
|
+
res = @zc.meeting_update(:host_id => @host_id,
|
41
|
+
:id => @id,
|
42
|
+
:type => 1,
|
43
|
+
:topic => "Foo")
|
44
|
+
|
45
|
+
expect(res["id"]).to eq(@id)
|
46
|
+
expect(res["updated_at"]).to eq("2013-02-25T15:52:38Z")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -6,24 +6,6 @@ describe Zoomus::Actions::User do
|
|
6
6
|
@zc = zoomus_client
|
7
7
|
end
|
8
8
|
|
9
|
-
describe "#user_list action" do
|
10
|
-
before :each do
|
11
|
-
stub_request(:post, zoomus_url("/user/list")).to_return(:body => json_response("user_list"))
|
12
|
-
end
|
13
|
-
|
14
|
-
it "returns a hash" do
|
15
|
-
expect(@zc.user_list).to be_kind_of(Hash)
|
16
|
-
end
|
17
|
-
|
18
|
-
it "returns 'total_records" do
|
19
|
-
expect(@zc.user_list["total_records"]).to eq(1)
|
20
|
-
end
|
21
|
-
|
22
|
-
it "returns 'users' Array" do
|
23
|
-
expect(@zc.user_list["users"]).to be_kind_of(Array)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
9
|
describe "#user_create action" do
|
28
10
|
before :each do
|
29
11
|
stub_request(:post, zoomus_url("/user/create")).to_return(:body => json_response("user_create"))
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Zoomus::Actions::User do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@zc = zoomus_client
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "#user_list action" do
|
10
|
+
before :each do
|
11
|
+
stub_request(:post, zoomus_url("/user/list")).to_return(:body => json_response("user_list"))
|
12
|
+
end
|
13
|
+
|
14
|
+
it "returns a hash" do
|
15
|
+
expect(@zc.user_list).to be_kind_of(Hash)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "returns 'total_records" do
|
19
|
+
expect(@zc.user_list["total_records"]).to eq(1)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "returns 'users' Array" do
|
23
|
+
expect(@zc.user_list["users"]).to be_kind_of(Array)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/zoomus.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zoomus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
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: 2013-02-
|
12
|
+
date: 2013-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &81366250 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *81366250
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &81365950 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *81365950
|
36
36
|
description: A Ruby wrapper for zoom.us API v1
|
37
37
|
email:
|
38
38
|
- collsmaxim@gmail.com
|
@@ -49,13 +49,18 @@ files:
|
|
49
49
|
- lib/zoomus/actions/meeting.rb
|
50
50
|
- lib/zoomus/actions/user.rb
|
51
51
|
- lib/zoomus/client.rb
|
52
|
+
- lib/zoomus/interface.rb
|
52
53
|
- lib/zoomus/utils.rb
|
53
54
|
- spec/fixtures/meeting_create.json
|
54
55
|
- spec/fixtures/meeting_list.json
|
56
|
+
- spec/fixtures/meeting_update.json
|
55
57
|
- spec/fixtures/user_create.json
|
56
58
|
- spec/fixtures/user_list.json
|
57
|
-
- spec/lib/zoomus/actions/
|
58
|
-
- spec/lib/zoomus/actions/
|
59
|
+
- spec/lib/zoomus/actions/meeting/create_spec.rb
|
60
|
+
- spec/lib/zoomus/actions/meeting/list_spec.rb
|
61
|
+
- spec/lib/zoomus/actions/meeting/update_spec.rb
|
62
|
+
- spec/lib/zoomus/actions/user/create_spec.rb
|
63
|
+
- spec/lib/zoomus/actions/user/list_spec.rb
|
59
64
|
- spec/lib/zoomus/client_spec.rb
|
60
65
|
- spec/spec_helper.rb
|
61
66
|
- zoomus.gemspec
|
@@ -86,9 +91,13 @@ summary: zoom.us API wrapper
|
|
86
91
|
test_files:
|
87
92
|
- spec/fixtures/meeting_create.json
|
88
93
|
- spec/fixtures/meeting_list.json
|
94
|
+
- spec/fixtures/meeting_update.json
|
89
95
|
- spec/fixtures/user_create.json
|
90
96
|
- spec/fixtures/user_list.json
|
91
|
-
- spec/lib/zoomus/actions/
|
92
|
-
- spec/lib/zoomus/actions/
|
97
|
+
- spec/lib/zoomus/actions/meeting/create_spec.rb
|
98
|
+
- spec/lib/zoomus/actions/meeting/list_spec.rb
|
99
|
+
- spec/lib/zoomus/actions/meeting/update_spec.rb
|
100
|
+
- spec/lib/zoomus/actions/user/create_spec.rb
|
101
|
+
- spec/lib/zoomus/actions/user/list_spec.rb
|
93
102
|
- spec/lib/zoomus/client_spec.rb
|
94
103
|
- spec/spec_helper.rb
|