Class: Aruba::Platforms::ArubaFileCreator
- Inherits:
-
Object
- Object
- Aruba::Platforms::ArubaFileCreator
- Defined in:
- lib/aruba/platforms/aruba_file_creator.rb
Overview
Normal File Creator This class is not meant to be used directly by users.
Instance Method Summary collapse
Instance Method Details
#call(path, content, check_presence = false) ⇒ Object
Write File
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/aruba/platforms/aruba_file_creator.rb', line 20 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 |