jabber_admin 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -4
- data/.simplecov +2 -0
- data/.travis.yml +6 -8
- data/CHANGELOG.md +25 -6
- data/Makefile +8 -0
- data/README.md +6 -6
- data/bin/config.rb +11 -0
- data/bin/console +1 -2
- data/docker-compose.yml +1 -1
- data/jabber_admin.gemspec +11 -10
- data/lib/jabber_admin.rb +0 -3
- data/lib/jabber_admin/api_call.rb +11 -7
- data/lib/jabber_admin/commands.rb +1 -1
- data/lib/jabber_admin/commands/get_vcard.rb +84 -0
- data/lib/jabber_admin/commands/set_vcard.rb +68 -0
- data/lib/jabber_admin/exceptions.rb +1 -0
- data/lib/jabber_admin/version.rb +17 -1
- metadata +54 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31b521fdd1da155402e58b436e83fcb22012648b601f543fd5e885f844fd019e
|
4
|
+
data.tar.gz: 9f14f04eaa52941167b0deaeb3322d1d1e947acf8ed2cc8e16cdc00dabeaa8a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57e645f24f358c679b841cde89b8d8ee9fc978d5497a979ce5e87217f936af0438f9e8a75a1bcb94f9d2f195ea469fdc3be1f55137d8b20c66e5b04e0a61bf9d
|
7
|
+
data.tar.gz: b26205f1387f7b50c2ac30407402017f5ab70aa89d64d34905f6c2ddddb26e3d05fa48b6a49f418eb9716c20ec2ce95327e97155f6ab0be9d2c88ff930a732bf
|
data/.rubocop.yml
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
require: rubocop-rspec
|
2
2
|
|
3
|
-
Rails:
|
4
|
-
Enabled: true
|
5
|
-
|
6
3
|
Documentation:
|
7
4
|
Enabled: true
|
8
5
|
|
9
6
|
AllCops:
|
10
7
|
DisplayCopNames: true
|
11
|
-
TargetRubyVersion: 2.
|
8
|
+
TargetRubyVersion: 2.5
|
12
9
|
|
13
10
|
Metrics/BlockLength:
|
14
11
|
Exclude:
|
@@ -31,3 +28,8 @@ RSpec/MessageSpies:
|
|
31
28
|
# bang/non-bang cases.
|
32
29
|
RSpec/NestedGroups:
|
33
30
|
Max: 4
|
31
|
+
|
32
|
+
# We stay at 80 characters per line.
|
33
|
+
# See: https://rubystyle.guide/#max-line-length
|
34
|
+
Metrics/LineLength:
|
35
|
+
Max: 80
|
data/.simplecov
CHANGED
data/.travis.yml
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
sudo: false
|
2
|
-
|
3
2
|
env:
|
4
3
|
global:
|
5
|
-
- CC_TEST_REPORTER_ID=
|
6
|
-
|
4
|
+
- CC_TEST_REPORTER_ID=05f9944a34899135739ab519c57a179a3f4677999fd832fa87da25d3643702b7
|
7
5
|
language: ruby
|
8
6
|
rvm:
|
7
|
+
- 2.6
|
8
|
+
- 2.6
|
9
9
|
- 2.5
|
10
|
-
|
11
|
-
- 2.3
|
12
|
-
- 2.2
|
13
|
-
|
14
|
-
before_install: gem install bundler -v 1.15.1
|
10
|
+
before_install: gem install bundler
|
15
11
|
before_script:
|
16
12
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
17
13
|
- chmod +x ./cc-test-reporter
|
18
14
|
- ./cc-test-reporter before-build
|
15
|
+
script:
|
16
|
+
- bundle exec rspec
|
19
17
|
after_script:
|
20
18
|
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/CHANGELOG.md
CHANGED
@@ -1,17 +1,36 @@
|
|
1
|
+
### 1.0.0
|
2
|
+
|
3
|
+
* All `JabberAdmin` errors `[UnknownCommandError, CommandError, RequestError]`
|
4
|
+
now ship the response object correctly (was always set to `nil` previously)
|
5
|
+
(#6)
|
6
|
+
* Improved the default exceptions messages with the response body (#6)
|
7
|
+
* Added support for setting/fetching vCard details (`JabberAdmin.set_vcard`,
|
8
|
+
`JabberAdmin.get_vcard`) (#6)
|
9
|
+
* Dropped support for Ruby <2.5 (#6)
|
10
|
+
* Added some versioning helpers (eg. `JabberAdmin.version`)
|
11
|
+
|
1
12
|
### 0.2.0
|
2
13
|
|
3
14
|
* [BC] The configuration has changed
|
4
|
-
* `api_host` => `url`, we require now the full base URL of the REST API, this
|
5
|
-
|
6
|
-
*
|
7
|
-
|
8
|
-
*
|
15
|
+
* `api_host` => `url`, we require now the full base URL of the REST API, this
|
16
|
+
allows custom mod_http_api paths (See: https://bit.ly/2rBxatJ)
|
17
|
+
* `admin` => `username`, we want to be use common sense API client jargon
|
18
|
+
here
|
19
|
+
* We support from now on predefined AND freestyle commands on the `JabberAdmin`
|
20
|
+
module
|
21
|
+
* We support from now on bang and non-bang command variants (for both
|
22
|
+
predefined and freestyle commands) which allows the client to use builtin
|
23
|
+
error handling or not
|
24
|
+
* [BC] Previously only bang variants were possible, without response checking,
|
25
|
+
look out for more exceptions when you migrate
|
9
26
|
* New predefined commands:
|
10
27
|
* muc_register_nick
|
11
28
|
* send_stanza_c2s
|
12
29
|
* set_nickname
|
30
|
+
* set_presence
|
13
31
|
* The documentation was greatly improved
|
14
|
-
* The testcases were rewritten and tested with VCR against a real ejabberd
|
32
|
+
* The testcases were rewritten and tested with VCR against a real ejabberd
|
33
|
+
server (18.01)
|
15
34
|
|
16
35
|
### 0.1.4
|
17
36
|
|
data/Makefile
CHANGED
@@ -27,12 +27,14 @@ SORT ?= sort
|
|
27
27
|
# Container binaries
|
28
28
|
BUNDLE ?= bundle
|
29
29
|
RAKE ?= rake
|
30
|
+
RUBOCOP ?= rubocop
|
30
31
|
|
31
32
|
all:
|
32
33
|
# jabber_admin
|
33
34
|
#
|
34
35
|
# install Install the dependencies
|
35
36
|
# test Run the whole test suite
|
37
|
+
# test-style Check the coding styles
|
36
38
|
# clean Clean the dependencies
|
37
39
|
#
|
38
40
|
# shell Run an interactive shell on the container
|
@@ -64,6 +66,12 @@ test: install
|
|
64
66
|
# Run the whole test suite
|
65
67
|
@$(call run-shell,$(BUNDLE) exec $(RAKE))
|
66
68
|
|
69
|
+
test-style: test-style-ruby
|
70
|
+
|
71
|
+
test-style-ruby:
|
72
|
+
# Run the static code analyzer (rubocop)
|
73
|
+
@$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a)
|
74
|
+
|
67
75
|
clean:
|
68
76
|
# Clean the dependencies
|
69
77
|
@$(RM) -rf $(VENDOR_DIR)
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
![jabber_admin](doc/assets/project.
|
1
|
+
![jabber_admin](doc/assets/project.svg)
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.
|
3
|
+
[![Build Status](https://travis-ci.com/hausgold/jabber_admin.svg?branch=master)](https://travis-ci.com/hausgold/jabber_admin)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/jabber_admin.svg)](https://badge.fury.io/rb/jabber_admin)
|
5
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/
|
6
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/dd51c4668e97771baaba/maintainability)](https://codeclimate.com/repos/5cac8bcb6969c376ed007c70/maintainability)
|
6
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/dd51c4668e97771baaba/test_coverage)](https://codeclimate.com/repos/5cac8bcb6969c376ed007c70/test_coverage)
|
7
7
|
[![API docs](https://img.shields.io/badge/docs-API-blue.svg)](https://www.rubydoc.info/gems/jabber_admin)
|
8
8
|
|
9
9
|
jabber_admin is a small library to easily communicate with the [ejabberd
|
@@ -34,7 +34,7 @@ $ bundle
|
|
34
34
|
Or install it yourself as:
|
35
35
|
|
36
36
|
```bash
|
37
|
-
$ gem
|
37
|
+
$ gem install jabber_admin
|
38
38
|
```
|
39
39
|
|
40
40
|
## Configuration
|
@@ -87,7 +87,7 @@ JabberAdmin.register(user: 'peter@example.com', password: '123')
|
|
87
87
|
|
88
88
|
Have a close look at the method names. We support bang and non-bang variants.
|
89
89
|
The bang variants perform in-deep response validation and raise children of
|
90
|
-
|
90
|
+
`JabberAdmin::Error` in case of detected issues. These issues can be
|
91
91
|
unpermitted API requests, or invalid payload values, etc. The predefined
|
92
92
|
commands also perform response body checks when it is appropriate. (Eg. many
|
93
93
|
commands respond a single zero as a success indicator)
|
data/bin/config.rb
ADDED
data/bin/console
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
require 'jabber_admin'
|
4
|
+
require_relative 'config'
|
6
5
|
|
7
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
8
7
|
# with your gem easier. You can also use a different console, if you like.
|
data/docker-compose.yml
CHANGED
data/jabber_admin.gemspec
CHANGED
@@ -25,6 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
'public gem pushes.'
|
26
26
|
end
|
27
27
|
|
28
|
+
spec.required_ruby_version = '~> 2.5'
|
29
|
+
|
28
30
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
29
31
|
f.match(%r{^(test|spec|features)/})
|
30
32
|
end
|
@@ -32,17 +34,16 @@ Gem::Specification.new do |spec|
|
|
32
34
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
35
|
spec.require_paths = ['lib']
|
34
36
|
|
35
|
-
spec.add_dependency 'activesupport', '>=
|
37
|
+
spec.add_dependency 'activesupport', '>= 5.2.0'
|
36
38
|
spec.add_dependency 'rest-client', '~> 2.0', '>= 2.0.2'
|
37
39
|
|
38
|
-
spec.
|
39
|
-
|
40
|
-
spec.add_development_dependency '
|
41
|
-
spec.add_development_dependency '
|
42
|
-
spec.add_development_dependency '
|
43
|
-
spec.add_development_dependency 'rubocop'
|
44
|
-
spec.add_development_dependency '
|
45
|
-
spec.add_development_dependency '
|
46
|
-
spec.add_development_dependency 'vcr', '~> 3.0'
|
40
|
+
spec.add_development_dependency 'bundler', '>= 1.16', '< 3'
|
41
|
+
spec.add_development_dependency 'irb', '~> 1.2'
|
42
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
43
|
+
spec.add_development_dependency 'rspec', '~> 3.9'
|
44
|
+
spec.add_development_dependency 'rubocop', '~> 0.93'
|
45
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.43'
|
46
|
+
spec.add_development_dependency 'simplecov', '< 0.18'
|
47
|
+
spec.add_development_dependency 'vcr', '~> 6.0'
|
47
48
|
spec.add_development_dependency 'webmock', '~> 3.0'
|
48
49
|
end
|
data/lib/jabber_admin.rb
CHANGED
@@ -84,14 +84,11 @@ module JabberAdmin
|
|
84
84
|
# @param method [Symbol, String, #to_s] the name of the command to run
|
85
85
|
# @param args all additional payload to pass down to the API call
|
86
86
|
# @return [RestClient::Response] the actual response of the command
|
87
|
-
#
|
88
|
-
# rubocop:disable Style/MethodMissing we support all given methods
|
89
87
|
def self.method_missing(method, *args)
|
90
88
|
predefined_command(method).call(predefined_callable(method), *args)
|
91
89
|
rescue NameError
|
92
90
|
predefined_callable(method).call(method.to_s.chomp('!'), *args)
|
93
91
|
end
|
94
|
-
# rubocop:enable Style/MethodMissing
|
95
92
|
|
96
93
|
# Try to find the given name as a predefined command. When there is no such
|
97
94
|
# predefined command, we raise a +NameError+.
|
@@ -41,8 +41,8 @@ module JabberAdmin
|
|
41
41
|
password: JabberAdmin.configuration.password,
|
42
42
|
payload: payload.to_json
|
43
43
|
)
|
44
|
-
rescue RestClient::Exception =>
|
45
|
-
@response =
|
44
|
+
rescue RestClient::Exception => e
|
45
|
+
@response = e.response
|
46
46
|
end
|
47
47
|
|
48
48
|
# Check if the response was successful. Otherwise raise exceptions with
|
@@ -52,22 +52,25 @@ module JabberAdmin
|
|
52
52
|
# @raise JabberAdmin::CommandError
|
53
53
|
#
|
54
54
|
# rubocop:disable Metrics/AbcSize because its the bundled check logic
|
55
|
+
# rubocop:disable Metrics/MethodLength dito
|
55
56
|
def check_response
|
56
57
|
# The REST API responds a 404 status code when the command is not known.
|
57
|
-
|
58
|
-
|
58
|
+
if response.code == 404
|
59
|
+
raise UnknownCommandError.new("Command '#{command}' is not known",
|
60
|
+
response)
|
61
|
+
end
|
59
62
|
|
60
63
|
# In case we send commands with missing data or any other validation
|
61
64
|
# issues, the REST API will respond with a 400 Bad Request status
|
62
65
|
# code.
|
63
|
-
raise CommandError
|
66
|
+
raise CommandError.new('Invalid arguments for command', response) \
|
64
67
|
if response.code == 400
|
65
68
|
|
66
69
|
# Looks like the ejabberd REST API is returning 200 OK in case the
|
67
70
|
# request was valid and permitted. But it does not indicate that the
|
68
71
|
# request was successful handled. This is indicated on the response body
|
69
72
|
# as a one (1) or a zero (0). (0 on success, 1 otherwise)
|
70
|
-
raise RequestError
|
73
|
+
raise RequestError.new('Response code was not 200', response) \
|
71
74
|
unless response.code == 200
|
72
75
|
|
73
76
|
# Stop the check, when we should not check the response body
|
@@ -76,10 +79,11 @@ module JabberAdmin
|
|
76
79
|
# The command was not successful, for some reason. Unfortunately we do
|
77
80
|
# not get any further information here, which makes error debugging a
|
78
81
|
# struggle.
|
79
|
-
raise CommandError
|
82
|
+
raise CommandError.new('Command was not successful', response) \
|
80
83
|
unless response.body == '0'
|
81
84
|
end
|
82
85
|
# rubocop:enable Metrics/AbcSize
|
86
|
+
# rubocop:enable Metrics/MethodLength
|
83
87
|
|
84
88
|
# Just a simple DSL wrapper for the response method.
|
85
89
|
#
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module JabberAdmin
|
4
|
+
module Commands
|
5
|
+
# Get content from a vCard.
|
6
|
+
#
|
7
|
+
# Examples:
|
8
|
+
#
|
9
|
+
# JabberAdmin.get_vcard!(
|
10
|
+
# :fn, 'n.given', 'org.orgunit[]', 'u.known[]',
|
11
|
+
# user: 'ac865680-9681-45da-8fee-8584053dde5b@jabber.local'
|
12
|
+
# )
|
13
|
+
# # => {:fn=>"Max Mustermann",
|
14
|
+
# # "n.given"=>"Max",
|
15
|
+
# # "org.orgunit"=>["Marketing", "Production"],
|
16
|
+
# # "u.known"=>nil}
|
17
|
+
#
|
18
|
+
# **Heads up!** ejabberd version 18.01 has a bug at the +get_vcard2_multi+
|
19
|
+
# command, which just returns the first element of possible multiple
|
20
|
+
# values. (in an array)
|
21
|
+
#
|
22
|
+
# @see https://bit.ly/2SLkEWi
|
23
|
+
# @see https://bit.ly/34T71dm
|
24
|
+
# @see https://bit.ly/3nKqiGL
|
25
|
+
class GetVcard
|
26
|
+
# Pass the correct data to the given callable.
|
27
|
+
#
|
28
|
+
# @param callable [Proc, #call] the callable to call
|
29
|
+
# @param keys [Array<String, Symbol>, String, Symbol] name of the
|
30
|
+
# vCard field (+n.family+ for multiple levels)
|
31
|
+
# @param user [String] user JID wo/ resource (eg. +tom@localhost+)
|
32
|
+
# @return [Hash] the vCard details
|
33
|
+
#
|
34
|
+
# rubocop:disable Metrics/MethodLength because the ejabberd REST API is
|
35
|
+
# hard to use in complex scenarios, so we have to work around it
|
36
|
+
# rubocop:disable Metrics/AbcSize dito
|
37
|
+
# rubocop:disable Metrics/CyclomaticComplexity dito
|
38
|
+
# rubocop:disable Metrics/PerceivedComplexity dito
|
39
|
+
def self.call(callable, *keys, user:)
|
40
|
+
uid, host = user.split('@')
|
41
|
+
val = proc do |key|
|
42
|
+
parts = key.to_s.upcase.split('.')
|
43
|
+
args = { name: parts.shift }
|
44
|
+
meth = 'get_vcard'
|
45
|
+
|
46
|
+
unless parts.empty?
|
47
|
+
args[:subname] = parts.shift
|
48
|
+
meth = 'get_vcard2'
|
49
|
+
|
50
|
+
if args[:subname].end_with? '[]'
|
51
|
+
meth += '_multi'
|
52
|
+
args[:subname].delete_suffix!('[]')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
res = JSON.parse(callable.call(meth, check_res_body: false,
|
57
|
+
user: uid,
|
58
|
+
host: host,
|
59
|
+
**args).body)
|
60
|
+
|
61
|
+
res.is_a?(Hash) ? res['content'] : res
|
62
|
+
rescue JabberAdmin::CommandError => e
|
63
|
+
# When ejabberd tells us there was no value, it does this the hard way
|
64
|
+
next if e.response.body.include? 'error_no_value_found_in_vcard'
|
65
|
+
|
66
|
+
raise e
|
67
|
+
end
|
68
|
+
|
69
|
+
# When just one key is requested, we return the value directly
|
70
|
+
return val[keys.first] if keys.count == 1
|
71
|
+
|
72
|
+
# When multiple keys are requested, we assemble a hash
|
73
|
+
keys.map do |key|
|
74
|
+
res_key = key.is_a?(String) ? key.delete_suffix('[]') : key
|
75
|
+
[res_key, val[key]]
|
76
|
+
end.to_h
|
77
|
+
end
|
78
|
+
# rubocop:enable Metrics/MethodLength
|
79
|
+
# rubocop:enable Metrics/AbcSize
|
80
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
81
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module JabberAdmin
|
4
|
+
module Commands
|
5
|
+
# Set contents in a vCard.
|
6
|
+
#
|
7
|
+
# Examples:
|
8
|
+
#
|
9
|
+
# JabberAdmin.set_vcard!(
|
10
|
+
# user: 'ac865680-9681-45da-8fee-8584053dde5b@jabber.local',
|
11
|
+
# 'org.orgunit[]' => %w[Marketing Production],
|
12
|
+
# fn: 'Max Mustermann',
|
13
|
+
# 'n.given': 'Max',
|
14
|
+
# 'n.family' => 'Mustermann'
|
15
|
+
# )
|
16
|
+
# # => {"org.orgunit[]"=>["Marketing", "Production"],
|
17
|
+
# # "n.family"=>"Mustermann",
|
18
|
+
# # :fn=>"Max Mustermann",
|
19
|
+
# # :"n.given"=>"Max"}
|
20
|
+
#
|
21
|
+
# @see https://bit.ly/2ZB9S6y
|
22
|
+
# @see https://bit.ly/3lAIGzO
|
23
|
+
# @see https://bit.ly/34MiviZ
|
24
|
+
class SetVcard
|
25
|
+
# Pass the correct data to the given callable.
|
26
|
+
#
|
27
|
+
# @param callable [Proc, #call] the callable to call
|
28
|
+
# @param args [Hash] the keys/values to set to the vCard
|
29
|
+
# (eg. +n.family+ for multiple levels)
|
30
|
+
# @param user [String] user JID wo/ resource (eg. +tom@localhost+)
|
31
|
+
# @param sym_args [Hash{Symbol => Mixed}] additional keys/values to
|
32
|
+
# set to the vCard
|
33
|
+
# @return [Hash] the vCard details
|
34
|
+
#
|
35
|
+
# rubocop:disable Metrics/MethodLength because the ejabberd REST API is
|
36
|
+
# hard to use in complex scenarios, so we have to work around it
|
37
|
+
# rubocop:disable Metrics/AbcSize dito
|
38
|
+
def self.call(callable, args = {}, user:, **sym_args)
|
39
|
+
args = args.merge(sym_args)
|
40
|
+
uid, host = user.split('@')
|
41
|
+
|
42
|
+
set = proc do |key, val|
|
43
|
+
parts = key.to_s.upcase.split('.')
|
44
|
+
body = { name: parts.shift, content: val }
|
45
|
+
meth = 'set_vcard'
|
46
|
+
|
47
|
+
unless parts.empty?
|
48
|
+
body[:subname] = parts.shift
|
49
|
+
meth = 'set_vcard2'
|
50
|
+
|
51
|
+
if body[:subname].end_with? '[]'
|
52
|
+
meth += '_multi'
|
53
|
+
body[:subname].delete_suffix!('[]')
|
54
|
+
body[:contents] = body.delete(:content)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
callable.call(meth, user: uid, host: host, **body)
|
59
|
+
end
|
60
|
+
|
61
|
+
args.each { |key, val| set[key, val] }
|
62
|
+
args
|
63
|
+
end
|
64
|
+
# rubocop:enable Metrics/MethodLength
|
65
|
+
# rubocop:enable Metrics/AbcSize
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/lib/jabber_admin/version.rb
CHANGED
@@ -3,5 +3,21 @@
|
|
3
3
|
module JabberAdmin
|
4
4
|
# The version constant of the gem. Increase this value
|
5
5
|
# in case of a gem release.
|
6
|
-
VERSION = '0.
|
6
|
+
VERSION = '1.0.0'
|
7
|
+
|
8
|
+
class << self
|
9
|
+
# Returns the version of gem as a string.
|
10
|
+
#
|
11
|
+
# @return [String] the gem version as string
|
12
|
+
def version
|
13
|
+
VERSION
|
14
|
+
end
|
15
|
+
|
16
|
+
# Returns the version of the gem as a +Gem::Version+.
|
17
|
+
#
|
18
|
+
# @return [Gem::Version] the gem version as object
|
19
|
+
def gem_version
|
20
|
+
Gem::Version.new VERSION
|
21
|
+
end
|
22
|
+
end
|
7
23
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jabber_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Vogt
|
8
8
|
- Hermann Mayer
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-10-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 5.2.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 5.2.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rest-client
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -49,100 +49,120 @@ dependencies:
|
|
49
49
|
name: bundler
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.16'
|
55
|
+
- - "<"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '3'
|
55
58
|
type: :development
|
56
59
|
prerelease: false
|
57
60
|
version_requirements: !ruby/object:Gem::Requirement
|
58
61
|
requirements:
|
59
|
-
- - "
|
62
|
+
- - ">="
|
60
63
|
- !ruby/object:Gem::Version
|
61
64
|
version: '1.16'
|
65
|
+
- - "<"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: irb
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.2'
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1.2'
|
62
82
|
- !ruby/object:Gem::Dependency
|
63
83
|
name: rake
|
64
84
|
requirement: !ruby/object:Gem::Requirement
|
65
85
|
requirements:
|
66
86
|
- - "~>"
|
67
87
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
88
|
+
version: '13.0'
|
69
89
|
type: :development
|
70
90
|
prerelease: false
|
71
91
|
version_requirements: !ruby/object:Gem::Requirement
|
72
92
|
requirements:
|
73
93
|
- - "~>"
|
74
94
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
95
|
+
version: '13.0'
|
76
96
|
- !ruby/object:Gem::Dependency
|
77
97
|
name: rspec
|
78
98
|
requirement: !ruby/object:Gem::Requirement
|
79
99
|
requirements:
|
80
100
|
- - "~>"
|
81
101
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
102
|
+
version: '3.9'
|
83
103
|
type: :development
|
84
104
|
prerelease: false
|
85
105
|
version_requirements: !ruby/object:Gem::Requirement
|
86
106
|
requirements:
|
87
107
|
- - "~>"
|
88
108
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
109
|
+
version: '3.9'
|
90
110
|
- !ruby/object:Gem::Dependency
|
91
111
|
name: rubocop
|
92
112
|
requirement: !ruby/object:Gem::Requirement
|
93
113
|
requirements:
|
94
|
-
- - "
|
114
|
+
- - "~>"
|
95
115
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
116
|
+
version: '0.93'
|
97
117
|
type: :development
|
98
118
|
prerelease: false
|
99
119
|
version_requirements: !ruby/object:Gem::Requirement
|
100
120
|
requirements:
|
101
|
-
- - "
|
121
|
+
- - "~>"
|
102
122
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
123
|
+
version: '0.93'
|
104
124
|
- !ruby/object:Gem::Dependency
|
105
125
|
name: rubocop-rspec
|
106
126
|
requirement: !ruby/object:Gem::Requirement
|
107
127
|
requirements:
|
108
|
-
- - "
|
128
|
+
- - "~>"
|
109
129
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
130
|
+
version: '1.43'
|
111
131
|
type: :development
|
112
132
|
prerelease: false
|
113
133
|
version_requirements: !ruby/object:Gem::Requirement
|
114
134
|
requirements:
|
115
|
-
- - "
|
135
|
+
- - "~>"
|
116
136
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
137
|
+
version: '1.43'
|
118
138
|
- !ruby/object:Gem::Dependency
|
119
139
|
name: simplecov
|
120
140
|
requirement: !ruby/object:Gem::Requirement
|
121
141
|
requirements:
|
122
|
-
- - "
|
142
|
+
- - "<"
|
123
143
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0.
|
144
|
+
version: '0.18'
|
125
145
|
type: :development
|
126
146
|
prerelease: false
|
127
147
|
version_requirements: !ruby/object:Gem::Requirement
|
128
148
|
requirements:
|
129
|
-
- - "
|
149
|
+
- - "<"
|
130
150
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0.
|
151
|
+
version: '0.18'
|
132
152
|
- !ruby/object:Gem::Dependency
|
133
153
|
name: vcr
|
134
154
|
requirement: !ruby/object:Gem::Requirement
|
135
155
|
requirements:
|
136
156
|
- - "~>"
|
137
157
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
158
|
+
version: '6.0'
|
139
159
|
type: :development
|
140
160
|
prerelease: false
|
141
161
|
version_requirements: !ruby/object:Gem::Requirement
|
142
162
|
requirements:
|
143
163
|
- - "~>"
|
144
164
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
165
|
+
version: '6.0'
|
146
166
|
- !ruby/object:Gem::Dependency
|
147
167
|
name: webmock
|
148
168
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,11 +198,10 @@ files:
|
|
178
198
|
- Makefile
|
179
199
|
- README.md
|
180
200
|
- Rakefile
|
201
|
+
- bin/config.rb
|
181
202
|
- bin/console
|
182
203
|
- bin/setup
|
183
|
-
- doc/assets/
|
184
|
-
- doc/assets/project.png
|
185
|
-
- doc/assets/project.xcf
|
204
|
+
- doc/assets/project.svg
|
186
205
|
- docker-compose.yml
|
187
206
|
- jabber_admin.gemspec
|
188
207
|
- lib/jabber_admin.rb
|
@@ -191,6 +210,7 @@ files:
|
|
191
210
|
- lib/jabber_admin/commands/ban_account.rb
|
192
211
|
- lib/jabber_admin/commands/create_room.rb
|
193
212
|
- lib/jabber_admin/commands/create_room_with_opts.rb
|
213
|
+
- lib/jabber_admin/commands/get_vcard.rb
|
194
214
|
- lib/jabber_admin/commands/muc_register_nick.rb
|
195
215
|
- lib/jabber_admin/commands/register.rb
|
196
216
|
- lib/jabber_admin/commands/registered_users.rb
|
@@ -201,6 +221,7 @@ files:
|
|
201
221
|
- lib/jabber_admin/commands/set_nickname.rb
|
202
222
|
- lib/jabber_admin/commands/set_presence.rb
|
203
223
|
- lib/jabber_admin/commands/set_room_affiliation.rb
|
224
|
+
- lib/jabber_admin/commands/set_vcard.rb
|
204
225
|
- lib/jabber_admin/commands/subscribe_room.rb
|
205
226
|
- lib/jabber_admin/commands/unregister.rb
|
206
227
|
- lib/jabber_admin/commands/unsubscribe_room.rb
|
@@ -212,24 +233,23 @@ licenses:
|
|
212
233
|
- MIT
|
213
234
|
metadata:
|
214
235
|
allowed_push_host: https://rubygems.org
|
215
|
-
post_install_message:
|
236
|
+
post_install_message:
|
216
237
|
rdoc_options: []
|
217
238
|
require_paths:
|
218
239
|
- lib
|
219
240
|
required_ruby_version: !ruby/object:Gem::Requirement
|
220
241
|
requirements:
|
221
|
-
- - "
|
242
|
+
- - "~>"
|
222
243
|
- !ruby/object:Gem::Version
|
223
|
-
version: '2.
|
244
|
+
version: '2.5'
|
224
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
246
|
requirements:
|
226
247
|
- - ">="
|
227
248
|
- !ruby/object:Gem::Version
|
228
249
|
version: '0'
|
229
250
|
requirements: []
|
230
|
-
|
231
|
-
|
232
|
-
signing_key:
|
251
|
+
rubygems_version: 3.1.4
|
252
|
+
signing_key:
|
233
253
|
specification_version: 4
|
234
254
|
summary: Library for the ejabberd RESTful admin API
|
235
255
|
test_files: []
|