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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wires/ircbot.rb +8 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3451cb8200a223c45aa51fcd674345554c2ec47
4
- data.tar.gz: aa94f22a14421cababfb3f95a74a1f67384b81ea
3
+ metadata.gz: c3f7441fa4632e0f4379aa3d1968a7e7611fb250
4
+ data.tar.gz: 495f0c662c86d6de8ee230ea34db294ab63cc1bd
5
5
  SHA512:
6
- metadata.gz: af3e45f3a4e5e49d28282e3d06092f7d5f01703aa087ef8802a41cf173fb39adb056ae7cbf9f9eb1c566d74e4c5ab0715b8666f1e4811864ec6f9218969e35f4
7
- data.tar.gz: 55baabb54c833ca8ff895f7cb373cc4800dfaedaa36abab5c3be0896e91bfcb35a7bf7ca04dfc2d50352920161cb93fd4f480511e14fe593a78b99a9785693cc
6
+ metadata.gz: f7d42b958fa0e7891e4f509e00ab284dbfed721c4ebe9d3fc07e1106d000e408dc93462c7addd7a03f2c5f1d8d04fb6e7eb7eb42a56da69b56659e52269ea5f3
7
+ data.tar.gz: c0838fb986d81e4737ceecfffa32297ff6b9af17f627ee28d1287f9808b68b8215b828f121c47a997c7eec450d04841fbc71e52d01007307570d5efd53ca66e0
@@ -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
- fire_and_wait [message:[
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.0
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-22 00:00:00.000000000 Z
11
+ date: 2013-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wires