balotelli 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/balotelli/base.rb +5 -5
- data/lib/balotelli/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: 15612cf80da241b688e4fc4b1029b58f049756e5
|
4
|
+
data.tar.gz: 74dc6b66092aa791f7a35f9b6e7a74d7d768a40a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d78beaca372105824a6f5893ac216aca69135a1c103dab1eeba0e25fb13fada711c0b511b5c416648f1f6da04bc53b4298e5fc7522666e6da933a8ac055e5b10
|
7
|
+
data.tar.gz: 43aa8f479f162551a8a940f230f53edc5673f762cea2f0e25045db93ed44ccd9c61bf13fc3f41e4b0c6bc88ac95502183a2401d5a4e34f02fffb6af709c059c7
|
data/lib/balotelli/base.rb
CHANGED
@@ -33,7 +33,8 @@ module Balotelli
|
|
33
33
|
|
34
34
|
def get_user_list(channel)
|
35
35
|
self.class.instance_variable_set(:@to_process, :user_list)
|
36
|
-
cv =
|
36
|
+
cv = ConditionVariable.new
|
37
|
+
__CVS__.push cv
|
37
38
|
self.class.names(channel)
|
38
39
|
__MUTEX__.synchronize { cv.wait(__MUTEX__) }
|
39
40
|
__CACHE__[:user_list][channel]
|
@@ -56,7 +57,7 @@ module Balotelli
|
|
56
57
|
|
57
58
|
@modules = {}
|
58
59
|
@cache = Hash.new { |hash, key| hash[key] = {} }
|
59
|
-
@
|
60
|
+
@cvs = []
|
60
61
|
end
|
61
62
|
|
62
63
|
def inherited(subclass)
|
@@ -142,15 +143,14 @@ module Balotelli
|
|
142
143
|
end
|
143
144
|
|
144
145
|
def process_table(string)
|
145
|
-
if @
|
146
|
+
if @cvs.any? && string =~ (regex = Core::Utils.table_regex(@nick))
|
146
147
|
metadata = { channel: $2, message: $3 }
|
147
148
|
users = @cache[@to_process][metadata[:channel]] = metadata[:message]
|
148
149
|
until (str = sgets) =~ /End of \/NAME/i
|
149
150
|
users << " #{str.match(regex).captures.first}"
|
150
151
|
end
|
151
152
|
@cache[@to_process][metadata[:channel]] = users.split(' ')
|
152
|
-
@
|
153
|
-
@to_process = false
|
153
|
+
@cvs.shift.signal
|
154
154
|
end
|
155
155
|
end
|
156
156
|
end
|
data/lib/balotelli/version.rb
CHANGED