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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/em/irc_bot.rb +7 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc0e8210194f4905d8fc09f5cb5ddbb19a044c33
4
- data.tar.gz: e70ab4b0e6ee0c993ad35c241bc1c5844625f3a3
3
+ metadata.gz: 9d841c6d304b7321f1bdc63b3e6363502449b116
4
+ data.tar.gz: 3ce234c84ef9186570f7f81b87d897a727ea7dee
5
5
  SHA512:
6
- metadata.gz: 71303105e43f86de9a9ce120918c7d0b174b06ed6b7a0186eb2204ca7c8a0968b43ddc7f1927a2ec2eded92dac320fc49092cd95ae60cb20b28f75792c992e05
7
- data.tar.gz: 5f3225728d5b6b574c1bc0d2f7668e00a3f4d53fd22cafea865a4f945f95c8911e4749ccd1f6f3a979a74736845443dc8c714a2a4c4e692d28a3f6fcf79a0f14
6
+ metadata.gz: 8d5ad6eed71aaf344e6e04dda58da2e711822a67f45bd220f87ead9fdfbb0f069f5d7ff65ed5f3cf35f0d7e2a6a1b978b18478ed9f0a508a913d5ccda7cbea25
7
+ data.tar.gz: 79bef0942419f4f52b36f3f1616f95f74ac0cff954983a9d71a0ee5ebb07dfd212d87dc797ca18ac8f0515992e48ec348493295315152f0977303b44b44d1ea7
@@ -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 |match, blk|
315
- blk.call(msg) if match =~ message
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.1
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-22 00:00:00.000000000 Z
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