public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Improve API documentation. Do not generate diagrams: it becomes too big.
Hongli Lai (Phusion) (author)
Thu Feb 28 11:21:53 -0800 2008
commit  382f8d524fb0302162fc9289fc62f643fd2f1519
tree    11be549b71de37d292da66d5d36be6fc49278718
parent  95f365aa143dffcae5f830cd561e64b8bbb1d4ea
...
267
268
269
270
 
271
272
273
...
317
318
319
320
 
321
322
323
...
267
268
269
 
270
271
272
273
...
317
318
319
 
320
321
322
323
0
@@ -267,7 +267,7 @@ Rake::RDocTask.new do |rd|
0
   rd.rdoc_files.include("README", "lib/mod_rails/*.rb", "lib/rake/extensions.rb", "ext/mod_rails/*.c")
0
   rd.template = "./doc/template/horo"
0
   rd.title = "Passenger Ruby API"
0
- rd.options << "-S" << "-N" << "-p" << "-H" << "-d"
0
+ rd.options << "-S" << "-N" << "-p" << "-H"
0
 end
0
 
0
 
0
@@ -317,7 +317,7 @@ spec = Gem::Specification.new do |s|
0
   s.has_rdoc = true
0
   s.extra_rdoc_files = ['README']
0
   s.rdoc_options <<
0
- "-S" << "-N" << "-p" << "-H" << "-d" <<
0
+ "-S" << "-N" << "-p" << "-H" <<
0
     '--main' << 'README' <<
0
     '--template' << './doc/template/horo' <<
0
     '--title' << 'Passenger Ruby API'
...
53
54
55
 
 
56
57
58
 
 
59
60
61
...
53
54
55
56
57
58
59
60
61
62
63
64
65
0
@@ -53,9 +53,13 @@ class AbstractServer
0
   class UnknownMessage < StandardError
0
   end
0
   
0
+ # Raised when a command is invoked that requires that the server is
0
+ # not already started.
0
   class ServerAlreadyStarted < StandardError
0
   end
0
   
0
+ # Raised when a command is invoked that requires that the server is
0
+ # already started.
0
   class ServerNotStarted < StandardError
0
   end
0
   
...
1
2
3
 
 
4
5
6
 
 
7
8
9
...
1
2
3
4
5
6
7
8
9
10
11
12
13
0
@@ -1,9 +1,13 @@
0
 require 'rubygems'
0
 module ModRails # :nodoc:
0
 
0
+# Indicates that there is no Ruby on Rails version installed that satisfies
0
+# a given Ruby on Rails Gem version specification.
0
 class VersionNotFound < StandardError
0
   attr_reader :gem_version_spec
0
   
0
+ # - +message+: The exception message.
0
+ # - +gem_version_spec+: The Ruby on Rails Gem version specification that caused this error.
0
   def initialize(message, gem_version_spec)
0
     super(message)
0
     @gem_version_spec = gem_version_spec
...
6
7
8
 
 
 
 
 
9
10
11
...
16
17
18
 
19
 
20
21
22
23
24
25
26
27
28
 
29
30
31
32
33
34
 
 
35
36
37
38
39
40
 
 
41
42
43
...
6
7
8
9
10
11
12
13
14
15
16
...
21
22
23
24
25
26
27
28
 
 
 
29
30
31
 
32
33
34
35
36
 
 
37
38
39
40
41
42
 
 
43
44
45
46
47
0
@@ -6,6 +6,11 @@ require 'mod_rails/utils'
0
 require 'mod_rails/request_handler'
0
 module ModRails # :nodoc
0
 
0
+# Raised when an ApplicationSpawner, FrameworkSpawner or SpawnManager is
0
+# unable to spawn a new application.
0
+class SpawnError < StandardError
0
+end
0
+
0
 # This class is capable of spawns instances of a single Ruby on Rails application.
0
 # It does so by preloading as much of the application's code as possible, then creating
0
 # instances of the application using what is already preloaded. This makes it spawning
0
@@ -16,28 +21,27 @@ module ModRails # :nodoc
0
 class ApplicationSpawner < AbstractServer
0
   include Utils
0
   
0
+ # The user ID of the root user.
0
   ROOT_UID = 0
0
+ # The group ID of the root user.
0
   ROOT_GID = 0
0
   
0
- class SpawnError < StandardError
0
- end
0
-
0
   # An attribute, used internally. This should not be used outside Passenger.
0
   attr_accessor :time
0
 
0
- # _app_root_ is the root directory of this application, i.e. the directory
0
+ # +app_root+ is the root directory of this application, i.e. the directory
0
   # that contains 'app/', 'public/', etc. If given an invalid directory,
0
   # or a directory that doesn't appear to be a Rails application root directory,
0
   # then an ArgumentError will be raised.
0
   #
0
- # If _lower_privilege_ is true, then ApplicationSpawner will attempt to
0
- # switch to the user who owns the application's <tt>config/environment.rb</tt>,
0
+ # If +lower_privilege+ is true, then ApplicationSpawner will attempt to
0
+ # switch to the user who owns the application's +config/environment.rb+,
0
   # and to the default group of that user.
0
   #
0
   # If that user doesn't exist on the system, or if that user is root,
0
   # then ApplicationSpawner will attempt to switch to the username given by
0
- # _lowest_user_ (and to the default group of that user).
0
- # If _lowest_user_ doesn't exist either, or if switching user failed
0
+ # +lowest_user+ (and to the default group of that user).
0
+ # If +lowest_user+ doesn't exist either, or if switching user failed
0
   # (because the current process does not have the privilege to do so),
0
   # then ApplicationSpawner will continue without reporting an error.
0
   def initialize(app_root, lower_privilege = true, lowest_user = "nobody")
...
60
61
62
63
 
64
65
66
...
73
74
75
76
 
77
78
79
...
60
61
62
 
63
64
65
66
...
73
74
75
 
76
77
78
79
0
@@ -60,7 +60,7 @@ class FrameworkSpawner < AbstractServer
0
   # If the FrameworkSpawner server hasn't already been started, a ServerNotStarted
0
   # will be raised.
0
   # If the RoR application failed to start (which may be a problem in the application,
0
- # or a problem in the Ruby on Rails framework), then an ApplicationSpawner::SpawnError
0
+ # or a problem in the Ruby on Rails framework), then a SpawnError
0
   # will be raised. The application's exception message will be printed to standard
0
   # error.
0
   def spawn_application(app_root, lower_privilege = true, lowest_user = "nobody")
0
@@ -73,7 +73,7 @@ class FrameworkSpawner < AbstractServer
0
       return Application.new(app_root, pid, listen_socket_name,
0
         using_abstract_namespace == "true", owner_pipe)
0
     rescue SystemCallError, IOError, SocketError
0
- raise ApplicationSpawner::SpawnError, "Unable to spawn the application: " <<
0
+ raise SpawnError, "Unable to spawn the application: " <<
0
         "either the Ruby on Rails framework failed to load, " <<
0
         "or the application died unexpectedly during initialization."
0
     end
...
12
13
14
15
 
16
17
...
12
13
14
 
15
16
17
0
@@ -12,6 +12,6 @@ shared_examples_for "AbstractServer" do
0
   end
0
   
0
   it "should raise a ServerAlreadyStarted if the server is already started" do
0
- lambda { @server.start }.should raise_error(ServerAlreadyStarted)
0
+ lambda { @server.start }.should raise_error(AbstractServer::ServerAlreadyStarted)
0
   end
0
 end

Comments

    No one has commented yet.