omnibot 0.0.4 → 0.0.5

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.
@@ -47,12 +47,14 @@ module OmniBot
47
47
  end
48
48
 
49
49
  def on_generic_exception_handler e
50
- if e && (e.kind_of?(Jabber::ServerDisconnected) || e.class.to_s =~ /^Errno::.+/)
50
+ if e && (e.kind_of?(Jabber::ServerDisconnected) || e.class.to_s =~ /^Errno::.+/ || e.kind_of?(SocketError))
51
51
  OmniLog::error "No timer provider assigned" unless @timer_provider
52
52
  # attempt counter is set when it's needed to connect
53
53
  unless @ignore_reconnect
54
54
  @timer_provider.add_timer(@reconnect_pause) { try_reconnect }
55
55
  end
56
+ else
57
+ OmniLog::warn "Ignoring error #{e}"
56
58
  end
57
59
  end
58
60
 
@@ -115,7 +117,7 @@ module OmniBot
115
117
  elsif amount < 60*60
116
118
  return "less than a hour ago"
117
119
  elsif amount < 60*60*6
118
- return amount.div(60).to_s + " hours ago"
120
+ return amount.div(3600).to_s + " hours ago"
119
121
  end
120
122
  end
121
123
  return orig.to_s
@@ -1,3 +1,3 @@
1
1
  module OmniBot
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
data/lib/omnibot.rb CHANGED
@@ -7,6 +7,7 @@ require 'eventmachine'
7
7
  require 'xmpp4r'
8
8
  require 'xmpp4r/client'
9
9
  require 'xmpp4r/roster'
10
+ require 'socket'
10
11
 
11
12
  %w[ helpers jabberbot amqpconsumer omnisend launcher periodiccommand ].each do |file|
12
13
  require "omnibot/#{file}.rb"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibot
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - theirix
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-11 00:00:00 +03:00
18
+ date: 2011-01-25 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency