Skip to content

Commit

Permalink
argument changes to support ruby 3
Browse files Browse the repository at this point in the history
Signed-off-by: jayashri garud <[email protected]>
  • Loading branch information
jayashrig158 committed Apr 26, 2021
1 parent 0760422 commit fac4b91
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/omnibus/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,16 @@ def bundle(command, options = {})
# @param (see #command)
# @return (see #command)
#
def appbundle(software_name, lockdir: nil, gem: nil, without: nil, extra_bin_files: nil , **options)
def appbundle(software_name, options = {})
build_commands << BuildCommand.new("appbundle `#{software_name}'") do
bin_dir = "#{install_dir}/bin"
appbundler_bin = embedded_bin("appbundler")

lockdir = options[:lockdir]
gem = options[:gem]
without = options[:without]
extra_bin_files = options[:extra_bin_files]

lockdir ||=
begin
app_software = project.softwares.find do |p|
Expand Down Expand Up @@ -535,7 +540,7 @@ def erb(options = {})
def mkdir(directory, options = {})
build_commands << BuildCommand.new("mkdir `#{directory}'") do
Dir.chdir(software.project_dir) do
FileUtils.mkdir_p(directory, options)
FileUtils.mkdir_p(directory, **options)
end
end
end
Expand All @@ -557,7 +562,7 @@ def touch(file, options = {})
parent = File.dirname(file)
FileUtils.mkdir_p(parent) unless File.directory?(parent)

FileUtils.touch(file, options)
FileUtils.touch(file, **options)
end
end
end
Expand All @@ -578,7 +583,7 @@ def delete(path, options = {})
build_commands << BuildCommand.new("delete `#{path}'") do
Dir.chdir(software.project_dir) do
FileSyncer.glob(path).each do |file|
FileUtils.rm_rf(file, options)
FileUtils.rm_rf(file, **options)
end
end
end
Expand Down Expand Up @@ -629,7 +634,7 @@ def copy(source, destination, options = {})
log.warn(log_key) { "no matched files for glob #{command}" }
else
files.each do |file|
FileUtils.cp_r(file, destination, options)
FileUtils.cp_r(file, destination, **options)
end
end
end
Expand Down Expand Up @@ -658,7 +663,7 @@ def move(source, destination, options = {})
log.warn(log_key) { "no matched files for glob #{command}" }
else
files.each do |file|
FileUtils.mv(file, destination, options)
FileUtils.mv(file, destination, **options)
end
end
end
Expand All @@ -683,14 +688,14 @@ def link(source, destination, options = {})
build_commands << BuildCommand.new(command) do
Dir.chdir(software.project_dir) do
if options.delete(:unchecked)
FileUtils.ln_s(source, destination, options)
FileUtils.ln_s(source, destination, **options)
else
files = FileSyncer.glob(source)
if files.empty?
log.warn(log_key) { "no matched files for glob #{command}" }
else
files.each do |file|
FileUtils.ln_s(file, destination, options)
FileUtils.ln_s(file, destination, **options)
end
end
end
Expand Down

0 comments on commit fac4b91

Please sign in to comment.