|
10 | 10 | require_relative 'patches/nokogiri_patches'
|
11 | 11 | require_relative 'patches/oci8_patches'
|
12 | 12 | require_relative 'patches/pg_patches'
|
| 13 | +require_relative 'patches/tk_patches' |
13 | 14 |
|
14 | 15 | module Truffle
|
15 | 16 | module CExt
|
@@ -39,12 +40,13 @@ def self.add_gem_patches(patch_hash, gem_patches)
|
39 | 40 | add_gem_patches(PATCHED_FILES, ::NokogiriPatches::PATCHES)
|
40 | 41 | add_gem_patches(PATCHED_FILES, ::OCI8Patches::PATCHES)
|
41 | 42 | add_gem_patches(PATCHED_FILES, ::PgPatches::PATCHES)
|
| 43 | + add_gem_patches(PATCHED_FILES, ::TkPatches::PATCHES) |
42 | 44 |
|
43 | 45 | def self.makefile_matcher(command1, command2)
|
44 | 46 | file_list = Hash.new { |h,k| h[k] = [] }
|
45 | 47 | PATCHED_FILES.each_pair do |file, patch|
|
46 | 48 | dir = if patch[:ext_dir]
|
47 |
| - File.join(patch[:gem], 'ext', patch[:ext_dir]) |
| 49 | + File.join('ext', patch[:ext_dir]) |
48 | 50 | else
|
49 | 51 | "/#{patch[:gem]}"
|
50 | 52 | end
|
@@ -85,7 +87,7 @@ def self.makefile_matcher(command1, command2)
|
85 | 87 | def self.patch(file, contents, directory)
|
86 | 88 | if patched_file = PATCHED_FILES[File.basename(file)]
|
87 | 89 | matched = if patched_file[:ext_dir]
|
88 |
| - directory.end_with?(File.join(patched_file[:gem], 'ext', patched_file[:ext_dir])) |
| 90 | + directory.end_with?('ext', patched_file[:ext_dir]) |
89 | 91 | else
|
90 | 92 | regexp = /^#{Regexp.escape(patched_file[:gem])}\b/
|
91 | 93 | directory.split('/').last(3).any? { |part| part =~ regexp } || file.split('/').last(2).any? { |part| part =~ regexp }
|
|
0 commit comments