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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef5944b434681720612e6b79a001c885b928a50b
4
- data.tar.gz: ec61338aa00b866af4c6e5cade4520e35c785645
3
+ metadata.gz: 15612cf80da241b688e4fc4b1029b58f049756e5
4
+ data.tar.gz: 74dc6b66092aa791f7a35f9b6e7a74d7d768a40a
5
5
  SHA512:
6
- metadata.gz: d64ae0e8f82f218a71f8e1ae876baa8ce54b15a6f88dd90adb0bd13de188ebdafb7bbe774622e2b1efe0aa34da4cfa8fb6a38bb433c0419dca80502543f80bc7
7
- data.tar.gz: babff7f3371a6a7838f9d3c28ae21b1e9399b6acf1dcdbd279871982407789b430ad7c49b76cc8921d6bc5cbb6e8f6b3a02f7fc005e999a1e73f4394be7bdd3e
6
+ metadata.gz: d78beaca372105824a6f5893ac216aca69135a1c103dab1eeba0e25fb13fada711c0b511b5c416648f1f6da04bc53b4298e5fc7522666e6da933a8ac055e5b10
7
+ data.tar.gz: 43aa8f479f162551a8a940f230f53edc5673f762cea2f0e25045db93ed44ccd9c61bf13fc3f41e4b0c6bc88ac95502183a2401d5a4e34f02fffb6af709c059c7
@@ -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 = self.class.instance_variable_set(:@condition_variable, ConditionVariable.new)
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
- @mutex = Mutex.new
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 @to_process && string =~ (regex = Core::Utils.table_regex(@nick))
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
- @condition_variable.signal
153
- @to_process = false
153
+ @cvs.shift.signal
154
154
  end
155
155
  end
156
156
  end
@@ -1,3 +1,3 @@
1
1
  module Balotelli
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balotelli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Henryk Bartkowiak