/usr/lib/ruby/vendor_ruby/aruba/platforms/aruba_file_creator.rb is in ruby-aruba 0.14.2-2.
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 | # Aruba
module Aruba
# Platforms
module Platforms
# Normal File Creator
# This class is not meant to be used directly by users.
#
# @private
class ArubaFileCreator
# Write File
#
# @param [String] path
# The path to write content to
#
# @param [Object] content
# The content of the file
#
# @param [TrueClass, FalseClass] check_presence (false)
# Check if file exist
def call(path, content, check_presence = false)
fail "Expected #{path} to be present" if check_presence && !Aruba.platform.file?(path)
Aruba.platform.mkdir(File.dirname(path))
if RUBY_VERSION < '1.9.3'
File.open(path, 'w') { |f| f << content }
else
File.write(path, content)
end
self
end
end
end
end
|