Sha256: 2ef11955037d14f2eeb339ad705c77211d9ae4bf33255b5de00b8849156f9497
Contents?: true
Size: 834 Bytes
Versions: 13
Compression:
Stored size: 834 Bytes
Contents
module NginxTail module Request UNKNOWN_REQUEST = "-".freeze # the 'default' nginx value for $request variable def self.included(base) # :nodoc: base.class_eval do def self.unknown_request?(request) request == UNKNOWN_REQUEST end # this ensures the below module methods actually make sense... raise "Class #{base.name} should implement instance method 'request'" unless base.instance_methods.map(&:to_s).include? 'request' end end def unknown_request? self.class.unknown_request?(self.request) end def to_request_s if self.unknown_request? self.request else # note: we exclude the HTTP version info... "%s %s" % [self.to_http_method_s, self.to_uri_s] end end end end
Version data entries
13 entries across 13 versions & 1 rubygems