文件操作 - installer.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/gems/3.2.0/gems/rbs-2.8.2/lib/rbs/collection/installer.rb
编辑文件内容
# frozen_string_literal: true module RBS module Collection class Installer attr_reader :lockfile attr_reader :stdout def initialize(lockfile_path:, stdout: $stdout) @lockfile = Config.from_path(lockfile_path) @stdout = stdout end def install_from_lockfile install_to = lockfile.repo_path install_to.mkpath lockfile.gems.each do |config_entry| source_for(config_entry).install(dest: install_to, config_entry: config_entry, stdout: stdout) end stdout.puts "It's done! #{lockfile.gems.size} gems' RBSs now installed." end private def source_for(config_entry) @source_for ||= {} key = config_entry['source'] unless key raise "Cannot find source of '#{config_entry['name']}' gem" end @source_for[key] ||= Sources.from_config_entry(key) end end end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件