mongrel2 0.17.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,11 @@
1
+ == v0.18.0 [2012-03-28] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Make the 'handler' DSL directive replace any existing handler with
4
+ its send_ident.
5
+ - Add a validation to ensure that handler configs have unique send/recv
6
+ specs and IDs.
7
+
8
+
1
9
  == v0.17.0 [2012-03-18] Michael Granger <ged@FaerieMUD.org>
2
10
 
3
11
  - Squelch logging of expected SQL errors.
@@ -14,10 +14,10 @@ module Mongrel2
14
14
  abort "\n\n>>> Mongrel2 requires Ruby 1.9.2 or later. <<<\n\n" if RUBY_VERSION < '1.9.2'
15
15
 
16
16
  # Library version constant
17
- VERSION = '0.17.0'
17
+ VERSION = '0.18.0'
18
18
 
19
19
  # Version-control revision constant
20
- REVISION = %q$Revision: 023114cc92af $
20
+ REVISION = %q$Revision: 1d4e3af69f25 $
21
21
 
22
22
 
23
23
  require 'mongrel2/logging'
@@ -8,7 +8,7 @@ class Mongrel2::Config::Handler < Mongrel2::Config( :handler )
8
8
 
9
9
  ### As of Mongrel2/1.7.5:
10
10
  # CREATE TABLE handler (id INTEGER PRIMARY KEY,
11
- # send_spec TEXT,
11
+ # send_spec TEXT,
12
12
  # send_ident TEXT,
13
13
  # recv_spec TEXT,
14
14
  # recv_ident TEXT,
@@ -31,7 +31,7 @@ class Mongrel2::Config::Handler < Mongrel2::Config( :handler )
31
31
 
32
32
  ##
33
33
  # :method: by_send_ident( uuid )
34
- #
34
+ #
35
35
  # Look up a Handler by its send_ident, which should be a +uuid+ or similar String.
36
36
  def_dataset_method( :by_send_ident ) do |ident|
37
37
  filter( :send_ident => ident )
@@ -43,6 +43,7 @@ class Mongrel2::Config::Handler < Mongrel2::Config( :handler )
43
43
  self.validate_idents
44
44
  self.validate_specs
45
45
  self.validate_protocol
46
+ self.validate_uniqueness
46
47
  end
47
48
 
48
49
 
@@ -103,6 +104,11 @@ class Mongrel2::Config::Handler < Mongrel2::Config( :handler )
103
104
  end
104
105
 
105
106
 
107
+ ### Ensure that handlers are unique.
108
+ def validate_uniqueness
109
+ self.validates_unique( :send_ident, :send_spec, :recv_spec )
110
+ end
111
+
106
112
 
107
113
  #######
108
114
  private
@@ -85,6 +85,12 @@ class Mongrel2::Config::Host < Mongrel2::Config( :host )
85
85
  :recv_ident => recv_ident
86
86
  )
87
87
 
88
+ existing = Mongrel2::Config::Handler.filter( :send_ident => send_ident )
89
+ unless existing.select( :id ).empty?
90
+ Mongrel2.log.debug "Dropping existing %p handler." % [ send_ident ]
91
+ existing.delete
92
+ end
93
+
88
94
  Mongrel2.log.debug "Creating handler with options: %p" % [ options ]
89
95
  return Mongrel2::Config::Handler.create( options )
90
96
  end
@@ -114,5 +114,14 @@ describe Mongrel2::Config::Handler do
114
114
  @handler.errors.full_messages.first.should =~ /invalid/i
115
115
  end
116
116
 
117
+ it "isn't valid if its send_spec isn't unique" do
118
+ dup = @handler.dup
119
+ @handler.save
120
+
121
+ expect {
122
+ dup.save
123
+ }.to raise_error( Sequel::ValidationFailed, /is already taken/ )
124
+ end
125
+
117
126
  end
118
127
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongrel2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,11 +36,11 @@ cert_chain:
36
36
  YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
37
37
  Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
38
38
  cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
- date: 2012-03-18 00:00:00.000000000 Z
39
+ date: 2012-03-28 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
- requirement: &70107726149280 !ruby/object:Gem::Requirement
43
+ requirement: &70218596769940 !ruby/object:Gem::Requirement
44
44
  none: false
45
45
  requirements:
46
46
  - - ~>
@@ -48,10 +48,10 @@ dependencies:
48
48
  version: '1.5'
49
49
  type: :runtime
50
50
  prerelease: false
51
- version_requirements: *70107726149280
51
+ version_requirements: *70218596769940
52
52
  - !ruby/object:Gem::Dependency
53
53
  name: sequel
54
- requirement: &70107726148340 !ruby/object:Gem::Requirement
54
+ requirement: &70218596783860 !ruby/object:Gem::Requirement
55
55
  none: false
56
56
  requirements:
57
57
  - - ~>
@@ -59,10 +59,10 @@ dependencies:
59
59
  version: '3.31'
60
60
  type: :runtime
61
61
  prerelease: false
62
- version_requirements: *70107726148340
62
+ version_requirements: *70218596783860
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: amalgalite
65
- requirement: &70107726147900 !ruby/object:Gem::Requirement
65
+ requirement: &70218596781900 !ruby/object:Gem::Requirement
66
66
  none: false
67
67
  requirements:
68
68
  - - ~>
@@ -70,10 +70,10 @@ dependencies:
70
70
  version: '1.1'
71
71
  type: :runtime
72
72
  prerelease: false
73
- version_requirements: *70107726147900
73
+ version_requirements: *70218596781900
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: tnetstring
76
- requirement: &70107726147460 !ruby/object:Gem::Requirement
76
+ requirement: &70218596779800 !ruby/object:Gem::Requirement
77
77
  none: false
78
78
  requirements:
79
79
  - - ~>
@@ -81,10 +81,10 @@ dependencies:
81
81
  version: '0.3'
82
82
  type: :runtime
83
83
  prerelease: false
84
- version_requirements: *70107726147460
84
+ version_requirements: *70218596779800
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: yajl-ruby
87
- requirement: &70107726147020 !ruby/object:Gem::Requirement
87
+ requirement: &70218596793520 !ruby/object:Gem::Requirement
88
88
  none: false
89
89
  requirements:
90
90
  - - ~>
@@ -92,10 +92,10 @@ dependencies:
92
92
  version: '1.0'
93
93
  type: :runtime
94
94
  prerelease: false
95
- version_requirements: *70107726147020
95
+ version_requirements: *70218596793520
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: trollop
98
- requirement: &70107726146580 !ruby/object:Gem::Requirement
98
+ requirement: &70218596792320 !ruby/object:Gem::Requirement
99
99
  none: false
100
100
  requirements:
101
101
  - - ~>
@@ -103,10 +103,10 @@ dependencies:
103
103
  version: '1.16'
104
104
  type: :runtime
105
105
  prerelease: false
106
- version_requirements: *70107726146580
106
+ version_requirements: *70218596792320
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: sysexits
109
- requirement: &70107726146140 !ruby/object:Gem::Requirement
109
+ requirement: &70218596790980 !ruby/object:Gem::Requirement
110
110
  none: false
111
111
  requirements:
112
112
  - - ~>
@@ -114,10 +114,10 @@ dependencies:
114
114
  version: '1.0'
115
115
  type: :runtime
116
116
  prerelease: false
117
- version_requirements: *70107726146140
117
+ version_requirements: *70218596790980
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: zmq
120
- requirement: &70107726145700 !ruby/object:Gem::Requirement
120
+ requirement: &70218596790100 !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements:
123
123
  - - ~>
@@ -125,10 +125,10 @@ dependencies:
125
125
  version: 2.1.4
126
126
  type: :runtime
127
127
  prerelease: false
128
- version_requirements: *70107726145700
128
+ version_requirements: *70218596790100
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: hoe-mercurial
131
- requirement: &70107726145260 !ruby/object:Gem::Requirement
131
+ requirement: &70218596788920 !ruby/object:Gem::Requirement
132
132
  none: false
133
133
  requirements:
134
134
  - - ~>
@@ -136,10 +136,10 @@ dependencies:
136
136
  version: 1.3.1
137
137
  type: :development
138
138
  prerelease: false
139
- version_requirements: *70107726145260
139
+ version_requirements: *70218596788920
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: hoe-highline
142
- requirement: &70107726144780 !ruby/object:Gem::Requirement
142
+ requirement: &70218596786520 !ruby/object:Gem::Requirement
143
143
  none: false
144
144
  requirements:
145
145
  - - ~>
@@ -147,10 +147,10 @@ dependencies:
147
147
  version: 0.0.1
148
148
  type: :development
149
149
  prerelease: false
150
- version_requirements: *70107726144780
150
+ version_requirements: *70218596786520
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: configurability
153
- requirement: &70107726144300 !ruby/object:Gem::Requirement
153
+ requirement: &70218596801420 !ruby/object:Gem::Requirement
154
154
  none: false
155
155
  requirements:
156
156
  - - ~>
@@ -158,10 +158,10 @@ dependencies:
158
158
  version: '1.0'
159
159
  type: :development
160
160
  prerelease: false
161
- version_requirements: *70107726144300
161
+ version_requirements: *70218596801420
162
162
  - !ruby/object:Gem::Dependency
163
163
  name: simplecov
164
- requirement: &70107726143860 !ruby/object:Gem::Requirement
164
+ requirement: &70218596799960 !ruby/object:Gem::Requirement
165
165
  none: false
166
166
  requirements:
167
167
  - - ~>
@@ -169,10 +169,10 @@ dependencies:
169
169
  version: '0.6'
170
170
  type: :development
171
171
  prerelease: false
172
- version_requirements: *70107726143860
172
+ version_requirements: *70218596799960
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: rspec
175
- requirement: &70107726143420 !ruby/object:Gem::Requirement
175
+ requirement: &70218596798800 !ruby/object:Gem::Requirement
176
176
  none: false
177
177
  requirements:
178
178
  - - ~>
@@ -180,10 +180,10 @@ dependencies:
180
180
  version: '2.8'
181
181
  type: :development
182
182
  prerelease: false
183
- version_requirements: *70107726143420
183
+ version_requirements: *70218596798800
184
184
  - !ruby/object:Gem::Dependency
185
185
  name: rdoc
186
- requirement: &70107726142980 !ruby/object:Gem::Requirement
186
+ requirement: &70218596797920 !ruby/object:Gem::Requirement
187
187
  none: false
188
188
  requirements:
189
189
  - - ~>
@@ -191,10 +191,10 @@ dependencies:
191
191
  version: '3.10'
192
192
  type: :development
193
193
  prerelease: false
194
- version_requirements: *70107726142980
194
+ version_requirements: *70218596797920
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: hoe
197
- requirement: &70107726142540 !ruby/object:Gem::Requirement
197
+ requirement: &70218596797120 !ruby/object:Gem::Requirement
198
198
  none: false
199
199
  requirements:
200
200
  - - ~>
@@ -202,7 +202,7 @@ dependencies:
202
202
  version: '2.16'
203
203
  type: :development
204
204
  prerelease: false
205
- version_requirements: *70107726142540
205
+ version_requirements: *70218596797120
206
206
  description: ! 'Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for
207
207
 
208
208
  Mongrel2[http://mongrel2.org/].
metadata.gz.sig CHANGED
Binary file