文件操作 - cloneable.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/gems/3.2.0/gems/rake-13.0.6/lib/rake/cloneable.rb
编辑文件内容
# frozen_string_literal: true module Rake ## # Mixin for creating easily cloned objects. module Cloneable # :nodoc: # The hook that is invoked by 'clone' and 'dup' methods. def initialize_copy(source) super source.instance_variables.each do |var| src_value = source.instance_variable_get(var) value = src_value.clone rescue src_value instance_variable_set(var, value) end end end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件