Skip to content

Commit

Permalink
Merge 524c380 into 6bc7bd9
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Dec 5, 2019
2 parents 6bc7bd9 + 524c380 commit 3eed13a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions library/general/src/modules/FileUtils.rb
Expand Up @@ -33,6 +33,8 @@

module Yast
class FileUtilsClass < Module
include Yast::Logger

def main
textdomain "base"
Yast.import "Popup"
Expand All @@ -41,6 +43,24 @@ def main
@tmpfiles = []
end

def method_missing(method_name, *args, &block)
if ::FileUtils.respond_to?(method_name)
log.warn "#{caller(1).first} called the #{method_name} which is not defined in Yast::FileUtils"
log.warn "Falling back to the FileUtils Ruby module"

::FileUtils.public_send(method_name, *args, &block)
else
super
end
end

def respond_to_missing?(method_name, include_all = false)
log.info "Yast::FileUtils does not respond to #{method_name}"
log.warn "Checking if the FileUtils Ruby module does it"

::FileUtils.respond_to?(method_name) || super
end

# Function which determines if the requested file/directory exists.
#
# @return true if exists
Expand Down

0 comments on commit 3eed13a

Please sign in to comment.