cinch 2.0.0.pre.6 → 2.0.0.pre.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,5 +37,10 @@ module Cinch
37
37
  # Error stating that an invalid mode string was encountered.
38
38
  class InvalidModeString < Generic
39
39
  end
40
+
41
+ # Raised when a synced attribute hasn't been available for too
42
+ # long.
43
+ class SyncedAttributeNotAvailable < Generic
44
+ end
40
45
  end
41
46
  end
@@ -13,9 +13,13 @@ module Cinch
13
13
  waited += 1
14
14
 
15
15
  if waited % 100 == 0
16
- # TODO improve this message
17
- bot.loggers.warn "A synced attribute ('%s') has not been available for %d seconds, still waiting" % [attr, waited / 10]
16
+ bot.loggers.warn "A synced attribute ('%s' for %s) has not been available for %d seconds, still waiting" % [attr, self.inspect, waited / 10]
18
17
  bot.loggers.warn caller.map {|s| " #{s}"}
18
+
19
+ if waited / 10 >= 30
20
+ bot.loggers.warn " Giving up..."
21
+ raise Exceptions::SyncedAttributeNotAvailable, "'%s' for %s" % [attr, self.inspect]
22
+ end
19
23
  end
20
24
  sleep 0.1
21
25
  end
data/lib/cinch/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Cinch
2
2
  # Version of the library
3
- VERSION = '2.0.0-pre.6'
3
+ VERSION = '2.0.0-pre.7'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.6
4
+ version: 2.0.0.pre.7
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-11 00:00:00.000000000 Z
12
+ date: 2012-03-17 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A simple, friendly DSL for creating IRC bots
15
15
  email: