Sha256: e545ba70ba0e3fd64e6254264360d9d64f2ab08d6936714d7158047007ea2990

Contents?: true

Size: 1014 Bytes

Versions: 4

Compression:

Stored size: 1014 Bytes

Contents

require 'json'
require 'rake'
require 'uri'
require 'colorize'
require 'highline/import'
require 'rabbitmq/http/client'
require 'rabbitmq_definition/logger'
require 'rabbitmq_definition/file_definition'
require 'rabbitmq_definition/command'
require 'rabbitmq_definition/create'
require 'rabbitmq_definition/drop'
require 'rabbitmq_definition/load'
require 'rabbitmq_definition/dump'
require 'rabbitmq_definition/engine'

module RabbitMQ::Definition
  def self.create(vhosts)
    RabbitMQ::Definition::Create.run(client, verbose, vhosts)
  end

  def self.drop
    RabbitMQ::Definition::Drop.run(client, verbose)
  end

  def self.dump(vhosts = nil)
    RabbitMQ::Definition::Dump.run(client, verbose, vhosts)
  end

  def self.load
    RabbitMQ::Definition::Load.run(client, verbose)
  end

  private

  def self.client
    RabbitMQ::HTTP::Client.new(rabbitmq_management_url)
  end

  def self.rabbitmq_management_url
    ENV['RABBITMQ_MANAGEMENT_URL']
  end

  def self.verbose
    Rake.verbose == true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rabbitmq-definition-0.1.3 lib/rabbitmq-definition.rb
rabbitmq-definition-0.1.2 lib/rabbitmq-definition.rb
rabbitmq-definition-0.1.1 lib/rabbitmq-definition.rb
rabbitmq-definition-0.1.0 lib/rabbitmq-definition.rb