rabbitmqadmin-cli 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  class RabbitMqAdminCli
2
4
  def initialize admin_user = 'guest', admin_password = 'guest'
3
5
  @admin_user = admin_user
@@ -13,6 +15,8 @@ class RabbitMqAdminCli
13
15
  end
14
16
 
15
17
  def initialize_user vhost, user, password, tags = ''
18
+ raise "Can't initialize the admin user '#{user}' without crippling your access" if user == @admin_user
19
+
16
20
  `#{run} delete user name=#{user}` if user_exists? user
17
21
  `#{run} declare user name=#{user} password=#{password} tags=#{tags}`
18
22
  add_user_to_vhost vhost, user
@@ -1,3 +1,3 @@
1
1
  module RabbitMqAdminCli
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rabbitmqadmin-cli'
3
- s.version = '1.0.0'
4
- s.platform = Gem::Platform::RUBY
3
+ s.version = '1.0.1'
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']
7
7
  s.summary = %q{Ruby wrapper for calling out the rabbitmqadmin cli script}
@@ -21,5 +21,9 @@ Gem::Specification.new do |s|
21
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
23
 
24
- s.add_dependency 'json'
24
+ if RUBY_PLATFORM.to_s == 'java'
25
+ s.add_dependency 'json-jruby'
26
+ else
27
+ s.add_dependency 'json'
28
+ end
25
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbitmqadmin-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-09-27 00:00:00.000000000 Z
13
+ date: 2011-09-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
17
- requirement: &70181339511660 !ruby/object:Gem::Requirement
17
+ requirement: &74032390 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70181339511660
25
+ version_requirements: *74032390
26
26
  description: Requires rabbitmqadmin to be in your path
27
27
  email:
28
28
  - lee.m.henson@gmail.com