Sha256: 3f1b7a906b669eb0f96898a1e1156218d3c35367bc768ca2e4d2a05d4dd525a4

Contents?: true

Size: 666 Bytes

Versions: 5

Compression:

Stored size: 666 Bytes

Contents

module MyScripts
  # Starts and controls rabbitmq server
  class Rabbit < Script
    def run
      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"]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
my_scripts-0.0.24 lib/my_scripts/rabbit.rb
my_scripts-0.0.23 lib/my_scripts/rabbit.rb
my_scripts-0.0.22 lib/my_scripts/rabbit.rb
my_scripts-0.0.19 lib/my_scripts/rabbit.rb
my_scripts-0.0.17 lib/my_scripts/rabbit.rb