Skip to content

Commit

Permalink
Fixup the ugly patching of FileUtils.cp / cp_r
Browse files Browse the repository at this point in the history
Not sure why copy is even overriden... It's an alias to cp anyways.

Read https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
  • Loading branch information
jmarrec committed Apr 19, 2024
1 parent d4e6381 commit 6525992
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ruby/engine/embedded_help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ class << self
alias :original_cp :cp
end

def self.cp_r(src, dest, options = {})
def self.cp_r(src, dest, ...)
#puts "cp_r #{src} to #{dest}"
if src.to_s.chars.first == ':' then
absolute_path = OpenStudio.get_absolute_path(src)
Expand Down Expand Up @@ -732,10 +732,10 @@ def self.cp_r(src, dest, options = {})
end
end

self.original_cp_r(src, dest, options)
self.original_cp_r(src, dest, ...)
end

def self.cp(src, dest, options = {})
def self.cp(src, dest, ...)
#puts "cp #{src} to #{dest}"
if src.to_s.chars.first == ':' then
absolute_path = OpenStudio.get_absolute_path(src)
Expand All @@ -760,11 +760,11 @@ def self.cp(src, dest, options = {})
end
end

self.original_cp(src, dest, options)
self.original_cp(src, dest, ...)
end

def self.copy(src, dest, options = {})
return self.cp(src, dest, options)
def self.copy(src, dest, ...)
return self.cp(src, dest, ...)
end
end

Expand Down

0 comments on commit 6525992

Please sign in to comment.