diff --git a/rake_tasks/crazy_fun/mappings/file_copy_hack.rb b/rake_tasks/crazy_fun/mappings/file_copy_hack.rb index db90028d400e7..b4f34af84c794 100644 --- a/rake_tasks/crazy_fun/mappings/file_copy_hack.rb +++ b/rake_tasks/crazy_fun/mappings/file_copy_hack.rb @@ -1,15 +1,19 @@ -module FileCopyHack - def cp_r(src, dest, opts = {}) - super - rescue => ex - raise unless ex.message =~ /operation not permitted|Permission denied/i - Dir["#{dest}/**/.svn"].each { |file| rm_rf file } +module CrazyFun + module Mappings + module FileCopyHack + def cp_r(src, dest, opts = {}) + super + rescue => ex + raise unless ex.message =~ /operation not permitted|Permission denied/i + Dir["#{dest}/**/.svn"].each { |file| rm_rf file } - # virtual box shared folders has a problem with some of the .svn files - if ENV['USER'] == "vagrant" && opts.empty? - sh "cp", "-r", src, dest - else - super(src, dest, opts) + # virtual box shared folders has a problem with some of the .svn files + if ENV['USER'] == "vagrant" && opts.empty? + sh "cp", "-r", src, dest + else + super(src, dest, opts) + end + end end end end diff --git a/rake_tasks/crazy_fun/mappings/folder_mappings.rb b/rake_tasks/crazy_fun/mappings/folder_mappings.rb index c0f6f71044c77..2db7067129c45 100644 --- a/rake_tasks/crazy_fun/mappings/folder_mappings.rb +++ b/rake_tasks/crazy_fun/mappings/folder_mappings.rb @@ -10,11 +10,16 @@ # ], # out = "outputfolder") - -class FolderMappings - def add_all(fun) - fun.add_mapping("folder", Folder::CheckPreconditions.new) - fun.add_mapping("folder", Folder::CreateTask.new) - fun.add_mapping("folder", Folder::AddDependencies.new) +module CrazyFun + module Mappings + class FolderMappings + # TODO: LH - Check the usage of this. It seems it isn't consumed + # If so all downstream fun mappings (Folder::), can be removed + def add_all(fun) + fun.add_mapping("folder", Folder::CheckPreconditions.new) + fun.add_mapping("folder", Folder::CreateTask.new) + fun.add_mapping("folder", Folder::AddDependencies.new) + end + end end end diff --git a/rake_tasks/crazy_fun/mappings/tasks.rb b/rake_tasks/crazy_fun/mappings/tasks.rb index 1734095c25ace..eef989964d412 100644 --- a/rake_tasks/crazy_fun/mappings/tasks.rb +++ b/rake_tasks/crazy_fun/mappings/tasks.rb @@ -1,7 +1,7 @@ require_relative 'file_copy_hack' class Tasks - include FileCopyHack + include CrazyFun::Mappings::FileCopyHack def task_name(dir, name) return name if name.to_s.start_with? "//"