### Home Classes Methods

### In Files

- spec/really_dumb_webserver.rb

### Methods

- #format

### Files

- History.txt
- Manifest.txt
- README.txt
- Rakefile
- changelog
- compat
- control
- copyright
- rules
- format
- watch
- Rakefile
- index.txt
- serial
- passphrase.txt

### Class/Module Index

Quicksearch

- Net
- Net::HTTP
- Net::HTTPGenericRequest
- WEBrick
- WEBrick::AccessLog
- WEBrick::HTMLUtils
- Rightscale
- Rightscale::HttpConnection

No matching classes.

# WEBrick::AccessLog

Monkey patch bad User-Agent parsing

### Public Instance Methods

format(format_string, params) click to toggle source

    # File spec/really_dumb_webserver.rb, line 31
    def format(format_string, params)
      format_string.gsub(/\%(?:\{(.*?)\})?>?([a-zA-Z%])/){
        param, spec = $1, $2
        case spec[0]
        when ee, ii, nn, oo
          raise AccessLogError,
          "parameter is required for \"#{spec}\"" unless param
          if params[spec][param]
            escape(params[spec][param])
          else
            "-"
          end
        when tt
          params[spec].strftime(param || CLF_TIME_FORMAT)
        when %%
          "%"
        else
          escape(params[spec].to_s)
        end
      }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.