cinch-yaml-keywords 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -54,9 +54,13 @@ module Cinch
54
54
  end
55
55
 
56
56
  def find_keyword(m)
57
- if keyword = @keywords.keys.find{|k| Regexp.new(k).match(m.message) }
58
- then m.reply @keywords[keyword]
59
- end
57
+ @keywords.keys.map{|keyword|
58
+ Regexp.new(keyword).match(m.message)
59
+ }.compact.sort_by{|matchdata|
60
+ matchdata.begin(0)
61
+ }.each{|matchdata|
62
+ m.reply @keywords[matchdata[0]]
63
+ }
60
64
  end
61
65
 
62
66
  listen_to :channel
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-yaml-keywords
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: