openfire_api_ruby 0.3.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0665f2a6e0f332baf868a0c3a7adbca72d5bdbfb
4
- data.tar.gz: 4b9084eafbdb32fe81bc3a95314773a3518fea00
3
+ metadata.gz: c6b5a0d655cc560e4b536e83ce21032785b8c0b7
4
+ data.tar.gz: eb6993cbe1498d9f87ab093d618fde5fe2cf5854
5
5
  SHA512:
6
- metadata.gz: 8d8a2590d433ba465408cc951e09620baa78accf1ef8a3d693dbaaeebfe03d7d249315403d8b579e99cfb3b9b7db584a59f03e2d8245fadf83defcb62fce22a8
7
- data.tar.gz: eb772d67448822d22d4768ffbac746498756bfb34081c6bd6b77ebc70d29f07a0f059fdafaf2d4d81c17ac577fc740e8f4474a6be6380bdb87b43ce7415f75b4
6
+ metadata.gz: 1e34ba559f9a21d47fa142689fe5be877a9a394215a0ea6b5722cf6e00b9d92d8e47cd6153bb464e48e13ee5448da7edab9f94781111b34417c53b7bbfc7a580
7
+ data.tar.gz: 64a5eb62bb74993029e0383c0e475eb821d2ea2eace5c2a3ca267f146cd10cf14f005136fa76be9f56b1a5fb2d84b7e0d0d3fdef9221e998dd1bef334f560f81
@@ -1,7 +1,7 @@
1
1
  class OpenfireApiRuby::RoomService
2
2
 
3
3
  @@api_path = "plugins/roomService/roomservice"
4
- @@api_exceptions = %w(RoomServiceDisabled RequestNotAuthorised NotAllowedException IllegalArgumentException)
4
+ @@api_exceptions = %w(RoomServiceDisabled RequestNotAuthorised NotAllowedException IllegalArgumentException AlreadyExistsException NotFoundException)
5
5
 
6
6
  class HTTPException < StandardError; end
7
7
  class InvalidResponseException < StandardError; end
@@ -9,6 +9,8 @@ class OpenfireApiRuby::RoomService
9
9
  class RequestNotAuthorisedException < StandardError; end
10
10
  class NotAllowedException < StandardError; end
11
11
  class IllegalArgumentException < StandardError; end
12
+ class AlreadyExistsException < StandardError; end
13
+ class NotFoundException < StandardError; end
12
14
 
13
15
  def initialize(options=Hash.new)
14
16
  @options = { :path => @@api_path }.merge(options)
@@ -22,6 +24,18 @@ class OpenfireApiRuby::RoomService
22
24
  submit_request(opts.merge(:type => :delete))
23
25
  end
24
26
 
27
+ def create_muc_service!(opts)
28
+ submit_request(opts.merge(:type => :createMultiUserChatService))
29
+ end
30
+
31
+ def rename_muc_service!(opts)
32
+ submit_request(opts.merge(:type => :updateMultiUserChatService))
33
+ end
34
+
35
+ def delete_muc_service!(opts)
36
+ submit_request(opts.merge(:type => :removeMultiUserChatService))
37
+ end
38
+
25
39
  private
26
40
 
27
41
  def build_query(params)
@@ -5,13 +5,13 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{openfire_api_ruby}
8
- s.version = "0.3.2"
8
+ s.version = "1.0.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Babu"]
12
12
  s.date = %q{2014-02-21}
13
- s.description = %q{ruby client for the openfire xmpp-server user_service api}
14
- s.email = %q{paul@23linesofcode.com, babu309@gmail.com}
13
+ s.description = %q{ruby client for the openfire xmpp-server user_service, room_service and group_service api}
14
+ s.email = %q{ babu309@gmail.com}
15
15
  s.files = [
16
16
  "Gemfile",
17
17
  "Gemfile.lock",
@@ -30,10 +30,11 @@ Gem::Specification.new do |s|
30
30
  s.homepage = %q{http://github.com/babu3009/openfire_api_ruby}
31
31
  s.require_paths = ["lib"]
32
32
  s.rubygems_version = %q{1.6.2}
33
- s.summary = %q{ruby client for the openfire userservice api}
33
+ s.summary = %q{ruby client for the openfire user service, room service and group service api}
34
34
  s.test_files = [
35
35
  "spec/spec_helper.rb",
36
- "spec/user_service_spec.rb"
36
+ "spec/user_service_spec.rb",
37
+ "spec/room_service_spec.rb"
37
38
  ]
38
39
 
39
40
  if s.respond_to? :specification_version then
@@ -16,7 +16,7 @@ or
16
16
 
17
17
  == Usage
18
18
 
19
- create a new userservice object
19
+ ## create a new userservice object
20
20
 
21
21
  api = OpenfireApiRuby::UserService.new(:url => "http://localhost:9090/", :secret => "BIGSECRET")
22
22
 
@@ -42,14 +42,23 @@ unlock user
42
42
 
43
43
  api.unlock_user!(:username => "user")
44
44
 
45
- create a new roomservice object
45
+ ## create a new roomservice object
46
46
 
47
- api = OpenfireApiRuby::RoomService.new(:url => "http://localhost:9090/", :secret => "BIGSECRET")
47
+ api = OpenfireApiRuby::RoomService.new(:url => "http://localhost:9090/", :secret => "BIGSECRET")
48
48
 
49
49
  create a new room
50
50
 
51
- api.add_room!(:roomname => "room", :jid => "jid", :subdomain => "groupchat")
51
+ api.add_room!(:roomname => "room", :jid => "jid", :subdomain => "groupchat")
52
52
 
53
53
  delete a room
54
54
 
55
- api.delete_room!(:roomname => "room", :subdomain => "groupchat")
55
+ api.delete_room!(:roomname => "room", :subdomain => "groupchat")
56
+
57
+
58
+ create a muc service
59
+
60
+ api.add_muc_service!(:subdomain=>'demo-service', :description=>'this is a demo muc service')
61
+
62
+ delete a muc service
63
+
64
+ api.delete_muc_service!(:subdomain=>'demo-service')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openfire_api_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Babu
@@ -80,8 +80,9 @@ dependencies:
80
80
  - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: ruby client for the openfire xmpp-server user_service api
84
- email: paul@23linesofcode.com, babu309@gmail.com
83
+ description: ruby client for the openfire xmpp-server user_service, room_service and
84
+ group_service api
85
+ email: ' babu309@gmail.com'
85
86
  executables: []
86
87
  extensions: []
87
88
  extra_rdoc_files: []
@@ -121,8 +122,10 @@ rubyforge_project:
121
122
  rubygems_version: 2.2.2
122
123
  signing_key:
123
124
  specification_version: 3
124
- summary: ruby client for the openfire userservice api
125
+ summary: ruby client for the openfire user service, room service and group service
126
+ api
125
127
  test_files:
126
128
  - spec/spec_helper.rb
127
129
  - spec/user_service_spec.rb
130
+ - spec/room_service_spec.rb
128
131
  has_rdoc: