mongrel_status 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,154 +1,6 @@
1
- = Mongrel: Simple Fast Mostly Ruby Web Server
1
+ == Mongrel Status Plugin
2
2
 
3
- Mongrel is a small library that provides a very fast HTTP 1.1 server for Ruby
4
- web applications. It is not particular to any framework, and is intended to
5
- be just enough to get a web application running behind a more complete and robust
6
- web server.
3
+ A very simple dumb status plugin that's mostly just a demonstration
4
+ of how to do a plugin for mongrel. It just prints out the
5
+ PID of a running mongrel server.
7
6
 
8
- What makes Mongrel so fast is the careful use of a C extension to provide fast
9
- HTTP 1.1 protocol parsing and fast URI lookup. This combination makes the server
10
- scream without too many portability issues.
11
-
12
- == Status
13
-
14
- The 0.3.6 release supports Ruby On Rails much better than previously, and also
15
- sports the beginning of a command and plugin infrastructure. There is now a more
16
- complete CGIWrapper that handles most of the CGI usage, but still doesn't do the
17
- MIME decoding or file upload/send (it leaves that to CGI). Finally, there's a
18
- great mongrel_rails_service script for running under Win32 as a service.
19
-
20
- After you've installed (either with gem install mongrel or via source) you should
21
- have the mongrel_rails command available in your PATH. Then you just do the following:
22
-
23
- > cd myrailsapp
24
- > mongrel_rails start
25
-
26
- This will start it in the foreground so you can play with it. It runs your application
27
- in production mode. To get help do:
28
-
29
- > mongrel_rails start -h
30
-
31
- Finally, you can then start in background mode (probably won't work in win32):
32
-
33
- > mongrel_rails start -d
34
-
35
- And you can stop it whenever you like with:
36
-
37
- > mongrel_rails stop
38
-
39
- All of which should be done from your application's directory. It writes the
40
- PID of the process you ran into log/mongrel.pid.
41
-
42
- There are also many more new options for configuring the rails runner including
43
- changing to a different directory, adding more MIME types, and setting processor
44
- threads and timeouts.
45
-
46
-
47
- === Win32 Service Support
48
-
49
- Mongrel now has support for running as a Win32 service right out of the
50
- box. The support is still rough but works well enough that we decided
51
- to release it. You can thank Luis Lavena for working on this and making
52
- it so nice.
53
-
54
- After you do the gem install, find a Rails application you want to run
55
- and do:
56
-
57
- $ mongrel_rails_service install -n myapp \
58
- -r c:\my\path\to\myapp -p 4000 -e production
59
- $ mongrel_rails_service start -n myapp
60
-
61
- Now hit the port and poof, works. *Stopping the service is a little problematic right now.*
62
-
63
- If you run into an app that's not running right, my suggestion is to run it with
64
- the regular mongrel_rails runner:
65
-
66
- $ cd c:\my\path\to\myapp
67
- $ mongrel_rails start -p 4500
68
-
69
- Since that will spit out error messages and stuff to the console. *Use CTRL-Pause/Break to stop.*
70
-
71
-
72
- == Install
73
-
74
- It doesn't explicitly require Camping, but if you want to run the examples/camping/
75
- examples then you'll need to install Camping 1.2 at least (and redcloth I think).
76
- These are all available from RubyGems.
77
-
78
- The library consists of a C extension so you'll need a C compiler or at least a friend
79
- who can build it for you.
80
-
81
- Finally, the source includes a setup.rb for those who hate RubyGems.
82
-
83
-
84
- == Usage
85
-
86
- The examples/simpletest.rb file has the following code as the simplest
87
- example:
88
-
89
- require 'mongrel'
90
-
91
- class SimpleHandler < Mongrel::HttpHandler
92
- def process(request, response)
93
- response.start(200) do |head,out|
94
- head["Content-Type"] = "text/plain"
95
- out.write("hello!\n")
96
- end
97
- end
98
- end
99
-
100
- h = Mongrel::HttpServer.new("0.0.0.0", "3000")
101
- h.register("/test", SimpleHandler.new)
102
- h.register("/files", Mongrel::DirHandler.new("."))
103
- h.run.join
104
-
105
- If you run this and access port 3000 with a browser it will say
106
- "hello!". If you access it with any url other than "/test" it will
107
- give a simple 404. Check out the Mongrel::Error404Handler for a
108
- basic way to give a more complex 404 message.
109
-
110
- This also shows the DirHandler with directory listings. This is still
111
- rough but it should work for basic hosting. *File extension to mime
112
- type mapping is missing though.*
113
-
114
-
115
- == Speed
116
-
117
- Like previous releases 0.3.1 continues the trend of making things
118
- as fast as possible. It currently might be a little slower than
119
- other releases but should hold up pretty good against at least
120
- WEBrick (especially when running Rails).
121
-
122
- As before you can control the number of processor threads (and thus
123
- ActiveRecord database connections) with:
124
-
125
- h = Mongrel::HttpServer.new("0.0.0.0", "3000", 40)
126
-
127
- Which will make 40 thread processors. Right now the optimal setting is up in
128
- the air, but 20 seemed to be about the sweet spot on my systems. The
129
- limited processors also means that you can use ActiveRecord as-is and it will
130
- create a matching database connection for each processor thread. More on
131
- this in future releases.
132
-
133
-
134
- == The Future
135
-
136
- With the core of Mongrel completed I'm now turning to the next set of features
137
- to make Mongrel useful for hosting web applications in a heavily utilized
138
- production environment. Right now I'm looking at:
139
-
140
- * An idea I've had for an insane caching handler which could speed up quite a
141
- few deployments.
142
-
143
- Overall though the goal of Mongrel is to be just enough HTTP to serve a Ruby
144
- web application that sits behind a more complete web server. Everything
145
- in the next will focus on actually hosting the major web frameworks for Ruby:
146
-
147
- * Camping -- because it's already done (thanks Why).
148
- * Ruby on Rails -- that's where my bread is buttered right now.
149
- * Nitro -- Nitro folks have already hooked this up and started using it. Nice.
150
- * ????? -- Others people might be interested in.
151
-
152
- == Contact
153
-
154
- E-mail zedshaw at zedshaw.com and I'll help. Comments about the API are welcome.
data/Rakefile CHANGED
@@ -15,16 +15,22 @@ setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
15
15
  desc "Does a full compile, test run"
16
16
  task :default => [:test, :package]
17
17
 
18
- version="0.1"
19
- summary = "A sample plugin that reports the status of mongrel."
20
- test_file = "test/test_empty.rb"
21
- author="Zed A. Shaw"
18
+ version="0.2"
22
19
  name="mongrel_status"
23
- scripts=[]
24
20
 
25
- setup_gem(name, version, author, summary, scripts, test_file) do |spec|
21
+ setup_gem(name, version) do |spec|
22
+ spec.summary = "A sample plugin that reports the status of mongrel."
23
+ spec.description = spec.summary
24
+ spec.test_file = "test/test_empty.rb"
25
+ spec.author="Zed A. Shaw"
26
26
  spec.add_dependency('mongrel', '>= 0.3.9')
27
- spec.add_dependency('gem_plugin', '>= 0.1')
28
- spec.autorequire = 'init.rb'
27
+ spec.add_dependency('gem_plugin', '>= 0.2')
29
28
  end
30
29
 
30
+ task :install => [:test, :package] do
31
+ sh %{sudo gem install pkg/#{name}-#{version}.gem}
32
+ end
33
+
34
+ task :uninstall => [:clean] do
35
+ sh %{sudo gem uninstall #{name}}
36
+ end
File without changes
@@ -64,18 +64,14 @@ def setup_extension(dir, extension)
64
64
  end
65
65
 
66
66
 
67
- def base_gem_spec(pkg_name, pkg_version, author, summary, executables, test_file)
67
+ def base_gem_spec(pkg_name, pkg_version)
68
68
  pkg_version = pkg_version
69
69
  pkg_name = pkg_name
70
70
  pkg_file_name = "#{pkg_name}-#{pkg_version}"
71
71
  Gem::Specification.new do |s|
72
72
  s.name = pkg_name
73
73
  s.version = pkg_version
74
- s.required_ruby_version = '>= 1.8.3'
75
74
  s.platform = Gem::Platform::RUBY
76
- s.author = author
77
- s.summary = summary
78
- s.test_file = test_file
79
75
  s.has_rdoc = true
80
76
  s.extra_rdoc_files = [ "README" ]
81
77
 
@@ -87,14 +83,12 @@ def base_gem_spec(pkg_name, pkg_version, author, summary, executables, test_file
87
83
 
88
84
  s.require_path = "lib"
89
85
  s.extensions = FileList["ext/**/extconf.rb"].to_a
90
-
91
- s.executables = executables
92
86
  s.bindir = "bin"
93
87
  end
94
88
  end
95
89
 
96
- def setup_gem(pkg_name, pkg_version, author, summary, executables, test_file)
97
- spec = base_gem_spec(pkg_name, pkg_version, author, summary, executables, test_file)
90
+ def setup_gem(pkg_name, pkg_version)
91
+ spec = base_gem_spec(pkg_name, pkg_version)
98
92
  yield spec if block_given?
99
93
 
100
94
  Rake::GemPackageTask.new(spec) do |p|
@@ -103,8 +97,8 @@ def setup_gem(pkg_name, pkg_version, author, summary, executables, test_file)
103
97
  end
104
98
  end
105
99
 
106
- def setup_win32_gem(pkg_name, pkg_version, author, summary, executables, test_file)
107
- spec = base_gem_spec(pkg_name, pkg_version, author, summary, executables, test_file)
100
+ def setup_win32_gem(pkg_name, pkg_version)
101
+ spec = base_gem_spec(pkg_name, pkg_version)
108
102
  yield spec if block_given?
109
103
 
110
104
  Gem::Builder.new(spec).build
metadata CHANGED
@@ -3,24 +3,24 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: mongrel_status
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.1"
7
- date: 2006-03-06 00:00:00 -05:00
6
+ version: "0.2"
7
+ date: 2006-03-12 00:00:00 -05:00
8
8
  summary: A sample plugin that reports the status of mongrel.
9
9
  require_paths:
10
10
  - lib
11
11
  email:
12
12
  homepage:
13
13
  rubyforge_project:
14
- description:
15
- autorequire: init.rb
14
+ description: A sample plugin that reports the status of mongrel.
15
+ autorequire:
16
16
  default_executable:
17
17
  bindir: bin
18
18
  has_rdoc: true
19
19
  required_ruby_version: !ruby/object:Gem::Version::Requirement
20
20
  requirements:
21
- - - ">="
21
+ - - ">"
22
22
  - !ruby/object:Gem::Version
23
- version: 1.8.3
23
+ version: 0.0.0
24
24
  version:
25
25
  platform: ruby
26
26
  signing_key:
@@ -33,7 +33,8 @@ files:
33
33
  - README
34
34
  - Rakefile
35
35
  - test/test_empty.rb
36
- - lib/init.rb
36
+ - lib/mongrel_status
37
+ - lib/mongrel_status/init.rb
37
38
  - tools/rakehelp.rb
38
39
  test_files:
39
40
  - test/test_empty.rb
@@ -64,5 +65,5 @@ dependencies:
64
65
  requirements:
65
66
  - - ">="
66
67
  - !ruby/object:Gem::Version
67
- version: "0.1"
68
+ version: "0.2"
68
69
  version: