ruby_context = nil) return identity unless (ruby_context.respond_to?(:request)) request = ruby_context.request if request && ["GET", "HEAD"].include?(request.request_method) identity.key(field => request.GET.dup) end identity end end end
ruby_context = nil) value = nil if ruby_context.send(:caller) ruby_context.send(:caller).compact.each do |line| parts = line.match(/(?<filename>[^:]+)\:(?<lineno>[^:]+)/) file = (Pathname.new(parts[:filename]).realpath.to_s rescue nil) next if file.nil? || file == "" next if file.include?(File.join("lib", "garner")) if (root = Garner.config.caller_root) root += File::SEPARATOR unless root[-1] == File::SEPARATOR next unless file =~ /^#{root}/ value = "#{file.gsub(root || "", "")}:#{parts[:lineno]}" else value = "#{file}:#{parts[:lineno]}" end break end end value ? identity.key(field => value) : identity end end end