Changeset 4676
- Timestamp:
- 08/05/06 22:11:24 (2 years ago)
- Files:
-
- trunk/railties/CHANGELOG (modified) (1 diff)
- trunk/railties/lib/commands/servers/lighttpd.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/railties/CHANGELOG
r4673 r4676 1 1 *SVN* 2 3 * Added that you can change the web server port in config/lighttpd.conf from script/server --port/-p #5465 [mats@imediatec.co.uk] 2 4 3 5 * script/performance/profiler compatibility with the new ruby-prof, including an option to choose the results printer. #5679 [shugo@ruby-lang.org] trunk/railties/lib/commands/servers/lighttpd.rb
r4506 r4676 19 19 20 20 detach = false 21 user_defined_active_port = nil 21 22 22 23 ARGV.options do |opt| 24 opt.on("-p", "--port=port", "Changes the server.port number in the config/lighttpd.conf") { |port| command_line_port = port } 23 25 opt.on('-c', "--config=#{config_file}", 'Specify a different lighttpd config file.') { |path| config_file = path } 24 26 opt.on('-h', '--help', 'Show this message.') { puts opt; exit 0 } … … 40 42 41 43 FileUtils.cp(source, config_file) 44 end 45 46 # open the config/lighttpd.conf file and add the current user defined port setting to it 47 if command_line_port 48 File.open(config_file, 'r+') do |config| 49 lines = config.readlines 50 51 lines.each do |line| 52 line.gsub!(/^\s*server.port\s*=\s*(\d+)/, "server.port = #{command_line_port}") 53 end 54 55 config.rewind 56 config.print(lines) 57 config.truncate(config.pos) 58 end 42 59 end 43 60