jabber-bot 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +3 -0
- data/README +1 -1
- data/lib/jabber/bot.rb +6 -5
- metadata +3 -3
data/HISTORY
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
Jabber::Bot Release History
|
2
2
|
|
3
|
+
Version 1.1.1 (26 May 2007)
|
4
|
+
* Minor change to the listener thread that should improve CPU usage.
|
5
|
+
|
3
6
|
Version 1.1.0 (24 March 2007)
|
4
7
|
* Supports Jabber presence, status message and priority.
|
5
8
|
* Built-in 'help' command now accepts an optional <command> argument.
|
data/README
CHANGED
@@ -8,7 +8,7 @@ bot's repertoire, you and your new bot will be able to accomplish nearly
|
|
8
8
|
anything.
|
9
9
|
|
10
10
|
Author:: Brett Stimmerman (mailto:brettstimmerman@gmail.com)
|
11
|
-
Version:: 1.1.
|
11
|
+
Version:: 1.1.1
|
12
12
|
Copyright:: Copyright (c) 2007 Brett Stimmerman. All rights reserved.
|
13
13
|
License:: New BSD License (http://opensource.org/licenses/bsd-license.php)
|
14
14
|
Website:: http://socket7.net/software/jabber-bot
|
data/lib/jabber/bot.rb
CHANGED
@@ -38,7 +38,7 @@ module Jabber
|
|
38
38
|
# repertoire, you and your new bot will be able to accomplish nearly anything.
|
39
39
|
#
|
40
40
|
# Author:: Brett Stimmerman (mailto:brettstimmerman@gmail.com)
|
41
|
-
# Version:: 1.1.
|
41
|
+
# Version:: 1.1.1
|
42
42
|
# Copyright:: Copyright (c) 2007 Brett Stimmerman. All rights reserved.
|
43
43
|
# License:: New BSD License (http://opensource.org/licenses/bsd-license.php)
|
44
44
|
# Website:: http://socket7.net/software/jabber-bot
|
@@ -309,12 +309,10 @@ module Jabber
|
|
309
309
|
# Extract the command name from the given syntax
|
310
310
|
def command_name(syntax) #:nodoc:
|
311
311
|
if syntax.include? ' '
|
312
|
-
|
312
|
+
syntax.sub(/^(\S+).*/, '\1')
|
313
313
|
else
|
314
|
-
|
314
|
+
syntax
|
315
315
|
end
|
316
|
-
|
317
|
-
name
|
318
316
|
end
|
319
317
|
|
320
318
|
# Returns the default help message describing the bot's command repertoire.
|
@@ -374,6 +372,7 @@ module Jabber
|
|
374
372
|
|
375
373
|
response = command[:callback].call(sender, params)
|
376
374
|
deliver(sender, response) unless response.nil?
|
375
|
+
|
377
376
|
return
|
378
377
|
end
|
379
378
|
end
|
@@ -396,6 +395,7 @@ module Jabber
|
|
396
395
|
def start_listener_thread #:nodoc:
|
397
396
|
listener_thread = Thread.new do
|
398
397
|
loop do
|
398
|
+
if @jabber.received_messages?
|
399
399
|
@jabber.received_messages do |message|
|
400
400
|
# Remove the Jabber resourse, if any
|
401
401
|
sender = message.from.to_s.sub(/\/.+$/, '')
|
@@ -408,6 +408,7 @@ module Jabber
|
|
408
408
|
parse_thread.join
|
409
409
|
end
|
410
410
|
end
|
411
|
+
end
|
411
412
|
|
412
413
|
sleep 1
|
413
414
|
end
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: jabber-bot
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.1.
|
7
|
-
date: 2007-
|
6
|
+
version: 1.1.1
|
7
|
+
date: 2007-05-26 00:00:00 -07:00
|
8
8
|
summary: Jabber::Bot makes it simple to create and command your own Jabber bot with little fuss. By adding custom commands powered by regular expressions to your bot's repertoire, you and your new bot will be able to accomplish nearly anything.
|
9
9
|
require_paths:
|
10
10
|
- lib
|