15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'ext/page_print/extconf.rb', line 15
def restore_vendor_so_aliases(vendor_lib_dir)
manifest_path = File.join(vendor_lib_dir, 'so_aliases')
return unless File.file?(manifest_path)
File.foreach(manifest_path) do |line|
alias_name, target_name = line.strip.split("\t", 2)
next if alias_name.nil? || alias_name.empty? || target_name.nil? || target_name.empty?
next if alias_name.include?('/') || target_name.include?('/') || alias_name.start_with?('.') || target_name.start_with?('.')
alias_path = File.join(vendor_lib_dir, alias_name)
target_path = File.join(vendor_lib_dir, target_name)
next unless File.file?(target_path)
next if File.exist?(alias_path) || File.symlink?(alias_path)
File.symlink(target_name, alias_path)
end
end
|