Sha256: 816c0519de482b5c57887d63786efb0df1ea55fdfb4937b6ef1b0d07dff3ac1c

Contents?: true

Size: 719 Bytes

Versions: 4

Compression:

Stored size: 719 Bytes

Contents

# 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 [Boolean] 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))

        File.write(path, content)

        self
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aruba-1.0.0 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.0.0.pre.alpha.5 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.0.0.pre.alpha.4 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.0.0.pre.alpha.3 lib/aruba/platforms/aruba_file_creator.rb