Sha256: be6fc696a229e89bb278592e1a9588557796eb11ae6f2f8a2c3b8b3bb02724cd

Contents?: true

Size: 761 Bytes

Versions: 2

Compression:

Stored size: 761 Bytes

Contents

module MyScripts
  # Starts and controls rabbitmq server
  class Rabbit < Script
    VERSION = '0.1.0'

    def run
      error 'ERLANG_HOME not set' unless ENV['ERLANG_HOME']
      rabbit_hole = ENV['ERLANG_HOME'] + '/lib/rabbitmq_server-1.7.0/sbin'
      case @argv.shift
        when /start/
          system "#{rabbit_hole}/rabbitmq-server.bat #{@argv.join(' ')}"
        when /stop/
          system "#{rabbit_hole}/rabbitmqctl.bat stop #{@argv.join(' ')}"
        when /ctl/
          system "#{rabbit_hole}/rabbitmqctl.bat #{@argv.join(' ')}"
        else
          usage ["start [args] - starts rabbitmq node", "stop [args] - stops running rabbitmq node",
                 "ctl [args] - controls rabbitmq node"], explanation
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
my_scripts-0.1.10 lib/my_scripts/scripts/rabbit.rb
my_scripts-0.1.9 lib/my_scripts/scripts/rabbit.rb