cerberus 0.7.7 → 0.7.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.txt +5 -0
- data/Copyright.txt +3 -1
- data/Readme.markdown +1 -3
- data/lib/cerberus/config.example.yml +1 -0
- data/lib/cerberus/constants.rb +1 -1
- data/lib/cerberus/publisher/irc.rb +6 -5
- data/lib/vendor/shout-bot/lib/shout-bot.rb +5 -4
- metadata +3 -3
data/Changelog.txt
CHANGED
@@ -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
|
|
data/Copyright.txt
CHANGED
data/Readme.markdown
CHANGED
@@ -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 -
|
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
|
|
data/lib/cerberus/constants.rb
CHANGED
@@ -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
|
13
|
-
nick
|
14
|
-
server
|
15
|
-
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
|
-
|
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
|
-
-
|
9
|
-
version: 0.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-
|
17
|
+
date: 2010-05-01 00:00:00 -04:00
|
18
18
|
default_executable: cerberus
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|