hector 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,7 @@ module Hector
28
28
  end
29
29
 
30
30
  def normalize(name)
31
- if name =~ /^#\w[\w-]{0,15}$/u
31
+ if name =~ /^#[\p{L}\p{M}\p{N}\p{So}\p{Co}\w][\p{L}\p{M}\p{N}\p{So}\p{Co}\p{Pd}\p{Pc}\w-]{0,15}$/u
32
32
  name.downcase
33
33
  else
34
34
  raise NoSuchChannel, name
@@ -15,7 +15,7 @@ module Hector
15
15
  def respond_to_whois_for(destination, session)
16
16
  respond_with("301", session.nickname, :text => session.away_message) if session.away?
17
17
  respond_with("311", destination, session.nickname, session.whois)
18
- respond_with("319", destination, session.nickname, :text => channels.map { |channel| channel.name }.join(" ")) unless channels.empty?
18
+ respond_with("319", destination, session.nickname, :text => session.channels.map { |channel| channel.name }.join(" ")) unless session.channels.empty?
19
19
  respond_with("312", destination, session.nickname, Hector.server_name, :text => "Hector")
20
20
  respond_with("317", destination, session.nickname, session.seconds_idle, session.created_at, :text => "seconds idle, signon time")
21
21
  end
@@ -6,10 +6,10 @@ module Hector
6
6
  class << self
7
7
  def apportion_text(args, *base_args)
8
8
  base_response = Response.new(*base_args)
9
- max_length = 510 - base_response.to_s.length
9
+ max_length = 510 - base_response.to_s.bytesize
10
10
 
11
11
  args.inject([args.shift.dup]) do |texts, arg|
12
- if texts.last.length + arg.length + 1 >= max_length
12
+ if texts.last.bytesize + arg.bytesize + 1 >= max_length
13
13
  texts << arg.dup
14
14
  else
15
15
  texts.last << " " << arg
@@ -59,7 +59,7 @@ module Hector
59
59
  end
60
60
 
61
61
  def normalize(nickname)
62
- if nickname =~ /^\w[\w-]{0,15}$/u
62
+ if nickname =~ /^[\p{L}\p{M}\p{N}\p{So}\p{Co}\w][\p{L}\p{M}\p{N}\p{So}\p{Co}\p{P}\w-]{0,15}$/u
63
63
  nickname.downcase
64
64
  else
65
65
  raise ErroneousNickname, nickname
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hector
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 0
9
- - 1
10
- version: 1.0.1
4
+ prerelease:
5
+ version: 1.0.2
11
6
  platform: ruby
12
7
  authors:
13
8
  - Sam Stephenson
@@ -15,7 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-01-23 00:00:00 -06:00
13
+ date: 2011-03-05 00:00:00 -06:00
19
14
  default_executable:
20
15
  dependencies:
21
16
  - !ruby/object:Gem::Dependency
@@ -26,11 +21,6 @@ dependencies:
26
21
  requirements:
27
22
  - - ">="
28
23
  - !ruby/object:Gem::Version
29
- hash: 59
30
- segments:
31
- - 0
32
- - 12
33
- - 10
34
24
  version: 0.12.10
35
25
  type: :runtime
36
26
  version_requirements: *id001
@@ -42,11 +32,6 @@ dependencies:
42
32
  requirements:
43
33
  - - ">="
44
34
  - !ruby/object:Gem::Version
45
- hash: 41
46
- segments:
47
- - 0
48
- - 9
49
- - 9
50
35
  version: 0.9.9
51
36
  type: :development
52
37
  version_requirements: *id002
@@ -116,23 +101,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
101
  requirements:
117
102
  - - ">="
118
103
  - !ruby/object:Gem::Version
119
- hash: 3
120
- segments:
121
- - 0
122
104
  version: "0"
123
105
  required_rubygems_version: !ruby/object:Gem::Requirement
124
106
  none: false
125
107
  requirements:
126
108
  - - ">="
127
109
  - !ruby/object:Gem::Version
128
- hash: 3
129
- segments:
130
- - 0
131
110
  version: "0"
132
111
  requirements: []
133
112
 
134
113
  rubyforge_project:
135
- rubygems_version: 1.3.7
114
+ rubygems_version: 1.5.0
136
115
  signing_key:
137
116
  specification_version: 3
138
117
  summary: Private group chat server