Skip to content

Commit 100a51f

Browse files
committed
Changes based on review.
1 parent 71458b4 commit 100a51f

File tree

5 files changed

+4
-90
lines changed

5 files changed

+4
-90
lines changed

lib/cext/patches/common_patches.rb

Lines changed: 0 additions & 78 deletions
This file was deleted.

lib/cext/patches/json_patches.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
# GNU General Public License version 2, or
77
# GNU Lesser General Public License version 2.1.
88

9-
require_relative 'common_patches'
10-
11-
class JsonPatches < CommonPatches
9+
class JsonPatches
1210
PATCHES = {
1311
gem: 'json',
1412
patches: {

lib/cext/patches/nokogiri_patches.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
# Patches nokogiri 1.8.1
1010

11-
require_relative 'common_patches'
12-
13-
class NokogiriPatches < CommonPatches
11+
class NokogiriPatches
1412

1513
XML_NODE_SET_PATCH = <<-EOF
1614
switch (rb_tr_to_int_const(rb_range_beg_len(arg, &beg, &len, (long)node_set->nodeNr, 0))) {

lib/cext/patches/pg_patches.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
# GNU General Public License version 2, or
77
# GNU Lesser General Public License version 2.1.
88

9-
require_relative 'common_patches'
10-
119
# Tested with pg version 0.21.0
12-
class PgPatches < CommonPatches
10+
class PgPatches
1311

1412
PG_BINARY_ENCODER_PATCH = <<-EOF
1513
switch(rb_tr_to_int_const(value)){

lib/cext/preprocess.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# GNU General Public License version 2, or
77
# GNU Lesser General Public License version 2.1.
88

9-
require_relative 'patches/common_patches'
10-
119
require_relative 'patches/json_patches'
1210
require_relative 'patches/nokogiri_patches'
1311
require_relative 'patches/pg_patches'
@@ -49,7 +47,7 @@ def self.patch(file, contents, directory)
4947
directory.end_with?(File.join(patched_file[:gem], 'ext', patched_file[:ext_dir]))
5048
else
5149
regexp = /^#{Regexp.escape(patched_file[:gem])}\b/
52-
directory.split('/').last(7).any? { |part| part =~ regexp } || file.split('/').last(2).any? { |part| part =~ regexp }
50+
directory.split('/').last(3).any? { |part| part =~ regexp } || file.split('/').last(2).any? { |part| part =~ regexp }
5351
end
5452
if matched
5553
patched_file[:patches].each do |patch|

0 commit comments

Comments
 (0)