/usr/lib/ruby/1.8/yaml/yamlnode.rb is in libruby1.8 1.8.7.352-2ubuntu1.
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 47 48 49 50 51 52 53 54 | #
# YAML::YamlNode class
#
require 'yaml/basenode'
module YAML
#
# YAML Generic Model container
#
class YamlNode
include BaseNode
attr_accessor :kind, :type_id, :value, :anchor
def initialize( t, v )
@type_id = t
if Hash === v
@kind = 'map'
@value = {}
v.each { |k,v|
@value[ k.transform ] = [ k, v ]
}
elsif Array === v
@kind = 'seq'
@value = v
elsif String === v
@kind = 'scalar'
@value = v
end
end
#
# Transform this node fully into a native type
#
def transform
t = nil
if @value.is_a? Hash
t = {}
@value.each { |k,v|
t[ k ] = v[1].transform
}
elsif @value.is_a? Array
t = []
@value.each { |v|
t.push v.transform
}
else
t = @value
end
YAML.transfer_method( @type_id, t )
end
end
end
|