wires-ircbot 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wires/ircbot.rb +8 -1
- 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: c3f7441fa4632e0f4379aa3d1968a7e7611fb250
|
4
|
+
data.tar.gz: 495f0c662c86d6de8ee230ea34db294ab63cc1bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7d42b958fa0e7891e4f509e00ab284dbfed721c4ebe9d3fc07e1106d000e408dc93462c7addd7a03f2c5f1d8d04fb6e7eb7eb42a56da69b56659e52269ea5f3
|
7
|
+
data.tar.gz: c0838fb986d81e4737ceecfffa32297ff6b9af17f627ee28d1287f9808b68b8215b828f121c47a997c7eec450d04841fbc71e52d01007307570d5efd53ca66e0
|
data/lib/wires/ircbot.rb
CHANGED
@@ -15,6 +15,7 @@ module IRC
|
|
15
15
|
class Bot
|
16
16
|
|
17
17
|
def initialize(**kwargs, &block)
|
18
|
+
@rescue_exceptions = true
|
18
19
|
kwargs.each_pair { |k,v| instance_variable_set("@#{k}",v) }
|
19
20
|
instance_eval &block
|
20
21
|
init_handlers
|
@@ -39,11 +40,17 @@ module IRC
|
|
39
40
|
user @nick, 0, '*', (@realname or @nick)
|
40
41
|
|
41
42
|
while (m = @socket.gets.match /^((?::(.+?) )?(\w+) (.*?)\r\n)$/)
|
42
|
-
|
43
|
+
begin
|
44
|
+
fire_and_wait [message:[
|
43
45
|
*(m[4].split ' '),
|
44
46
|
string: m[1].rstrip,
|
45
47
|
prefix: m[2],
|
46
48
|
command: m[3]]]
|
49
|
+
rescue Exception => ex;
|
50
|
+
raise unless @rescue_exceptions
|
51
|
+
puts ex.backtrace
|
52
|
+
puts "#{ex.message} (#{ex.class})"
|
53
|
+
end
|
47
54
|
end
|
48
55
|
end
|
49
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wires-ircbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe McIlvain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wires
|