Class: Integrity::Notifier::IntegrityTwitter

Inherits:
Notifier::Base
  • Object
show all
Defined in:
lib/notifier/twitter.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.to_hamlObject



9
10
11
# File 'lib/notifier/twitter.rb', line 9

def self.to_haml
  File.read File.dirname(__FILE__) / "config.haml"
end

Instance Method Details

#deliver!Object



13
14
15
16
17
18
# File 'lib/notifier/twitter.rb', line 13

def deliver!
  httpauth = Twitter::HTTPAuth.new(@config['email'], @config['pass'])
  @tweet = Twitter::Base.new(httpauth)

  @tweet.post(message)
end

#messageObject



20
21
22
# File 'lib/notifier/twitter.rb', line 20

def message
  "#{build_status} | #{commit.project.name}, commit #{commit.short_identifier} - [committer: #{commit.author.name}]"
end