em-irc-bot 0.0.1 → 0.1.0
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.
- checksums.yaml +4 -4
- data/lib/em/irc_bot.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d841c6d304b7321f1bdc63b3e6363502449b116
|
4
|
+
data.tar.gz: 3ce234c84ef9186570f7f81b87d897a727ea7dee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d5ad6eed71aaf344e6e04dda58da2e711822a67f45bd220f87ead9fdfbb0f069f5d7ff65ed5f3cf35f0d7e2a6a1b978b18478ed9f0a508a913d5ccda7cbea25
|
7
|
+
data.tar.gz: 79bef0942419f4f52b36f3f1616f95f74ac0cff954983a9d71a0ee5ebb07dfd212d87dc797ca18ac8f0515992e48ec348493295315152f0977303b44b44d1ea7
|
data/lib/em/irc_bot.rb
CHANGED
@@ -150,6 +150,9 @@ class EM::IrcBot
|
|
150
150
|
# as well as information about the sender, and has some convenience
|
151
151
|
# methods for easily replying.
|
152
152
|
#
|
153
|
+
# @yieldparam [String] Any captured subexpressions in `match` will be
|
154
|
+
# passed as additional arguments to the callback.
|
155
|
+
#
|
153
156
|
# @return void
|
154
157
|
#
|
155
158
|
def listen_for(match, opts = {}, &blk)
|
@@ -311,8 +314,10 @@ class EM::IrcBot
|
|
311
314
|
|
312
315
|
msg = EM::IrcBot::Message.new(self, source, sender, message)
|
313
316
|
|
314
|
-
@privmsg_handlers.each_pair do |
|
315
|
-
|
317
|
+
@privmsg_handlers.each_pair do |re, blk|
|
318
|
+
if (matchdata = message.match(re)
|
319
|
+
blk.call(msg, *(matchdata[1..-1]))
|
320
|
+
end
|
316
321
|
end
|
317
322
|
end
|
318
323
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: em-irc-bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git-version-bump
|