Module: AutoReconfiguration::Carrot
- Defined in:
- lib/cf-autoconfig/messaging/carrot.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
7 8 9 10 |
# File 'lib/cf-autoconfig/messaging/carrot.rb', line 7 def self.included( base ) base.send( :alias_method, :original_initialize, :initialize) base.send( :alias_method, :initialize, :initialize_with_cf ) end |
Instance Method Details
#initialize_with_cf(opts = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cf-autoconfig/messaging/carrot.rb', line 12 def initialize_with_cf(opts = {}) service_names = CFRuntime::CloudApp.service_names_of_type('rabbitmq') if service_names.length == 1 puts "Auto-reconfiguring Carrot." cfopts = CFRuntime::CarrotClient.(service_names[0],opts) original_initialize cfopts else puts "Found #{service_names.length} rabbitmq services. Skipping auto-reconfiguration." original_initialize opts end end |