coffeemaker 0.0.1.beta.2 → 0.0.1.beta.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/coffeemaker/bot/irc.rb
CHANGED
@@ -5,23 +5,25 @@ require 'active_support/core_ext/module/delegation'
|
|
5
5
|
module Coffeemaker
|
6
6
|
class Bot
|
7
7
|
class Irc
|
8
|
-
attr_reader :connection
|
9
8
|
attr_accessor :on_message
|
9
|
+
attr_reader :host, :port, :nick, :connection
|
10
|
+
private :connection
|
11
|
+
|
10
12
|
delegate :join, :part, :msg, :privmsg, to: :connection
|
11
13
|
|
12
14
|
def initialize(options)
|
13
15
|
@host = options.delete(:irc_host)
|
14
16
|
@port = options.delete(:irc_port)
|
17
|
+
@nick = options.delete(:nick)
|
15
18
|
@on_message = options.delete(:on_message)
|
16
|
-
@options = options
|
17
19
|
end
|
18
20
|
|
19
21
|
def start
|
20
22
|
@connection = EM.connect(@host, @port, Connection) do |c|
|
21
23
|
c.host = @host
|
22
24
|
c.port = @port
|
25
|
+
c.nick = @nick
|
23
26
|
c.on_message = @on_message
|
24
|
-
c.options = @options
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
@@ -13,13 +13,13 @@ module Coffeemaker
|
|
13
13
|
include ::EM::Protocols::LineText2
|
14
14
|
include ::Coffeemaker::Bot::Irc::Commands
|
15
15
|
|
16
|
-
attr_accessor :port, :host, :
|
16
|
+
attr_accessor :port, :host, :nick, :on_message
|
17
17
|
|
18
18
|
def connection_completed
|
19
19
|
@reconnecting = false
|
20
20
|
@connected = true
|
21
|
-
_send_command :user, [
|
22
|
-
_send_command :nick,
|
21
|
+
_send_command :user, [@nick] * 4
|
22
|
+
_send_command :nick, @nick
|
23
23
|
succeed
|
24
24
|
end
|
25
25
|
|
data/lib/coffeemaker/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coffeemaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.beta.
|
4
|
+
version: 0.0.1.beta.3
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-10-28 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
16
|
-
requirement: &
|
16
|
+
requirement: &10418680 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.0.beta.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10418680
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &10417340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *10417340
|
36
36
|
description: IRC bot that serves as foundation for greater ideas. "Not Invented Here"
|
37
37
|
applies greatly.
|
38
38
|
email:
|