coffeemaker 0.0.1.beta.1 → 0.0.1.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/coffeemaker/bot/irc.rb
CHANGED
@@ -5,25 +5,23 @@ require 'active_support/core_ext/module/delegation'
|
|
5
5
|
module Coffeemaker
|
6
6
|
class Bot
|
7
7
|
class Irc
|
8
|
-
include EM::Deferrable
|
9
|
-
|
10
8
|
attr_reader :connection
|
11
|
-
|
9
|
+
attr_accessor :on_message
|
10
|
+
delegate :join, :part, :msg, :privmsg, to: :connection
|
12
11
|
|
13
12
|
def initialize(options)
|
14
|
-
@host
|
15
|
-
@port
|
16
|
-
@
|
17
|
-
@options
|
13
|
+
@host = options.delete(:irc_host)
|
14
|
+
@port = options.delete(:irc_port)
|
15
|
+
@on_message = options.delete(:on_message)
|
16
|
+
@options = options
|
18
17
|
end
|
19
18
|
|
20
19
|
def start
|
21
20
|
@connection = EM.connect(@host, @port, Connection) do |c|
|
22
21
|
c.host = @host
|
23
22
|
c.port = @port
|
24
|
-
c.on_message = @
|
23
|
+
c.on_message = @on_message
|
25
24
|
c.options = @options
|
26
|
-
c.callback { succeed }
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
data/lib/coffeemaker/bot.rb
CHANGED
@@ -2,14 +2,15 @@ require 'coffeemaker/bot/irc'
|
|
2
2
|
|
3
3
|
module Coffeemaker
|
4
4
|
class Bot
|
5
|
+
attr_reader :irc
|
6
|
+
|
5
7
|
def initialize(options)
|
6
8
|
@irc = Irc.new(options)
|
7
9
|
end
|
8
10
|
|
9
11
|
def start(&block)
|
10
|
-
@irc.start
|
11
|
-
|
12
|
-
end
|
12
|
+
@irc.start
|
13
|
+
block.call(@irc) if block_given?
|
13
14
|
end
|
14
15
|
|
15
16
|
def stop
|
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.2
|
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: &8603680 !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: *8603680
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &8602360 !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: *8602360
|
36
36
|
description: IRC bot that serves as foundation for greater ideas. "Not Invented Here"
|
37
37
|
applies greatly.
|
38
38
|
email:
|