Class: Thor::AppCmd
- Inherits:
-
Application
- Object
- Bsl::Application
- Application
- Thor::AppCmd
- Defined in:
- lib/ThorCmd.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#optpars ⇒ Object
Returns the value of attribute optpars.
-
#request_exit ⇒ Object
Returns the value of attribute request_exit.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ AppCmd
constructor
A new instance of AppCmd.
-
#main ⇒ Object
Main entry-point.
Methods inherited from Application
#amqp_handle_failure, #amqp_loop, #amqp_start, #amqp_stop, #run
Constructor Details
#initialize(opts = {}) ⇒ AppCmd
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ThorCmd.rb', line 27 def initialize(opts = {}) super(ops) # AMQP options [:amqp_host] = "localhost" [:amqp_port] = 1234 [:amqp_user] = "user" [:amqp_password] = "password" [:amqp_vhost] = "my-vhost" [:amqp_channel_master] = "master" initialize_optparser { |opts| ############################ # AMQP Section ############################ # AMQP Host opts.on( '-H', '--amqp-host STRING', "AMQP Server hostname") do |host| [:amqp_host] = host end # AMQP Port opts.on( '-p', '--amqp-port NUM', "AMQP Server port number") do |port| [:amqp_port] = port end # AMQP Username opts.on( '-u', '--amqp-user STRING', "AMQP Username") do |user| [:amqp_user] = user end # AMQP Password opts.on( '-P', '--amqp-password STRING', "AMQP Password") do |password| [:amqp_password] = password end # AMQP Vhost opts.on( '-V', '--amqp-vhost STRING', "AMQP Virtual Host") do |vhost| [:amqp_vhost] = vhost end ## Channels # Channel Master opts.on( '-acm', '--amqp-channel-master STRING', "AMQP Channel Mastr") do |channel| [:amqp_channel_master] = channel end } end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
25 26 27 |
# File 'lib/ThorCmd.rb', line 25 def end |
#optpars ⇒ Object
Returns the value of attribute optpars.
25 26 27 |
# File 'lib/ThorCmd.rb', line 25 def optpars @optpars end |
#request_exit ⇒ Object
Returns the value of attribute request_exit.
25 26 27 |
# File 'lib/ThorCmd.rb', line 25 def request_exit @request_exit end |
Instance Method Details
#main ⇒ Object
Main entry-point
77 78 79 |
# File 'lib/ThorCmd.rb', line 77 def main super() end |