jabber_admin 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bef934e77d0ed04897a438011c43b1e0eb20c3d
4
- data.tar.gz: a4b3aee9c91d36cd1e33dac1d4867cb8cf30a702
3
+ metadata.gz: 9b60bf9121f5fd712ba6e08eec98005067fc2957
4
+ data.tar.gz: '0931c367247d9500e1086590361e0e97067ad602'
5
5
  SHA512:
6
- metadata.gz: 157d5e63511844db92b00b2ae32ba83e918d337fe8258b740879574ffb4daf0a622b12ec17ee9bd8dd286c384603f228fe3e84c0bfe8ac180d6a61a7aa347cfe
7
- data.tar.gz: e621033ebf75b076d743a4bd85386527ac862fbfb057b0809df13c2254976fc5d5bac286b0145d0d1e36a33d62319ef273427b09634c18a6bfb085bc86e5428c
6
+ metadata.gz: 4b925cd9840cefa15a39fa8e578681ab5b411e9361384f1f8adf8197de0c60136ddedaa375b88223d700bfef6213aa521b449bfba1be4d5d3e60c649436afae2
7
+ data.tar.gz: b2586b050d2314014ee9bb2a4390a204a91817b00fa2cb468b22e8d37f35148a135f7d56bef22a207ac2904ee116efe17e1b418b22811f15cb7267c1c7af5864
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # JabberAdmin
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
- JabberAdmin is a small library to easily communicate with the Ejabberd
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
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 "jabber_admin/version"
3
+ require 'jabber_admin/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = "jabber_admin"
6
+ spec.name = 'jabber_admin'
8
7
  spec.version = JabberAdmin::VERSION
9
- spec.authors = ["Henning Vogt"]
8
+ spec.authors = ['Henning Vogt']
10
9
  spec.licenses = ['MIT']
11
- spec.email = ["henning.vogt@hausgold.de"]
10
+ spec.email = ['henning.vogt@hausgold.de']
12
11
 
13
- spec.summary = %q{Library for the Ejabberd RESTful admin API}
14
- spec.description = %q{Library for the Ejabberd RESTful admin API}
15
- spec.homepage = "https://github.com/hausgold/jabber_admin"
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["allowed_push_host"] = "https://rubygems.org"
19
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
20
  else
22
- raise "RubyGems 2.0 or newer is required to protect against " \
23
- "public gem pushes."
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 = "exe"
28
+ spec.bindir = 'exe'
30
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
- spec.require_paths = ["lib"]
30
+ spec.require_paths = ['lib']
32
31
 
33
32
  spec.add_dependency 'rest-client', '~> 2.0', '>= 2.0.2'
34
- spec.add_dependency "activesupport", ">= 4.2.5"
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 "bundler", "~> 1.16"
39
- spec.add_development_dependency "rake", "~> 10.0"
40
- spec.add_development_dependency "rspec", "~> 3.0"
41
- spec.add_development_dependency "simplecov", "~> 0.15"
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
- require 'jabber_admin/commands/ban_account'
4
- require 'jabber_admin/commands/create_room'
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
@@ -1,5 +1,6 @@
1
1
  # Fix pluralization of commands
2
2
  ActiveSupport::Inflector.inflections do |inflect|
3
3
  inflect.irregular 'create_room_with_opts', 'create_room_with_opts'
4
+ inflect.irregular 'registered_users', 'registered_users'
4
5
  end
5
6
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JabberAdmin
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
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.3
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-18 00:00:00.000000000 Z
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 Ejabberd RESTful admin API
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 Ejabberd RESTful admin API
165
+ summary: Library for the ejabberd RESTful admin API
161
166
  test_files: []