/usr/lib/ruby/1.9.1/syck/stream.rb is in libruby1.9.1 1.9.3.0-1ubuntu1.
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 | module Syck
#
# YAML::Stream -- for emitting many documents
#
class Stream
attr_accessor :documents, :options
def initialize( opts = {} )
@options = opts
@documents = []
end
def []( i )
@documents[ i ]
end
def add( doc )
@documents << doc
end
def edit( doc_num, doc )
warn "#{caller[0]}: edit is deprecated" if $VERBOSE
@documents[ doc_num ] = doc
end
def emit( io = nil )
# opts = @options.dup
# opts[:UseHeader] = true if @documents.length > 1
out = Syck.emitter
out.reset( io || io2 = StringIO.new )
@documents.each { |v|
v.to_yaml( out )
}
io || ( io2.rewind; io2.read )
end
end
end
|