/usr/lib/ruby/vendor_ruby/ethon/easy/debug_info.rb is in ruby-ethon 0.7.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | module Ethon
class Easy
# This class is used to store and retreive debug information,
# which is only saved when verbose is set to true.
#
# @api private
class DebugInfo
MESSAGE_TYPES = Ethon::Curl::DebugInfoType.to_h.keys
class Message
attr_reader :type, :message
def initialize(type, message)
@type = type
@message = message
end
end
def initialize
@messages = []
end
def add(type, message)
@messages << Message.new(type, message)
end
def messages_for(type)
@messages.select {|m| m.type == type }.map(&:message)
end
MESSAGE_TYPES.each do |type|
eval %Q|def #{type}; messages_for(:#{type}); end|
end
def to_a
@messages.map(&:message)
end
def to_h
Hash[MESSAGE_TYPES.map {|k| [k, send(k)] }]
end
end
end
end
|