文件操作 - pattern_key_name_checker.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/3.2.0/did_you_mean/spell_checkers/pattern_key_name_checker.rb
编辑文件内容
require_relative "../spell_checker" module DidYouMean class PatternKeyNameChecker def initialize(no_matching_pattern_key_error) @key = no_matching_pattern_key_error.key @keys = no_matching_pattern_key_error.matchee.keys end def corrections @corrections ||= exact_matches.empty? ? SpellChecker.new(dictionary: @keys).correct(@key).map(&:inspect) : exact_matches end private def exact_matches @exact_matches ||= @keys.select { |word| @key == word.to_s }.map(&:inspect) end end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件