rabbitmqadmin-cli 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rabbitmqadmin-cli.rb +0 -17
- data/lib/rabbitmqadmin-cli/version.rb +1 -1
- data/rabbitmqadmin-cli.gemspec +1 -1
- metadata +1 -1
data/lib/rabbitmqadmin-cli.rb
CHANGED
@@ -1,29 +1,12 @@
|
|
1
1
|
require 'json'
|
2
2
|
|
3
3
|
class RabbitMqAdminCli
|
4
|
-
|
5
|
-
def self.test_connect(host, port, username, password, scheme = "http")
|
6
|
-
`wget --spider -T 1 -t 1 --user=#{username} --password=#{password} #{scheme}://#{host}:#{port}/img/rabbitmqlogo.png >/dev/null 2>&1`
|
7
|
-
case $?.exitstatus
|
8
|
-
when 0, 6
|
9
|
-
[0, "All OK"]
|
10
|
-
when 4
|
11
|
-
[1, "Attempt to connect to #{host}:#{port} timed out"]
|
12
|
-
when 5
|
13
|
-
[2, "Using scheme #{scheme}, SSL verification failed"]
|
14
|
-
else
|
15
|
-
[3, "General problem, cannot determine if RabbitMq http server is running on #{host}:#{port}"]
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
4
|
def initialize admin_user = 'guest', admin_password = 'guest', host = 'localhost', port = 55672
|
20
5
|
@admin_user = admin_user
|
21
6
|
@admin_password = admin_password
|
22
7
|
@host = host
|
23
8
|
@port = port
|
24
9
|
@verbose = false
|
25
|
-
code, msg = self.class.test_connect(@host, @port, @admin_user, @admin_password)
|
26
|
-
raise msg unless code == 0
|
27
10
|
end
|
28
11
|
|
29
12
|
attr_accessor :verbose, :host, :port
|
data/rabbitmqadmin-cli.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'rabbitmqadmin-cli'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.8'
|
4
4
|
s.platform = RUBY_PLATFORM.to_s == 'java' ? 'java' : Gem::Platform::RUBY
|
5
5
|
s.authors = ['Lee Henson', 'Guy Boertje']
|
6
6
|
s.email = ['lee.m.henson@gmail.com', 'guyboertje@gmail.com']
|