Changeset 759
- Timestamp:
- 10/26/07 02:56:55 (10 months ago)
- Files:
-
- tags/rel_1-0-2/lib/mongrel/configurator.rb (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tags/rel_1-0-2/lib/mongrel/configurator.rb
r758 r759 39 39 40 40 # You pass in initial defaults and then a block to continue configuring. 41 def initialize(defaults={}, &bl k)41 def initialize(defaults={}, &block) 42 42 @listener = nil 43 43 @listener_name = nil … … 47 47 @pid_file = defaults[:pid_file] 48 48 49 if bl k50 cloaker(&bl k).bind(self).call51 end 52 end 53 54 # Change privilege of the process to specified user and group.49 if block 50 cloaker(&block).bind(self).call 51 end 52 end 53 54 # Change privileges of the process to specified user and group. 55 55 def change_privilege(user, group) 56 56 begin … … 106 106 107 107 # Do not call this. You were warned. 108 def cloaker(&bl k)108 def cloaker(&block) 109 109 cloaking_class.class_eval do 110 define_method :cloaker_, &bl k110 define_method :cloaker_, &block 111 111 meth = instance_method( :cloaker_ ) 112 112 remove_method :cloaker_ … … 136 136 # * :group => Group to change to, must have :user as well. 137 137 # 138 def listener(options={},&bl k)138 def listener(options={},&block) 139 139 raise "Cannot call listener inside another listener block." if (@listener or @listener_name) 140 140 ops = resolve_defaults(options) … … 152 152 153 153 # Does the actual cloaking operation to give the new implicit self. 154 if bl k155 cloaker(&bl k).bind(self).call154 if block 155 cloaker(&block).bind(self).call 156 156 end 157 157
