Sha256: 611e5c0c8c2f48efb207f722559eb3a15bbd2be272e6feed7443dae18a337bfa

Contents?: true

Size: 503 Bytes

Versions: 15

Compression:

Stored size: 503 Bytes

Contents

# frozen_string_literal: true

# Write a string to a file.
Puppet::Functions.create_function(:'file::write') do
  # @param filename Absolute path.
  # @param content File content to write.
  # @example Write a file to disk
  #   file::write('C:/Users/me/report', $apply_result.first.report)
  dispatch :write do
    required_param 'String', :filename
    required_param 'String', :content
    return_type 'Undef'
  end

  def write(filename, content)
    File.write(filename, content)
    nil
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bolt-1.21.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.20.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.19.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.18.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.17.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.16.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.15.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.14.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.13.1 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.13.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.12.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.11.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.10.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.9.0 bolt-modules/file/lib/puppet/functions/file/write.rb
bolt-1.8.1 bolt-modules/file/lib/puppet/functions/file/write.rb