Skip to content

Commit

Permalink
Do not copy platform/version dependent file to independent path
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Oct 22, 2021
1 parent f6a1b10 commit 6f6039e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ Rake::TestTask.new(:test) do |t|
end

require 'rake/extensiontask'
Rake::ExtensionTask.new(name)
class << Rake::ExtensionTask.new(name)
def evil_copy?(src, dest)
version = %r[/\d+(?:\.\d+){1,2}/]
src.include?(platform) and version =~ src and !(dest.include?(platform) and version =~ dest)
end

def install(src, dest, **)
return if evil_copy?(src, dest)
super
end
def cp(src, dest, **)
return if evil_copy?(src, dest)
super
end
end

task :test => :compile

task :default => :test

0 comments on commit 6f6039e

Please sign in to comment.