Skip to content

Commit

Permalink
Namespace some more items
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-hill authored and barancev committed Oct 30, 2019
1 parent 300611b commit c2de389
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
26 changes: 15 additions & 11 deletions rake_tasks/crazy_fun/mappings/file_copy_hack.rb
Original file line number Diff line number Diff line change
@@ -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
17 changes: 11 additions & 6 deletions rake_tasks/crazy_fun/mappings/folder_mappings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion rake_tasks/crazy_fun/mappings/tasks.rb
Original file line number Diff line number Diff line change
@@ -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? "//"
Expand Down

0 comments on commit c2de389

Please sign in to comment.