jabber_admin 0.2.0 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/documentation.yml +38 -0
- data/.github/workflows/test.yml +59 -0
- data/.gitignore +1 -1
- data/.rubocop.yml +6 -4
- data/.simplecov +2 -0
- data/.yardopts +3 -1
- data/CHANGELOG.md +40 -6
- data/Makefile +41 -10
- data/README.md +7 -7
- data/Rakefile +68 -0
- data/bin/config.rb +11 -0
- data/bin/console +1 -2
- data/doc/assets/project.svg +68 -0
- data/docker-compose.yml +1 -1
- data/jabber_admin.gemspec +14 -10
- data/lib/jabber_admin/api_call.rb +11 -7
- data/lib/jabber_admin/commands/get_vcard.rb +84 -0
- data/lib/jabber_admin/commands/set_vcard.rb +68 -0
- data/lib/jabber_admin/commands.rb +1 -1
- data/lib/jabber_admin/exceptions.rb +1 -0
- data/lib/jabber_admin/version.rb +18 -1
- data/lib/jabber_admin.rb +0 -3
- metadata +104 -35
- data/.travis.yml +0 -20
- data/doc/assets/logo.png +0 -0
- data/doc/assets/project.png +0 -0
- data/doc/assets/project.xcf +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c3c8dc6ddbbea8d817376ab6c870b2b5590a72e69f4e954cf118cad0a54088f
|
4
|
+
data.tar.gz: 71306c24bf91350ee2597cd7608e0e77787fdc498d308bf70f1bb081625f55c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8668df2cbce010b8978ac1ca4f3e4f496642b30888059b9e098d9eae984b3968e55a349ac082f666977b66b8306feb72fbc5e9696e1d2be6c14170dc22cf7c01
|
7
|
+
data.tar.gz: 82c2c8be4ca79ae695fc31a30bea1634d482b9797fb0c9e26e6521f6c53a9fe68647f9542cb077167c4c9bdae8d67883c0894af1907508b6a512bac46ab67fcf
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: Build Documentation
|
2
|
+
on:
|
3
|
+
repository_dispatch:
|
4
|
+
types: [documentation]
|
5
|
+
|
6
|
+
concurrency:
|
7
|
+
group: 'docs'
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
docs:
|
11
|
+
name: Build gem documentation
|
12
|
+
runs-on: ubuntu-20.04
|
13
|
+
timeout-minutes: 5
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
|
17
|
+
- name: Install the correct Ruby version
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 2.5
|
21
|
+
bundler-cache: true
|
22
|
+
|
23
|
+
- name: Prepare the virtual environment
|
24
|
+
uses: hausgold/actions/ci@master
|
25
|
+
with:
|
26
|
+
clone_token: '${{ secrets.CLONE_TOKEN }}'
|
27
|
+
settings: '${{ github.repository }}'
|
28
|
+
target: ci/gem-test
|
29
|
+
|
30
|
+
- name: Build gem documentation
|
31
|
+
run: make docs
|
32
|
+
|
33
|
+
- name: Upload the code coverage report
|
34
|
+
run: coverage
|
35
|
+
|
36
|
+
- name: Add this job to the commit status
|
37
|
+
run: commit-status '${{ job.status }}'
|
38
|
+
if: always()
|
@@ -0,0 +1,59 @@
|
|
1
|
+
name: Test
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- '**'
|
6
|
+
schedule:
|
7
|
+
- cron: '0 0 * * MON'
|
8
|
+
|
9
|
+
concurrency:
|
10
|
+
group: '${{ github.ref }}'
|
11
|
+
cancel-in-progress: true
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
name: 'Test the gem (Ruby ${{ matrix.ruby }})'
|
16
|
+
runs-on: ubuntu-20.04
|
17
|
+
timeout-minutes: 5
|
18
|
+
strategy:
|
19
|
+
fail-fast: false
|
20
|
+
matrix:
|
21
|
+
ruby: [2.5, 2.6, 2.7]
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v2
|
24
|
+
|
25
|
+
- name: Install the correct Ruby version
|
26
|
+
uses: ruby/setup-ruby@v1
|
27
|
+
with:
|
28
|
+
ruby-version: ${{ matrix.ruby }}
|
29
|
+
bundler-cache: true
|
30
|
+
|
31
|
+
- name: Prepare the virtual environment
|
32
|
+
uses: hausgold/actions/ci@master
|
33
|
+
with:
|
34
|
+
clone_token: '${{ secrets.CLONE_TOKEN }}'
|
35
|
+
settings: '${{ github.repository }}'
|
36
|
+
target: ci/gem-test
|
37
|
+
|
38
|
+
- name: Run the gem tests
|
39
|
+
run: make test
|
40
|
+
|
41
|
+
- name: Upload the code coverage report
|
42
|
+
run: coverage
|
43
|
+
|
44
|
+
trigger-docs:
|
45
|
+
name: Trigger the documentation upload
|
46
|
+
runs-on: ubuntu-20.04
|
47
|
+
timeout-minutes: 2
|
48
|
+
needs: test
|
49
|
+
if: github.ref == 'refs/heads/master'
|
50
|
+
steps:
|
51
|
+
- name: Prepare the virtual environment
|
52
|
+
uses: hausgold/actions/ci@master
|
53
|
+
with:
|
54
|
+
clone_token: '${{ secrets.CLONE_TOKEN }}'
|
55
|
+
settings: '${{ github.repository }}'
|
56
|
+
target: ci/noop
|
57
|
+
|
58
|
+
- name: Trigger the documentation upload
|
59
|
+
run: workflow documentation
|
data/.gitignore
CHANGED
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/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,17 +1,51 @@
|
|
1
|
+
### 1.0.3
|
2
|
+
|
3
|
+
* Migrated to Github Actions
|
4
|
+
* Migrated to our own coverage reporting
|
5
|
+
* Added the code statistics to the test process
|
6
|
+
|
7
|
+
### 1.0.2
|
8
|
+
|
9
|
+
* Corrected the GNU Make release target
|
10
|
+
* Corrected the empty arguments check
|
11
|
+
|
12
|
+
### 1.0.1
|
13
|
+
|
14
|
+
* Gracefully handle a missing vCard when a vCard field is queried (#7)
|
15
|
+
|
16
|
+
### 1.0.0
|
17
|
+
|
18
|
+
* All `JabberAdmin` errors `[UnknownCommandError, CommandError, RequestError]`
|
19
|
+
now ship the response object correctly (was always set to `nil` previously)
|
20
|
+
(#6)
|
21
|
+
* Improved the default exceptions messages with the response body (#6)
|
22
|
+
* Added support for setting/fetching vCard details (`JabberAdmin.set_vcard`,
|
23
|
+
`JabberAdmin.get_vcard`) (#6)
|
24
|
+
* Dropped support for Ruby <2.5 (#6)
|
25
|
+
* Added some versioning helpers (eg. `JabberAdmin.version`)
|
26
|
+
|
1
27
|
### 0.2.0
|
2
28
|
|
3
29
|
* [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
|
-
*
|
30
|
+
* `api_host` => `url`, we require now the full base URL of the REST API, this
|
31
|
+
allows custom mod_http_api paths (See: https://bit.ly/2rBxatJ)
|
32
|
+
* `admin` => `username`, we want to be use common sense API client jargon
|
33
|
+
here
|
34
|
+
* We support from now on predefined AND freestyle commands on the `JabberAdmin`
|
35
|
+
module
|
36
|
+
* We support from now on bang and non-bang command variants (for both
|
37
|
+
predefined and freestyle commands) which allows the client to use builtin
|
38
|
+
error handling or not
|
39
|
+
* [BC] Previously only bang variants were possible, without response checking,
|
40
|
+
look out for more exceptions when you migrate
|
9
41
|
* New predefined commands:
|
10
42
|
* muc_register_nick
|
11
43
|
* send_stanza_c2s
|
12
44
|
* set_nickname
|
45
|
+
* set_presence
|
13
46
|
* The documentation was greatly improved
|
14
|
-
* The testcases were rewritten and tested with VCR against a real ejabberd
|
47
|
+
* The testcases were rewritten and tested with VCR against a real ejabberd
|
48
|
+
server (18.01)
|
15
49
|
|
16
50
|
### 0.1.4
|
17
51
|
|
data/Makefile
CHANGED
@@ -27,16 +27,24 @@ SORT ?= sort
|
|
27
27
|
# Container binaries
|
28
28
|
BUNDLE ?= bundle
|
29
29
|
RAKE ?= rake
|
30
|
+
RUBOCOP ?= rubocop
|
31
|
+
YARD ?= yard
|
30
32
|
|
31
33
|
all:
|
32
34
|
# jabber_admin
|
33
35
|
#
|
34
|
-
# install
|
35
|
-
# test
|
36
|
-
#
|
36
|
+
# install Install the dependencies
|
37
|
+
# test Run the whole test suite
|
38
|
+
# test-style Check the coding styles
|
39
|
+
# clean Clean the dependencies
|
37
40
|
#
|
38
|
-
#
|
39
|
-
#
|
41
|
+
# docs Generate the Ruby documentation of the library
|
42
|
+
# stats Print the code statistics (library and test suite)
|
43
|
+
# notes Print all the notes from the code
|
44
|
+
# release Release a new Gem version (maintainers only)
|
45
|
+
#
|
46
|
+
# shell Run an interactive shell on the container
|
47
|
+
# shell-irb Run an interactive IRB shell on the container
|
40
48
|
#
|
41
49
|
# supported-commands-list Generate the supported commands list
|
42
50
|
|
@@ -60,9 +68,19 @@ install:
|
|
60
68
|
@$(MKDIR) -p $(VENDOR_DIR)
|
61
69
|
@$(call run-shell,$(BUNDLE) check || $(BUNDLE) install --path $(VENDOR_DIR))
|
62
70
|
|
63
|
-
test:
|
71
|
+
test: \
|
72
|
+
test-specs \
|
73
|
+
test-style
|
74
|
+
|
75
|
+
test-specs:
|
64
76
|
# Run the whole test suite
|
65
|
-
@$(call run-shell,$(BUNDLE) exec $(RAKE))
|
77
|
+
@$(call run-shell,$(BUNDLE) exec $(RAKE) stats spec)
|
78
|
+
|
79
|
+
test-style: test-style-ruby
|
80
|
+
|
81
|
+
test-style-ruby:
|
82
|
+
# Run the static code analyzer (rubocop)
|
83
|
+
@$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a)
|
66
84
|
|
67
85
|
clean:
|
68
86
|
# Clean the dependencies
|
@@ -76,17 +94,30 @@ endif
|
|
76
94
|
|
77
95
|
distclean: clean clean-containers
|
78
96
|
|
79
|
-
shell:
|
97
|
+
shell:
|
80
98
|
# Run an interactive shell on the container
|
81
99
|
@$(call run-shell,$(BASH) -i)
|
82
100
|
|
83
|
-
shell-irb:
|
101
|
+
shell-irb:
|
84
102
|
# Run an interactive IRB shell on the container
|
85
103
|
@$(call run-shell,bin/console)
|
86
104
|
|
105
|
+
docs:
|
106
|
+
# Build the API documentation
|
107
|
+
@$(call run-shell,$(BUNDLE) exec $(YARD) -q && \
|
108
|
+
$(BUNDLE) exec $(YARD) stats --list-undoc --compact)
|
109
|
+
|
110
|
+
notes:
|
111
|
+
# Print the code statistics (library and test suite)
|
112
|
+
@$(call run-shell,$(BUNDLE) exec $(RAKE) notes)
|
113
|
+
|
114
|
+
stats:
|
115
|
+
# Print all the notes from the code
|
116
|
+
@$(call run-shell,$(BUNDLE) exec $(RAKE) stats)
|
117
|
+
|
87
118
|
release:
|
88
119
|
# Release a new gem version
|
89
|
-
@$(RAKE) release
|
120
|
+
@$(BUNDLE) exec $(RAKE) release
|
90
121
|
|
91
122
|
supported-commands-list:
|
92
123
|
# Generate the supported commands list
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
![jabber_admin](doc/assets/project.
|
1
|
+
![jabber_admin](doc/assets/project.svg)
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Continuous Integration](https://github.com/hausgold/jabber_admin/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/hausgold/jabber_admin/actions/workflows/test.yml)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/jabber_admin.svg)](https://badge.fury.io/rb/jabber_admin)
|
5
|
-
[![
|
6
|
-
[![Test
|
7
|
-
[![API docs](https://
|
5
|
+
[![Test Coverage](https://automate-api.hausgold.de/v1/coverage_reports/jabber_admin/coverage.svg)](https://knowledge.hausgold.de/coverage)
|
6
|
+
[![Test Ratio](https://automate-api.hausgold.de/v1/coverage_reports/jabber_admin/ratio.svg)](https://knowledge.hausgold.de/coverage)
|
7
|
+
[![API docs](https://automate-api.hausgold.de/v1/coverage_reports/jabber_admin/documentation.svg)](https://www.rubydoc.info/gems/jabber_admin)
|
8
8
|
|
9
9
|
jabber_admin is a small library to easily communicate with the [ejabberd
|
10
10
|
admin API](https://docs.ejabberd.im/developer/ejabberd-api/admin-api).
|
@@ -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/Rakefile
CHANGED
@@ -2,7 +2,75 @@
|
|
2
2
|
|
3
3
|
require 'bundler/gem_tasks'
|
4
4
|
require 'rspec/core/rake_task'
|
5
|
+
require 'rails/code_statistics'
|
6
|
+
require 'pp'
|
5
7
|
|
6
8
|
RSpec::Core::RakeTask.new(:spec)
|
7
9
|
|
8
10
|
task default: :spec
|
11
|
+
|
12
|
+
# Load some railties tasks
|
13
|
+
load 'rails/tasks/statistics.rake'
|
14
|
+
load 'rails/tasks/annotations.rake'
|
15
|
+
|
16
|
+
# Clear the default statistics directory constant
|
17
|
+
#
|
18
|
+
# rubocop:disable Style/MutableConstant because we define it
|
19
|
+
Object.send(:remove_const, :STATS_DIRECTORIES)
|
20
|
+
::STATS_DIRECTORIES = []
|
21
|
+
# rubocop:enable Style/MutableConstant
|
22
|
+
|
23
|
+
# Monkey patch the Rails +CodeStatistics+ class to support configurable
|
24
|
+
# patterns per path. This is reuqired to support top-level only file matches.
|
25
|
+
class CodeStatistics
|
26
|
+
DEFAULT_PATTERN = /^(?!\.).*?\.(rb|js|coffee|rake)$/.freeze
|
27
|
+
|
28
|
+
# Pass the possible +pattern+ argument down to the
|
29
|
+
# +calculate_directory_statistics+ method call.
|
30
|
+
def calculate_statistics
|
31
|
+
Hash[@pairs.map do |pair|
|
32
|
+
[pair.first, calculate_directory_statistics(*pair[1..-1])]
|
33
|
+
end]
|
34
|
+
end
|
35
|
+
|
36
|
+
# Match the pattern against the individual file name and the relative file
|
37
|
+
# path. This allows top-level only matches.
|
38
|
+
def calculate_directory_statistics(directory, pattern = DEFAULT_PATTERN)
|
39
|
+
stats = CodeStatisticsCalculator.new
|
40
|
+
|
41
|
+
Dir.foreach(directory) do |file_name|
|
42
|
+
path = "#{directory}/#{file_name}"
|
43
|
+
|
44
|
+
if File.directory?(path) && (/^\./ !~ file_name)
|
45
|
+
stats.add(calculate_directory_statistics(path, pattern))
|
46
|
+
elsif file_name =~ pattern || path =~ pattern
|
47
|
+
stats.add_by_file_path(path)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
stats
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Configure all code statistics directories
|
56
|
+
vendors = [
|
57
|
+
[:unshift, 'Top-levels', 'lib', %r{lib(/jabber_admin)?/[^/]+\.rb$}],
|
58
|
+
[:unshift, 'Top-levels specs', 'spec',
|
59
|
+
%r{spec/jabber_admin(_spec\.rb|/[^/]+\.rb$)}],
|
60
|
+
|
61
|
+
[:unshift, 'Commands', 'lib/jabber_admin/commands'],
|
62
|
+
[:unshift, 'Commands specs', 'spec/jabber_admin/commands']
|
63
|
+
].reverse
|
64
|
+
|
65
|
+
vendors.each do |method, type, dir, pattern|
|
66
|
+
::STATS_DIRECTORIES.send(method, [type, dir, pattern].compact)
|
67
|
+
::CodeStatistics::TEST_TYPES << type if type.include? 'specs'
|
68
|
+
end
|
69
|
+
|
70
|
+
# Setup annotations
|
71
|
+
ENV['SOURCE_ANNOTATION_DIRECTORIES'] = 'spec,doc'
|
72
|
+
|
73
|
+
desc 'Enumerate all annotations'
|
74
|
+
task :notes do
|
75
|
+
SourceAnnotationExtractor.enumerate '@?OPTIMIZE|@?FIXME|@?TODO', tag: true
|
76
|
+
end
|
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.
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<svg
|
3
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
4
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
5
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
6
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
8
|
+
version="1.1"
|
9
|
+
id="Ebene_1"
|
10
|
+
x="0px"
|
11
|
+
y="0px"
|
12
|
+
viewBox="0 0 800 200"
|
13
|
+
xml:space="preserve"
|
14
|
+
width="800"
|
15
|
+
height="200"><metadata
|
16
|
+
id="metadata33"><rdf:RDF><cc:Work
|
17
|
+
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
18
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
19
|
+
id="defs31" />
|
20
|
+
<style
|
21
|
+
type="text/css"
|
22
|
+
id="style2">
|
23
|
+
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#E73E11;}
|
24
|
+
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#0371B9;}
|
25
|
+
.st2{fill:#132E48;}
|
26
|
+
.st3{font-family:'OpenSans-Bold';}
|
27
|
+
.st4{font-size:29.5168px;}
|
28
|
+
.st5{fill-rule:evenodd;clip-rule:evenodd;fill:none;}
|
29
|
+
.st6{opacity:0.5;fill:#132E48;}
|
30
|
+
.st7{font-family:'OpenSans';}
|
31
|
+
.st8{font-size:12px;}
|
32
|
+
</style>
|
33
|
+
<g
|
34
|
+
transform="translate(0,1.53584)"
|
35
|
+
id="g828"><g
|
36
|
+
transform="translate(35.93985,35.66416)"
|
37
|
+
id="g8">
|
38
|
+
<path
|
39
|
+
style="clip-rule:evenodd;fill:#e73e11;fill-rule:evenodd"
|
40
|
+
id="path4"
|
41
|
+
d="m -0.1,124.4 c 0,0 33.7,-123.2 66.7,-123.2 12.8,0 26.9,21.9 38.8,47.2 -23.6,27.9 -66.6,59.7 -94,76 -7.1,0 -11.5,0 -11.5,0 z"
|
42
|
+
class="st0" />
|
43
|
+
<path
|
44
|
+
style="clip-rule:evenodd;fill:#0371b9;fill-rule:evenodd"
|
45
|
+
id="path6"
|
46
|
+
d="m 88.1,101.8 c 13.5,-10.4 18.4,-16.2 27.1,-25.4 10,25.7 16.7,48 16.7,48 0,0 -41.4,0 -78,0 14.6,-7.9 18.7,-10.7 34.2,-22.6 z"
|
47
|
+
class="st1" />
|
48
|
+
</g><text
|
49
|
+
y="106.40316"
|
50
|
+
x="192.43155"
|
51
|
+
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:29.51733398px;font-family:'Open Sans', sans-serif;-inkscape-font-specification:'OpenSans-Bold, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#132e48"
|
52
|
+
id="text10"
|
53
|
+
class="st2 st3 st4">jabber_admin</text>
|
54
|
+
<rect
|
55
|
+
style="clip-rule:evenodd;fill:none;fill-rule:evenodd"
|
56
|
+
id="rect12"
|
57
|
+
height="24"
|
58
|
+
width="314.5"
|
59
|
+
class="st5"
|
60
|
+
y="118.06416"
|
61
|
+
x="194.23985" /><text
|
62
|
+
y="127.22146"
|
63
|
+
x="194.21715"
|
64
|
+
style="font-size:12px;font-family:'Open Sans', sans-serif;opacity:0.5;fill:#132e48;-inkscape-font-specification:'Open Sans, sans-serif, Normal';font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;"
|
65
|
+
id="text14"
|
66
|
+
class="st6 st7 st8">A Ruby library for the ejabberd RESTful admin API </text>
|
67
|
+
</g>
|
68
|
+
</svg>
|
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,19 @@ 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 'rake', '~>
|
42
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
43
|
-
spec.add_development_dependency 'rubocop'
|
44
|
-
spec.add_development_dependency 'rubocop-rspec'
|
45
|
-
spec.add_development_dependency 'simplecov', '
|
46
|
-
spec.add_development_dependency 'vcr', '~>
|
40
|
+
spec.add_development_dependency 'bundler', '>= 1.16', '< 3'
|
41
|
+
spec.add_development_dependency 'irb', '~> 1.2'
|
42
|
+
spec.add_development_dependency 'railties', '>= 4.2.0', '< 6.1'
|
43
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
44
|
+
spec.add_development_dependency 'rspec', '~> 3.9'
|
45
|
+
spec.add_development_dependency 'rubocop', '~> 0.93'
|
46
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.43'
|
47
|
+
spec.add_development_dependency 'simplecov', '< 0.18'
|
48
|
+
spec.add_development_dependency 'vcr', '~> 6.0'
|
47
49
|
spec.add_development_dependency 'webmock', '~> 3.0'
|
50
|
+
spec.add_development_dependency 'yard', '~> 0.9.18'
|
51
|
+
spec.add_development_dependency 'yard-activesupport-concern', '~> 0.0.1'
|
48
52
|
end
|
@@ -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 = callable.call(meth, check_res_body: false,
|
57
|
+
user: uid, host: host, **args)
|
58
|
+
body = (200..299).cover?(res.code) ? JSON.parse(res.body) : nil
|
59
|
+
body.is_a?(Hash) ? body['content'] : body
|
60
|
+
rescue JabberAdmin::Error => e
|
61
|
+
# When ejabberd tells us there was no value, it does this the hard way
|
62
|
+
next if e.response.body.include? 'error_no_value_found_in_vcard'
|
63
|
+
# Same for the case when there is no vCard at all
|
64
|
+
next if e.response.body.include? 'error_no_vcard_found'
|
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
@@ -1,7 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# The gem module.
|
3
4
|
module JabberAdmin
|
4
5
|
# The version constant of the gem. Increase this value
|
5
6
|
# in case of a gem release.
|
6
|
-
VERSION = '0.
|
7
|
+
VERSION = '1.0.3'
|
8
|
+
|
9
|
+
class << self
|
10
|
+
# Returns the version of gem as a string.
|
11
|
+
#
|
12
|
+
# @return [String] the gem version as string
|
13
|
+
def version
|
14
|
+
VERSION
|
15
|
+
end
|
16
|
+
|
17
|
+
# Returns the version of the gem as a +Gem::Version+.
|
18
|
+
#
|
19
|
+
# @return [Gem::Version] the gem version as object
|
20
|
+
def gem_version
|
21
|
+
Gem::Version.new VERSION
|
22
|
+
end
|
23
|
+
end
|
7
24
|
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+.
|
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.3
|
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: 2021-10-15 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,140 @@ 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'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: railties
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 4.2.0
|
89
|
+
- - "<"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '6.1'
|
92
|
+
type: :development
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 4.2.0
|
99
|
+
- - "<"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '6.1'
|
62
102
|
- !ruby/object:Gem::Dependency
|
63
103
|
name: rake
|
64
104
|
requirement: !ruby/object:Gem::Requirement
|
65
105
|
requirements:
|
66
106
|
- - "~>"
|
67
107
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
108
|
+
version: '13.0'
|
69
109
|
type: :development
|
70
110
|
prerelease: false
|
71
111
|
version_requirements: !ruby/object:Gem::Requirement
|
72
112
|
requirements:
|
73
113
|
- - "~>"
|
74
114
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
115
|
+
version: '13.0'
|
76
116
|
- !ruby/object:Gem::Dependency
|
77
117
|
name: rspec
|
78
118
|
requirement: !ruby/object:Gem::Requirement
|
79
119
|
requirements:
|
80
120
|
- - "~>"
|
81
121
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
122
|
+
version: '3.9'
|
83
123
|
type: :development
|
84
124
|
prerelease: false
|
85
125
|
version_requirements: !ruby/object:Gem::Requirement
|
86
126
|
requirements:
|
87
127
|
- - "~>"
|
88
128
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
129
|
+
version: '3.9'
|
90
130
|
- !ruby/object:Gem::Dependency
|
91
131
|
name: rubocop
|
92
132
|
requirement: !ruby/object:Gem::Requirement
|
93
133
|
requirements:
|
94
|
-
- - "
|
134
|
+
- - "~>"
|
95
135
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
136
|
+
version: '0.93'
|
97
137
|
type: :development
|
98
138
|
prerelease: false
|
99
139
|
version_requirements: !ruby/object:Gem::Requirement
|
100
140
|
requirements:
|
101
|
-
- - "
|
141
|
+
- - "~>"
|
102
142
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
143
|
+
version: '0.93'
|
104
144
|
- !ruby/object:Gem::Dependency
|
105
145
|
name: rubocop-rspec
|
106
146
|
requirement: !ruby/object:Gem::Requirement
|
107
147
|
requirements:
|
108
|
-
- - "
|
148
|
+
- - "~>"
|
109
149
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
150
|
+
version: '1.43'
|
111
151
|
type: :development
|
112
152
|
prerelease: false
|
113
153
|
version_requirements: !ruby/object:Gem::Requirement
|
114
154
|
requirements:
|
115
|
-
- - "
|
155
|
+
- - "~>"
|
116
156
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
157
|
+
version: '1.43'
|
118
158
|
- !ruby/object:Gem::Dependency
|
119
159
|
name: simplecov
|
120
160
|
requirement: !ruby/object:Gem::Requirement
|
121
161
|
requirements:
|
122
|
-
- - "
|
162
|
+
- - "<"
|
123
163
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0.
|
164
|
+
version: '0.18'
|
125
165
|
type: :development
|
126
166
|
prerelease: false
|
127
167
|
version_requirements: !ruby/object:Gem::Requirement
|
128
168
|
requirements:
|
129
|
-
- - "
|
169
|
+
- - "<"
|
130
170
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0.
|
171
|
+
version: '0.18'
|
132
172
|
- !ruby/object:Gem::Dependency
|
133
173
|
name: vcr
|
134
174
|
requirement: !ruby/object:Gem::Requirement
|
135
175
|
requirements:
|
136
176
|
- - "~>"
|
137
177
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
178
|
+
version: '6.0'
|
139
179
|
type: :development
|
140
180
|
prerelease: false
|
141
181
|
version_requirements: !ruby/object:Gem::Requirement
|
142
182
|
requirements:
|
143
183
|
- - "~>"
|
144
184
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
185
|
+
version: '6.0'
|
146
186
|
- !ruby/object:Gem::Dependency
|
147
187
|
name: webmock
|
148
188
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,6 +197,34 @@ dependencies:
|
|
157
197
|
- - "~>"
|
158
198
|
- !ruby/object:Gem::Version
|
159
199
|
version: '3.0'
|
200
|
+
- !ruby/object:Gem::Dependency
|
201
|
+
name: yard
|
202
|
+
requirement: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - "~>"
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: 0.9.18
|
207
|
+
type: :development
|
208
|
+
prerelease: false
|
209
|
+
version_requirements: !ruby/object:Gem::Requirement
|
210
|
+
requirements:
|
211
|
+
- - "~>"
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: 0.9.18
|
214
|
+
- !ruby/object:Gem::Dependency
|
215
|
+
name: yard-activesupport-concern
|
216
|
+
requirement: !ruby/object:Gem::Requirement
|
217
|
+
requirements:
|
218
|
+
- - "~>"
|
219
|
+
- !ruby/object:Gem::Version
|
220
|
+
version: 0.0.1
|
221
|
+
type: :development
|
222
|
+
prerelease: false
|
223
|
+
version_requirements: !ruby/object:Gem::Requirement
|
224
|
+
requirements:
|
225
|
+
- - "~>"
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: 0.0.1
|
160
228
|
description: Library for the ejabberd RESTful admin API
|
161
229
|
email:
|
162
230
|
- henning.vogt@hausgold.de
|
@@ -166,11 +234,12 @@ extensions: []
|
|
166
234
|
extra_rdoc_files: []
|
167
235
|
files:
|
168
236
|
- ".editorconfig"
|
237
|
+
- ".github/workflows/documentation.yml"
|
238
|
+
- ".github/workflows/test.yml"
|
169
239
|
- ".gitignore"
|
170
240
|
- ".rspec"
|
171
241
|
- ".rubocop.yml"
|
172
242
|
- ".simplecov"
|
173
|
-
- ".travis.yml"
|
174
243
|
- ".yardopts"
|
175
244
|
- CHANGELOG.md
|
176
245
|
- Gemfile
|
@@ -178,11 +247,10 @@ files:
|
|
178
247
|
- Makefile
|
179
248
|
- README.md
|
180
249
|
- Rakefile
|
250
|
+
- bin/config.rb
|
181
251
|
- bin/console
|
182
252
|
- bin/setup
|
183
|
-
- doc/assets/
|
184
|
-
- doc/assets/project.png
|
185
|
-
- doc/assets/project.xcf
|
253
|
+
- doc/assets/project.svg
|
186
254
|
- docker-compose.yml
|
187
255
|
- jabber_admin.gemspec
|
188
256
|
- lib/jabber_admin.rb
|
@@ -191,6 +259,7 @@ files:
|
|
191
259
|
- lib/jabber_admin/commands/ban_account.rb
|
192
260
|
- lib/jabber_admin/commands/create_room.rb
|
193
261
|
- lib/jabber_admin/commands/create_room_with_opts.rb
|
262
|
+
- lib/jabber_admin/commands/get_vcard.rb
|
194
263
|
- lib/jabber_admin/commands/muc_register_nick.rb
|
195
264
|
- lib/jabber_admin/commands/register.rb
|
196
265
|
- lib/jabber_admin/commands/registered_users.rb
|
@@ -201,6 +270,7 @@ files:
|
|
201
270
|
- lib/jabber_admin/commands/set_nickname.rb
|
202
271
|
- lib/jabber_admin/commands/set_presence.rb
|
203
272
|
- lib/jabber_admin/commands/set_room_affiliation.rb
|
273
|
+
- lib/jabber_admin/commands/set_vcard.rb
|
204
274
|
- lib/jabber_admin/commands/subscribe_room.rb
|
205
275
|
- lib/jabber_admin/commands/unregister.rb
|
206
276
|
- lib/jabber_admin/commands/unsubscribe_room.rb
|
@@ -212,24 +282,23 @@ licenses:
|
|
212
282
|
- MIT
|
213
283
|
metadata:
|
214
284
|
allowed_push_host: https://rubygems.org
|
215
|
-
post_install_message:
|
285
|
+
post_install_message:
|
216
286
|
rdoc_options: []
|
217
287
|
require_paths:
|
218
288
|
- lib
|
219
289
|
required_ruby_version: !ruby/object:Gem::Requirement
|
220
290
|
requirements:
|
221
|
-
- - "
|
291
|
+
- - "~>"
|
222
292
|
- !ruby/object:Gem::Version
|
223
|
-
version: '2.
|
293
|
+
version: '2.5'
|
224
294
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
295
|
requirements:
|
226
296
|
- - ">="
|
227
297
|
- !ruby/object:Gem::Version
|
228
298
|
version: '0'
|
229
299
|
requirements: []
|
230
|
-
|
231
|
-
|
232
|
-
signing_key:
|
300
|
+
rubygems_version: 3.2.16
|
301
|
+
signing_key:
|
233
302
|
specification_version: 4
|
234
303
|
summary: Library for the ejabberd RESTful admin API
|
235
304
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
|
3
|
-
env:
|
4
|
-
global:
|
5
|
-
- CC_TEST_REPORTER_ID=02d696c72627e730a3db553884276acf15672466e32e66a788672d3b167629ca
|
6
|
-
|
7
|
-
language: ruby
|
8
|
-
rvm:
|
9
|
-
- 2.5
|
10
|
-
- 2.4
|
11
|
-
- 2.3
|
12
|
-
- 2.2
|
13
|
-
|
14
|
-
before_install: gem install bundler -v 1.15.1
|
15
|
-
before_script:
|
16
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
17
|
-
- chmod +x ./cc-test-reporter
|
18
|
-
- ./cc-test-reporter before-build
|
19
|
-
after_script:
|
20
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/doc/assets/logo.png
DELETED
Binary file
|
data/doc/assets/project.png
DELETED
Binary file
|
data/doc/assets/project.xcf
DELETED
Binary file
|