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.
@@ -12,9 +12,11 @@ module Coffeemaker
12
12
  send_command :part, channel
13
13
  end
14
14
 
15
- def message(recipient, text)
15
+ def privmsg(recipient, text)
16
16
  send_command :privmsg, recipient, ":#{text}"
17
17
  end
18
+
19
+ alias :msg :privmsg
18
20
  end
19
21
  end
20
22
  end
@@ -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
- delegate :join, :part, :privmsg, to: :connection
9
+ attr_accessor :on_message
10
+ delegate :join, :part, :msg, :privmsg, to: :connection
12
11
 
13
12
  def initialize(options)
14
- @host = options.delete(:irc_host)
15
- @port = options.delete(:irc_port)
16
- @callback = options.delete(:on_message)
17
- @options = 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 = @callback
23
+ c.on_message = @on_message
25
24
  c.options = @options
26
- c.callback { succeed }
27
25
  end
28
26
  end
29
27
 
@@ -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.callback do
11
- block.call(@irc) if block_given?
12
- end
12
+ @irc.start
13
+ block.call(@irc) if block_given?
13
14
  end
14
15
 
15
16
  def stop
@@ -1,3 +1,3 @@
1
1
  module Coffeemaker
2
- VERSION = "0.0.1.beta.1"
2
+ VERSION = "0.0.1.beta.2"
3
3
  end
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.1
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: &23452580 !ruby/object:Gem::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: *23452580
24
+ version_requirements: *8603680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &23450520 !ruby/object:Gem::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: *23450520
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: