jabber_admin 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/doc/assets/logo.png +0 -0
- data/doc/assets/project.png +0 -0
- data/doc/assets/project.xcf +0 -0
- data/jabber_admin.gemspec +18 -19
- data/lib/jabber_admin/commands.rb +2 -10
- data/lib/jabber_admin/commands/registered_users.rb +16 -0
- data/lib/jabber_admin/commands/send_stanza.rb +19 -0
- data/lib/jabber_admin/initializer.rb +1 -0
- data/lib/jabber_admin/version.rb +1 -1
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b60bf9121f5fd712ba6e08eec98005067fc2957
|
4
|
+
data.tar.gz: '0931c367247d9500e1086590361e0e97067ad602'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b925cd9840cefa15a39fa8e578681ab5b411e9361384f1f8adf8197de0c60136ddedaa375b88223d700bfef6213aa521b449bfba1be4d5d3e60c649436afae2
|
7
|
+
data.tar.gz: b2586b050d2314014ee9bb2a4390a204a91817b00fa2cb468b22e8d37f35148a135f7d56bef22a207ac2904ee116efe17e1b418b22811f15cb7267c1c7af5864
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
![jabber_admin](doc/assets/project.png)
|
2
2
|
|
3
3
|
[![Maintainability](https://api.codeclimate.com/v1/badges/0b3c444d8db8acaaba97/maintainability)](https://codeclimate.com/github/hausgold/jabber_admin/maintainability)
|
4
4
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/0b3c444d8db8acaaba97/test_coverage)](https://codeclimate.com/github/hausgold/jabber_admin/test_coverage)
|
5
5
|
|
6
|
-
|
6
|
+
jabber_admin is a small library to easily communicate with the ejabberd
|
7
7
|
admin API.
|
8
8
|
|
9
9
|
## Installation
|
@@ -33,9 +33,13 @@ Currently these basic commands are supported:
|
|
33
33
|
|
34
34
|
- ban_account
|
35
35
|
- create_room
|
36
|
+
- create_room_with_opts
|
36
37
|
- register
|
38
|
+
- registered_users
|
37
39
|
- restart
|
38
40
|
- send_direct_invitation
|
41
|
+
- send_stanza
|
42
|
+
- set_room_affiliation
|
39
43
|
- subscribe_room
|
40
44
|
- unregister
|
41
45
|
- unsubscribe_room
|
data/doc/assets/logo.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/jabber_admin.gemspec
CHANGED
@@ -1,42 +1,41 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
3
|
+
require 'jabber_admin/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
6
|
+
spec.name = 'jabber_admin'
|
8
7
|
spec.version = JabberAdmin::VERSION
|
9
|
-
spec.authors = [
|
8
|
+
spec.authors = ['Henning Vogt']
|
10
9
|
spec.licenses = ['MIT']
|
11
|
-
spec.email = [
|
10
|
+
spec.email = ['henning.vogt@hausgold.de']
|
12
11
|
|
13
|
-
spec.summary = %q{Library for the
|
14
|
-
spec.description = %q{Library for the
|
15
|
-
spec.homepage =
|
12
|
+
spec.summary = %q{Library for the ejabberd RESTful admin API}
|
13
|
+
spec.description = %q{Library for the ejabberd RESTful admin API}
|
14
|
+
spec.homepage = 'https://github.com/hausgold/jabber_admin'
|
16
15
|
|
17
16
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
17
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
18
|
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata[
|
19
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
20
|
else
|
22
|
-
raise
|
23
|
-
|
21
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
22
|
+
'public gem pushes.'
|
24
23
|
end
|
25
24
|
|
26
25
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
26
|
f.match(%r{^(test|spec|features)/})
|
28
27
|
end
|
29
|
-
spec.bindir =
|
28
|
+
spec.bindir = 'exe'
|
30
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
-
spec.require_paths = [
|
30
|
+
spec.require_paths = ['lib']
|
32
31
|
|
33
32
|
spec.add_dependency 'rest-client', '~> 2.0', '>= 2.0.2'
|
34
|
-
spec.add_dependency
|
33
|
+
spec.add_dependency 'activesupport', '>= 4.2.5'
|
35
34
|
|
36
35
|
spec.required_ruby_version = '>= 2.2'
|
37
36
|
|
38
|
-
spec.add_development_dependency
|
39
|
-
spec.add_development_dependency
|
40
|
-
spec.add_development_dependency
|
41
|
-
spec.add_development_dependency
|
37
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
38
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
39
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
40
|
+
spec.add_development_dependency 'simplecov', '~> 0.15'
|
42
41
|
end
|
@@ -1,15 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require
|
5
|
-
require 'jabber_admin/commands/create_room_with_opts'
|
6
|
-
require 'jabber_admin/commands/register'
|
7
|
-
require 'jabber_admin/commands/restart'
|
8
|
-
require 'jabber_admin/commands/send_direct_invitation'
|
9
|
-
require 'jabber_admin/commands/subscribe_room'
|
10
|
-
require 'jabber_admin/commands/unsubscribe_room'
|
11
|
-
require 'jabber_admin/commands/unregister'
|
12
|
-
require 'jabber_admin/commands/set_room_affiliation'
|
3
|
+
# Require all commands from the commands subfolder
|
4
|
+
Dir["#{File.dirname(__FILE__)}/commands/**/*.rb"].each {|file| require file }
|
13
5
|
|
14
6
|
##
|
15
7
|
# Contains alle commands that are supported
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module JabberAdmin
|
4
|
+
module Commands
|
5
|
+
##
|
6
|
+
# List all registered users in HOST
|
7
|
+
#
|
8
|
+
# https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#registered-users-list-all-registered-users-in-host
|
9
|
+
class RegisteredUsers
|
10
|
+
# @param [host] The Local vhost
|
11
|
+
def self.call(host:)
|
12
|
+
JabberAdmin::ApiCall.perform 'registered_users', host: host
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module JabberAdmin
|
4
|
+
module Commands
|
5
|
+
##
|
6
|
+
# Password and Message can also be: none. Users JIDs are separated with :
|
7
|
+
# https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#send-direct-invitation-send-a-direct-invitation-to-several-destinations
|
8
|
+
class SendStanza
|
9
|
+
# @param [from] Sender JID
|
10
|
+
# @param [to] Receiver JID
|
11
|
+
# @param [stanza] Stanza
|
12
|
+
def self.call(from:, to:, stanza:)
|
13
|
+
JabberAdmin::ApiCall.perform(
|
14
|
+
'send_stanza', to: to, from: from, stanza: stanza
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/jabber_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jabber_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Vogt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0.15'
|
103
|
-
description: Library for the
|
103
|
+
description: Library for the ejabberd RESTful admin API
|
104
104
|
email:
|
105
105
|
- henning.vogt@hausgold.de
|
106
106
|
executables: []
|
@@ -116,6 +116,9 @@ files:
|
|
116
116
|
- Rakefile
|
117
117
|
- bin/console
|
118
118
|
- bin/setup
|
119
|
+
- doc/assets/logo.png
|
120
|
+
- doc/assets/project.png
|
121
|
+
- doc/assets/project.xcf
|
119
122
|
- jabber_admin.gemspec
|
120
123
|
- lib/jabber_admin.rb
|
121
124
|
- lib/jabber_admin/api_call.rb
|
@@ -124,8 +127,10 @@ files:
|
|
124
127
|
- lib/jabber_admin/commands/create_room.rb
|
125
128
|
- lib/jabber_admin/commands/create_room_with_opts.rb
|
126
129
|
- lib/jabber_admin/commands/register.rb
|
130
|
+
- lib/jabber_admin/commands/registered_users.rb
|
127
131
|
- lib/jabber_admin/commands/restart.rb
|
128
132
|
- lib/jabber_admin/commands/send_direct_invitation.rb
|
133
|
+
- lib/jabber_admin/commands/send_stanza.rb
|
129
134
|
- lib/jabber_admin/commands/set_room_affiliation.rb
|
130
135
|
- lib/jabber_admin/commands/subscribe_room.rb
|
131
136
|
- lib/jabber_admin/commands/unregister.rb
|
@@ -157,5 +162,5 @@ rubyforge_project:
|
|
157
162
|
rubygems_version: 2.6.11
|
158
163
|
signing_key:
|
159
164
|
specification_version: 4
|
160
|
-
summary: Library for the
|
165
|
+
summary: Library for the ejabberd RESTful admin API
|
161
166
|
test_files: []
|