Sha256: 0f1b5af87a5b4f8bff7dc5d7487956be91d26babdc5050ca937b133043ab4782

Contents?: true

Size: 742 Bytes

Versions: 14

Compression:

Stored size: 742 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)
        if check_presence && !Aruba.platform.file?(path)
          raise "Expected #{path} to be present"
        end

        Aruba.platform.mkdir(File.dirname(path))

        File.write(path, content)

        self
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/platforms/aruba_file_creator.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/platforms/aruba_file_creator.rb
aruba-2.2.0 lib/aruba/platforms/aruba_file_creator.rb
aruba-2.1.0 lib/aruba/platforms/aruba_file_creator.rb
aruba-2.0.1 lib/aruba/platforms/aruba_file_creator.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/aruba-2.0.0/lib/aruba/platforms/aruba_file_creator.rb
aruba-2.0.0 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.1.2 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.1.1 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.1.0 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.0.4 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.0.3 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.0.2 lib/aruba/platforms/aruba_file_creator.rb
aruba-1.0.1 lib/aruba/platforms/aruba_file_creator.rb