Class: SimpleDeploy::Notifier::Campfire
- Inherits:
-
Object
- Object
- SimpleDeploy::Notifier::Campfire
- Defined in:
- lib/simple_deploy/notifier/campfire.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Campfire
constructor
A new instance of Campfire.
- #send(message) ⇒ Object
Constructor Details
#initialize(args) ⇒ Campfire
Returns a new instance of Campfire.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/simple_deploy/notifier/campfire.rb', line 7 def initialize(args) @stack_name = args[:stack_name] @environment = args[:environment] @config = args[:config] @logger = @config.logger attributes = stack.attributes @subdomain = attributes['campfire_subdomain'] @room_ids = attributes['campfire_room_ids'] ||= '' @logger.debug "Campfire subdomain '#{@subdomain}'." @logger.debug "Campfire room ids '#{@room_ids}'." if @subdomain @token = @config.notifications['campfire']['token'] @campfire = Tinder::Campfire.new @subdomain, :token => @token, :ssl_options => { :verify => false } end end |
Instance Method Details
#send(message) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/simple_deploy/notifier/campfire.rb', line 26 def send() @logger.info "Sending Campfire notifications." @room_ids.split(',').each do |room_id| @logger.debug "Sending notification to Campfire room #{room_id}." room = @campfire.find_room_by_id room_id.to_i room.speak end @logger.info "Campfire notifications complete." end |