moonbot 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/MoonBot/bot.rb CHANGED
@@ -11,10 +11,7 @@ module MoonBot
11
11
 
12
12
  def start
13
13
  EventMachine.run do
14
- @client = EventMachine.connect @host, @port, Client, Proc.new do |message|
15
- message = message.split("\r\n")
16
- message.each do {|m| self.handle m}
17
- end
14
+ @client = EventMachine.connect @host, @port, Client, Proc.new {|m| handle m}
18
15
  end
19
16
  end
20
17
 
@@ -32,7 +29,7 @@ module MoonBot
32
29
  end
33
30
 
34
31
  def command message
35
- self.client.send_data(message + '\r\n')
32
+ self.client.send_data(message + "\r\n")
36
33
  end
37
34
 
38
35
  end
@@ -16,9 +16,10 @@ module MoonBot::Plugin
16
16
 
17
17
  def send_auth
18
18
  puts "Sending User Data"
19
- auth = "NICK #{@nick}\r\n"
20
- auth += "USER #{@login} 8 * : #{@name}\r\n"
21
- @bot.client.send_data auth
19
+ nick = "NICK #{@nick}"
20
+ user = "USER #{@login} 8 * : #{@name}"
21
+ @bot.command nick
22
+ @bot.command user
22
23
  end
23
24
  end
24
25
  end
@@ -6,7 +6,7 @@ module MoonBot::Plugin
6
6
 
7
7
  def on_ping message
8
8
  pong = "PONG #{message[:args]}"
9
- @bot.client.send_data pong
9
+ @bot.command pong
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module MoonBot
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moonbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
16
- requirement: &70287282711580 !ruby/object:Gem::Requirement
16
+ requirement: &70138858589920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70287282711580
24
+ version_requirements: *70138858589920
25
25
  description: Amazingly simple IRC bot that handles everything via plugins with the
26
26
  exception of connecting.
27
27
  email: