percy 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +1 -1
  2. data/VERSION +1 -1
  3. data/lib/percy.rb +6 -4
  4. metadata +2 -2
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Percy 1.2.0
1
+ # Percy 1.2.1
2
2
 
3
3
  ## Configuring and starting the bot
4
4
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
data/lib/percy.rb CHANGED
@@ -42,7 +42,7 @@ class Percy
42
42
  attr_accessor :traffic_logger, :connected
43
43
  end
44
44
 
45
- VERSION = 'Percy 1.2.0 (http://github.com/tbuehlmann/percy)'
45
+ VERSION = 'Percy 1.2.1 (http://github.com/tbuehlmann/percy)'
46
46
 
47
47
  Config = Struct.new(:server, :port, :password, :nick, :username, :verbose, :logging, :reconnect, :reconnect_interval)
48
48
 
@@ -220,10 +220,11 @@ class Percy
220
220
  Timeout::timeout(10) do # try 10 seconds to retrieve l mode of <channel>
221
221
  start = actual_length
222
222
  ending = @temp_socket.length
223
+ channel = Regexp.escape(channel)
223
224
 
224
225
  loop do
225
226
  for line in start..ending do
226
- if @temp_socket[line] =~ /^:\S+ 324 \S+ #{Regexp.escape(channel)} .*l.* (\d+)/
227
+ if @temp_socket[line] =~ /^:\S+ 324 \S+ #{channel} .*l.* (\d+)/
227
228
  return $1.to_i
228
229
  end
229
230
  end
@@ -249,12 +250,13 @@ class Percy
249
250
  Timeout::timeout(10) do
250
251
  start = actual_length
251
252
  ending = @temp_socket.length
253
+ nick = Regexp.escape(nick)
252
254
 
253
255
  loop do
254
256
  for line in start..ending do
255
- if @temp_socket[line] =~ /^:\S+ 311 \S+ (#{Regexp.escape(nick)}) /i
257
+ if @temp_socket[line] =~ /^:\S+ 311 \S+ (#{nick}) /i
256
258
  return $1
257
- elsif line =~ /^:\S+ 401 \S+ #{Regexp.escape(nick)} /i
259
+ elsif @temp_socket[line] =~ /^:\S+ 401 \S+ #{nick} /i
258
260
  return false
259
261
  end
260
262
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Tobias B\xC3\xBChlmann"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-05 00:00:00 +01:00
12
+ date: 2010-01-20 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency