Class: CampfireBot::Standup::Plugin

Inherits:
Plugin
  • Object
show all
Defined in:
lib/campfire_bot/standup.rb

Instance Method Summary collapse

Constructor Details

#initializePlugin

Returns a new instance of Plugin.



8
9
10
# File 'lib/campfire_bot/standup.rb', line 8

def initialize
  @config = YAML::load(ERB.new(File.read("#{BOT_ROOT}/standup-config.yml")).result)[BOT_ENVIRONMENT]
end

Instance Method Details

#standup(msg) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/campfire_bot/standup.rb', line 12

def standup(msg)
  bot.log.debug "sending standup email to #{to_addresses}"

  Pony.mail({
    :to => to_addresses,
    :from => from(msg),
    :subject => subject,
    :body => msg[:message]
  }.merge(pony_options))

  msg.speak "Sent standup email to #{to_addresses.join(', ')}"
end