Sha256: 2827022d092fd06417a57387aa9263a3e9e28bc0714bf896c89cd35dbd816ba3

Contents?: true

Size: 1.65 KB

Versions: 9

Compression:

Stored size: 1.65 KB

Contents

require 'thor'
require 'mustache'
require_relative 'configurator.rb'

module RabbitHutch
  #This class controls the Command Line Interface
  class CLI < Thor
    
StandardTemplate =<<-TEMPLATE
{{#config}}

{{#application}}
Application
+------------------------+------------------------+
|Exchange                |Queue                   |
+------------------------+------------------------+
|{{exchangename}}        |  {{queuename}}         |
+------------------------+------------------------+
{{/application}}

{{#rabbitmq}}
RabbitMq Servers
+------------------------+------------------------+
|Display Name                |Host                   |
+------------------------+------------------------+
{{#hosts}}
|{{displayname}}        |  {{hostname}}         |
+------------------------+------------------------+
{{/hosts}}
{{/rabbitmq}}

{{/config}}
TEMPLATE

    desc "list", "List all config settings"
    #method_option :errors, :aliases => "-e", :type => :boolean, :default => false, :desc => "true = display files that could not be processed, false = do not display skipped files"
    #method_option :hashtype, :aliases => "-h", :default => "cmd5", :desc => "Choose the hash algorithm to use - md5 or sha"
    method_option :config, :aliases => "-c", :default => nil, :desc => "parse the config file from a specified location "
    #method_option :recursive, :aliases => "-r", :type => :boolean, :default => "false", :desc => "true = recurse through sub directories, false = only do top directory"
    def list()
      @config = RabbitHutch::Configurator.new(options)
      puts Mustache.render(StandardTemplate,  :config => @config);
    end
    
  end  
  
  CLI.start()
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
dafiti-rabbit-hutch-0.1.12 lib/rabbithutchmgr.rb
dafiti-rabbit-hutch-0.1.11 lib/rabbithutchmgr.rb
dafiti-rabbit-hutch-0.1.10 lib/rabbithutchmgr.rb
dafiti-rabbit-hutch-0.1.9 lib/rabbithutchmgr.rb
dafiti-rabbit-hutch-0.1.5 lib/rabbithutchmgr.rb
dafiti-rabbit-hutch-0.1.4 lib/rabbithutchmgr.rb
dafiti-rabbit-hutch-0.1.1 lib/rabbithutchmgr.rb
dafiti-rabbit-hutch-0.1.0 lib/rabbithutchmgr.rb
rabbithutch-0.1.5 lib/rabbithutchmgr.rb