mongrel2 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -214,5 +214,32 @@ describe Mongrel2::Config::DSL do
214
214
 
215
215
  end
216
216
 
217
+ describe 'filters' do
218
+
219
+ it "can add a filter to a server" do
220
+ result = server '965A7196-99BC-46FA-945B-3478AE92BFB5' do
221
+ filter '/usr/lib/mongrel2/null.so'
222
+ end
223
+
224
+ result.filters.should have( 1 ).member
225
+ result.filters.first.should be_a( Mongrel2::Config::Filter )
226
+ result.filters.first.settings.should == {}
227
+ end
228
+
229
+ it "can add a filter with settings to a server" do
230
+ result = server '965A7196-99BC-46FA-945B-3478AE92BFB5' do
231
+ filter '/usr/lib/mongrel2/null.so',
232
+ extensions: ["*.html", "*.txt"],
233
+ min_size: 1000
234
+ end
235
+
236
+ result.filters.should have( 1 ).member
237
+ result.filters.first.should be_a( Mongrel2::Config::Filter )
238
+ result.filters.first.settings.should ==
239
+ { 'extensions' => ["*.html", "*.txt"], 'min_size' => 1000 }
240
+ end
241
+
242
+ end
243
+
217
244
  end
218
245
 
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ BEGIN {
4
+ require 'pathname'
5
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent.parent
6
+
7
+ libdir = basedir + "lib"
8
+
9
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
10
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
11
+ }
12
+
13
+ require 'rspec'
14
+
15
+ require 'spec/lib/helpers'
16
+
17
+ require 'mongrel2'
18
+ require 'mongrel2/config'
19
+
20
+
21
+ #####################################################################
22
+ ### C O N T E X T S
23
+ #####################################################################
24
+
25
+ describe Mongrel2::Config::Filter do
26
+
27
+ # No functionality outside of Sequel::Model's purview yet
28
+
29
+ end
30
+
@@ -40,7 +40,7 @@ describe Mongrel2::Config::Route do
40
40
 
41
41
  it "returns a Mongrel2::Config::Directory if its target_type is 'dir'" do
42
42
  dir = Mongrel2::Config::Directory.create(
43
- :base => 'var/www/',
43
+ :base => 'var/www/',
44
44
  :default_ctype => 'text/plain',
45
45
  :index_file => 'index.html' )
46
46
 
@@ -32,6 +32,7 @@ describe Mongrel2::Config::Server do
32
32
  before( :each ) do
33
33
  @server = Mongrel2::Config::Server.new(
34
34
  uuid: TEST_UUID,
35
+ chroot: '/usr/local/www',
35
36
  access_log: '/logs/access.log',
36
37
  error_log: '/logs/error.log',
37
38
  pid_file: '/run/mongrel2.pid',
@@ -80,5 +81,29 @@ describe Mongrel2::Config::Server do
80
81
  end
81
82
 
82
83
 
84
+ it "knows where its control socket is if there's no setting for control_port" do
85
+ Mongrel2::Config::Setting.dataset.truncate
86
+ @server.control_socket_uri.should == 'ipc://usr/local/www/run/control'
87
+ end
88
+
89
+ it "knows where its control socket is if there is a setting for control_port" do
90
+ Mongrel2::Config::Setting.dataset.truncate
91
+ Mongrel2::Config::Setting.create( key: 'control_port', value: 'ipc://var/run/control.sock' )
92
+ @server.control_socket_uri.should == 'ipc://usr/local/www/var/run/control.sock'
93
+ end
94
+
95
+ it "can create a Mongrel2::Control for its control port" do
96
+ Mongrel2::Config::Setting.dataset.truncate
97
+ sock = @server.control_socket
98
+ sock.should be_a( Mongrel2::Control )
99
+ sock.close
100
+ end
101
+
102
+ it "knows what the Pathname of its PID file is" do
103
+ pidfile = @server.pid_file_path
104
+ pidfile.should be_a( Pathname )
105
+ pidfile.to_s.should == '/usr/local/www/run/mongrel2.pid'
106
+ end
107
+
83
108
  end
84
109
 
@@ -67,6 +67,15 @@ describe Mongrel2::Config do
67
67
  Mongrel2::Config.servers.first.uuid.should == TEST_UUID
68
68
  end
69
69
 
70
+ it "has a convenience method for getting a setting's value" do
71
+ Mongrel2::Config.init_database
72
+ Mongrel2::Config::Setting.dataset.truncate
73
+ Mongrel2::Config::Setting.create( key: 'control_port', value: 'ipc://var/run/control.sock' )
74
+ Mongrel2::Config.settings.should be_a( Hash )
75
+ Mongrel2::Config.settings.should have( 1 ).member
76
+ Mongrel2::Config.settings[ :control_port ].should == 'ipc://var/run/control.sock'
77
+ end
78
+
70
79
  it "can read the configuration schema from a data file" do
71
80
  Mongrel2::Config.load_config_schema.should =~ /create table server/i
72
81
  end
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.9.2
4
+ version: 0.10.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -48,11 +48,11 @@ cert_chain:
48
48
  -----END CERTIFICATE-----
49
49
 
50
50
  '
51
- date: 2011-10-12 00:00:00.000000000Z
51
+ date: 2012-02-06 00:00:00.000000000 Z
52
52
  dependencies:
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: nokogiri
55
- requirement: &70108858887920 !ruby/object:Gem::Requirement
55
+ requirement: &70339771539100 !ruby/object:Gem::Requirement
56
56
  none: false
57
57
  requirements:
58
58
  - - ~>
@@ -60,21 +60,21 @@ dependencies:
60
60
  version: '1.5'
61
61
  type: :runtime
62
62
  prerelease: false
63
- version_requirements: *70108858887920
63
+ version_requirements: *70339771539100
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: sequel
66
- requirement: &70108858887400 !ruby/object:Gem::Requirement
66
+ requirement: &70339771538660 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ~>
70
70
  - !ruby/object:Gem::Version
71
- version: '3.26'
71
+ version: '3.31'
72
72
  type: :runtime
73
73
  prerelease: false
74
- version_requirements: *70108858887400
74
+ version_requirements: *70339771538660
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: amalgalite
77
- requirement: &70108858886980 !ruby/object:Gem::Requirement
77
+ requirement: &70339771538220 !ruby/object:Gem::Requirement
78
78
  none: false
79
79
  requirements:
80
80
  - - ~>
@@ -82,10 +82,10 @@ dependencies:
82
82
  version: '1.1'
83
83
  type: :runtime
84
84
  prerelease: false
85
- version_requirements: *70108858886980
85
+ version_requirements: *70339771538220
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: tnetstring
88
- requirement: &70108858886420 !ruby/object:Gem::Requirement
88
+ requirement: &70339771537780 !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
91
  - - ~>
@@ -93,21 +93,43 @@ dependencies:
93
93
  version: '0.3'
94
94
  type: :runtime
95
95
  prerelease: false
96
- version_requirements: *70108858886420
96
+ version_requirements: *70339771537780
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: yajl-ruby
99
- requirement: &70108858885920 !ruby/object:Gem::Requirement
99
+ requirement: &70339771537340 !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements:
102
102
  - - ~>
103
103
  - !ruby/object:Gem::Version
104
- version: '0.8'
104
+ version: '1.0'
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: *70339771537340
108
+ - !ruby/object:Gem::Dependency
109
+ name: trollop
110
+ requirement: &70339771536880 !ruby/object:Gem::Requirement
111
+ none: false
112
+ requirements:
113
+ - - ~>
114
+ - !ruby/object:Gem::Version
115
+ version: '1.16'
105
116
  type: :runtime
106
117
  prerelease: false
107
- version_requirements: *70108858885920
118
+ version_requirements: *70339771536880
119
+ - !ruby/object:Gem::Dependency
120
+ name: sysexits
121
+ requirement: &70339771536400 !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ~>
125
+ - !ruby/object:Gem::Version
126
+ version: '1.0'
127
+ type: :runtime
128
+ prerelease: false
129
+ version_requirements: *70339771536400
108
130
  - !ruby/object:Gem::Dependency
109
131
  name: zmq
110
- requirement: &70108858885480 !ruby/object:Gem::Requirement
132
+ requirement: &70339771535960 !ruby/object:Gem::Requirement
111
133
  none: false
112
134
  requirements:
113
135
  - - ~>
@@ -115,10 +137,10 @@ dependencies:
115
137
  version: 2.1.4
116
138
  type: :runtime
117
139
  prerelease: false
118
- version_requirements: *70108858885480
140
+ version_requirements: *70339771535960
119
141
  - !ruby/object:Gem::Dependency
120
142
  name: hoe-mercurial
121
- requirement: &70108858885040 !ruby/object:Gem::Requirement
143
+ requirement: &70339771535500 !ruby/object:Gem::Requirement
122
144
  none: false
123
145
  requirements:
124
146
  - - ~>
@@ -126,10 +148,10 @@ dependencies:
126
148
  version: 1.3.1
127
149
  type: :development
128
150
  prerelease: false
129
- version_requirements: *70108858885040
151
+ version_requirements: *70339771535500
130
152
  - !ruby/object:Gem::Dependency
131
153
  name: hoe-highline
132
- requirement: &70108858884580 !ruby/object:Gem::Requirement
154
+ requirement: &70339771535040 !ruby/object:Gem::Requirement
133
155
  none: false
134
156
  requirements:
135
157
  - - ~>
@@ -137,10 +159,10 @@ dependencies:
137
159
  version: 0.0.1
138
160
  type: :development
139
161
  prerelease: false
140
- version_requirements: *70108858884580
162
+ version_requirements: *70339771535040
141
163
  - !ruby/object:Gem::Dependency
142
164
  name: configurability
143
- requirement: &70108858884120 !ruby/object:Gem::Requirement
165
+ requirement: &70339771534580 !ruby/object:Gem::Requirement
144
166
  none: false
145
167
  requirements:
146
168
  - - ~>
@@ -148,21 +170,21 @@ dependencies:
148
170
  version: '1.0'
149
171
  type: :development
150
172
  prerelease: false
151
- version_requirements: *70108858884120
173
+ version_requirements: *70339771534580
152
174
  - !ruby/object:Gem::Dependency
153
175
  name: rspec
154
- requirement: &70108858883700 !ruby/object:Gem::Requirement
176
+ requirement: &70339771534040 !ruby/object:Gem::Requirement
155
177
  none: false
156
178
  requirements:
157
179
  - - ~>
158
180
  - !ruby/object:Gem::Version
159
- version: '2.4'
181
+ version: '2.8'
160
182
  type: :development
161
183
  prerelease: false
162
- version_requirements: *70108858883700
184
+ version_requirements: *70339771534040
163
185
  - !ruby/object:Gem::Dependency
164
186
  name: hoe
165
- requirement: &70108858883240 !ruby/object:Gem::Requirement
187
+ requirement: &70339771533600 !ruby/object:Gem::Requirement
166
188
  none: false
167
189
  requirements:
168
190
  - - ~>
@@ -170,7 +192,18 @@ dependencies:
170
192
  version: '2.12'
171
193
  type: :development
172
194
  prerelease: false
173
- version_requirements: *70108858883240
195
+ version_requirements: *70339771533600
196
+ - !ruby/object:Gem::Dependency
197
+ name: rdoc
198
+ requirement: &70339771667280 !ruby/object:Gem::Requirement
199
+ none: false
200
+ requirements:
201
+ - - ~>
202
+ - !ruby/object:Gem::Version
203
+ version: '3.10'
204
+ type: :development
205
+ prerelease: false
206
+ version_requirements: *70339771667280
174
207
  description: ! "Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for \nMongrel2[http://mongrel2.org/].\n\nThis
175
208
  library includes configuration-database ORM classes, a Ruby\nimplementation of the
176
209
  'm2sh' tool, a configuration DSL for generating config\ndatabases in pure Ruby,
@@ -219,6 +252,7 @@ files:
219
252
  - lib/mongrel2/config.rb
220
253
  - lib/mongrel2/config/directory.rb
221
254
  - lib/mongrel2/config/dsl.rb
255
+ - lib/mongrel2/config/filter.rb
222
256
  - lib/mongrel2/config/handler.rb
223
257
  - lib/mongrel2/config/host.rb
224
258
  - lib/mongrel2/config/log.rb
@@ -248,6 +282,7 @@ files:
248
282
  - spec/lib/matchers.rb
249
283
  - spec/mongrel2/config/directory_spec.rb
250
284
  - spec/mongrel2/config/dsl_spec.rb
285
+ - spec/mongrel2/config/filter_spec.rb
251
286
  - spec/mongrel2/config/handler_spec.rb
252
287
  - spec/mongrel2/config/host_spec.rb
253
288
  - spec/mongrel2/config/log_spec.rb
@@ -292,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
327
  version: '0'
293
328
  requirements: []
294
329
  rubyforge_project: mongrel2
295
- rubygems_version: 1.8.10
330
+ rubygems_version: 1.8.14
296
331
  signing_key:
297
332
  specification_version: 3
298
333
  summary: Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for Mongrel2[http://mongrel2.org/]
metadata.gz.sig CHANGED
Binary file