cerberus 0.7.7 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,10 @@
1
1
  = Cerberus Changelog
2
2
 
3
+ == Version 0.7.8
4
+ Added channel password option to IRC publisher
5
+
6
+ * New channel_password config option under publisher/irc
7
+
3
8
  == Version 0.7.7
4
9
  Bugfixes, publisher and config options updates, ActionMailer gem version requirements
5
10
 
@@ -14,4 +14,6 @@ Mike Gunderloy
14
14
  Joe Van Dyk
15
15
  Andrew Timberlake
16
16
  Paul Hinze
17
- McClain Looney
17
+ McClain Looney
18
+ Peter Fitzgibbons
19
+ Kai Chen
@@ -33,9 +33,7 @@ Main advantages of Cerberus over other solutions include:
33
33
 
34
34
  * ruby - 1.8.2 or higher
35
35
  * rake - 0.7.3 or higher (optional)
36
- * actionmailer - 1.3.3 or higher (optional)
37
- * activesupport - 1.4.2 or higher (optional)
38
- * gmailer - 0.1.7 or higher (optional)
36
+ * actionmailer - 2.0 or higher (optional)
39
37
 
40
38
  ## Usage
41
39
 
@@ -19,6 +19,7 @@ publisher:
19
19
  # nick: cerb
20
20
  # server: irc.freenode.net
21
21
  # channel: cerberus
22
+ # channel_password: secert
22
23
  # campfire:
23
24
  # url: http://someemail:password@cerberustool.campfirenow.com/room/51660
24
25
  # rss:
@@ -4,5 +4,5 @@ module Cerberus
4
4
 
5
5
  LOCK_WAIT = 30 * 60 # 30 minutes
6
6
 
7
- VERSION = '0.7.7'
7
+ VERSION = '0.7.8'
8
8
  end
@@ -9,12 +9,13 @@ class Cerberus::Publisher::IRC < Cerberus::Publisher::Base
9
9
  subject,body = Cerberus::Publisher::Base.formatted_message(state, manager, options)
10
10
  message = subject + "\n" + '*' * subject.length + "\n" + body
11
11
 
12
- port = irc_options[:port] || 6667
13
- nick = irc_options[:nick] || 'cerberus'
14
- server = irc_options[:server]
15
- channel = '#' + irc_options[:channel]
12
+ port = irc_options[:port] || 6667
13
+ nick = irc_options[:nick] || 'cerberus'
14
+ server = irc_options[:server]
15
+ channel = '#' + irc_options[:channel]
16
+ channel_password = irc_options[:channel_password]
16
17
 
17
- ShoutBot.shout("irc://#{nick}@#{server}:#{port}/#{channel}") do |channel|
18
+ ShoutBot.shout("irc://#{nick}@#{server}:#{port}/#{channel}", channel_password) do |channel|
18
19
  message.split("\n").each { |line| channel.say line }
19
20
  end
20
21
 
@@ -31,13 +31,13 @@ require "addressable/uri"
31
31
  require "socket"
32
32
 
33
33
  class ShoutBot
34
- def self.shout(uri, &block)
34
+ def self.shout(uri, password = nil, &block)
35
35
  raise ArgumentError unless block_given?
36
36
 
37
37
  uri = Addressable::URI.parse(uri)
38
38
  irc = new(uri.host, uri.port, uri.user, uri.password) do |irc|
39
39
  if channel = uri.fragment
40
- irc.join(channel, &block)
40
+ irc.join(channel, password, &block)
41
41
  else
42
42
  irc.channel = uri.path[1..-1]
43
43
  yield irc
@@ -60,11 +60,12 @@ class ShoutBot
60
60
  @socket.gets until @socket.eof?
61
61
  end
62
62
 
63
- def join(channel)
63
+ def join(channel, password = nil)
64
64
  raise ArgumentError unless block_given?
65
65
 
66
66
  @channel = "##{channel}"
67
- @socket.puts "JOIN #{@channel}"
67
+ password = password && " #{password}" || ""
68
+ @socket.puts "JOIN #{@channel}#{password}"
68
69
  yield self
69
70
  @socket.puts "PART #{@channel}"
70
71
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 7
9
- version: 0.7.7
8
+ - 8
9
+ version: 0.7.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Craig P Jolicoeur
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-25 00:00:00 -04:00
17
+ date: 2010-05-01 00:00:00 -04:00
18
18
  default_executable: cerberus
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency