文件操作 - values.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/functions/values.rb
编辑文件内容
# frozen_string_literal: true # Returns the values of a hash as an Array # # @example Using `values` # # ```puppet # $hsh = {"apples" => 3, "oranges" => 4 } # $hsh.values() # values($hsh) # # both results in the array [3, 4] # ``` # # * Note that a hash in the puppet language accepts any data value (including `undef`) unless # it is constrained with a `Hash` data type that narrows the allowed data types. # * For an empty hash, an empty array is returned. # * The order of the values is the same as the order in the hash (typically the order in which they were added). # Puppet::Functions.create_function(:values) do dispatch :values do param 'Hash', :hsh end def values(hsh) hsh.values end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件