tjplurk 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tjplurk/robot.rb +1 -1
- data/lib/tjplurk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 809cd942490d3c20c90da820859792308a5aba88
|
4
|
+
data.tar.gz: 40aa76e5852df81ee77b5c4c8e0fc1f287283c7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e1b26fd347ec9d76bdb84353381b0ddc7ef0a75b6ddae10d1601fe693cf24fb963edf5bfab57eca4ea1199692ca230e2ccb31bc162c1909878696c860ce37fe
|
7
|
+
data.tar.gz: 596255b94e06c903d1914441094171266bed85520610053454ae2bf18b470ec768475113d8879d83cd5c6950e9059c2c0f81157660dc2d4d6685ac315e407754
|
data/lib/tjplurk/robot.rb
CHANGED
@@ -7,7 +7,7 @@ module Tjplurk
|
|
7
7
|
def respond input
|
8
8
|
if matched = @topics.each{|topic| topic.pattern = Regexp.new(topic.pattern) if topic.pattern.is_a? String}.select{|topic| topic.pattern.match(input) }.sample
|
9
9
|
response = matched.responses.sample.content
|
10
|
-
input.gsub
|
10
|
+
input.gsub(matched.pattern, response)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/lib/tjplurk/version.rb
CHANGED