8000 fix: update syntax for Ruby 3 by coaxial · Pull Request #269 · maid/maid · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: update syntax for Ruby 3 #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/maid/tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def move(sources, destination)
if File.directory?(expanded_destination)
expand_all(sources).each do |source|
log("move #{sh_escape(source)} #{sh_escape(expanded_destination)}")
FileUtils.mv(source, expanded_destination, @file_options)
FileUtils.mv(source, expanded_destination, **@file_options)
end
else
# Unix `mv` warns about the target not being a directory with multiple sources. Maid checks the same.
Expand Down Expand Up @@ -84,7 +84,7 @@ def rename(source, destination)
warn("skipping rename of #{sh_escape(source)} to #{sh_escape(destination)} because it would overwrite")
else
log("rename #{sh_escape(source)} #{sh_escape(destination)}")
FileUtils.mv(source, destination, @file_options)
FileUtils.mv(source, destination, **@file_options)
end
end

Expand Down Expand Up @@ -178,7 +178,7 @@ def copy(sources, destination)
warn("skipping copy because #{sh_escape(source)} because #{sh_escape(target)} already exists")
else
log("cp #{sh_escape(source)} #{sh_escape(destination)}")
FileUtils.cp(source, destination, @file_options)
FileUtils.cp(source, destination, **@file_options)
end
end
end
Expand Down Expand Up @@ -217,7 +217,7 @@ def remove(paths, options = {})
options = @file_options.merge(options)

log("Removing #{sh_escape(path)}")
FileUtils.rm_r(path, options)
FileUtils.rm_r(path, **options)
end
end

Expand Down Expand Up @@ -311,7 +311,7 @@ def escape_glob(glob)
def mkdir(path, options = {})
path = expand(path)
log("mkdir -p #{sh_escape(path)}")
FileUtils.mkdir_p(path, @file_options.merge(options))
FileUtils.mkdir_p(path, **@file_options.merge(options))
path
end

Expand Down
0