diff options
Diffstat (limited to 'rubocop/ext/path_util.rb')
-rw-r--r-- | rubocop/ext/path_util.rb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/rubocop/ext/path_util.rb b/rubocop/ext/path_util.rb deleted file mode 100644 index 3b54f046c7b..00000000000 --- a/rubocop/ext/path_util.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -module RuboCop - module PathUtil - def match_path?(pattern, path) - case pattern - when String - matched = if /[*{}]/.match?(pattern) - File.fnmatch?(pattern, path, File::FNM_PATHNAME | File::FNM_EXTGLOB) - else - pattern == path - end - - matched || hidden_file_in_not_hidden_dir?(pattern, path) - when Regexp - begin - pattern.match?(path) - rescue ArgumentError => e - return false if e.message.start_with?('invalid byte sequence') - - raise e - end - end - end - end -end |