bundler-patch 1.1.0.pre3 → 1.1.0.pre4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bundler/patch/cli.rb +14 -9
- data/lib/bundler/patch/target_bundle.rb +4 -0
- data/lib/bundler/patch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df6792e5e314e509f2cc1d71baed6900e77a175d
|
4
|
+
data.tar.gz: e3ee93884719854d29bd5feba495fc8099af6984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9360b34b07c2b4733b97cb72d9305cf1264520732b43bdf18e53a96b98ae16ab89a1da4322ced5d14dd3c8c97350cbe9bceceace9b36c67506e7bd668c5407f
|
7
|
+
data.tar.gz: adb7f5871ad2cb7b6a6d9778d301b4ca08f2e7367e09bc6533fd7443898bb1d68faf8756a3fecc893d1719ac3fcf35616aa1af659405e372ef19594de8a412fb
|
data/lib/bundler/patch/cli.rb
CHANGED
@@ -65,14 +65,9 @@ module Bundler::Patch
|
|
65
65
|
|
66
66
|
options = Bundler::Patch::CLI::Options.new.normalize_options(options)
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
tb.install_bundler_patch_in_target
|
72
|
-
bundler_patch = File.join(tb.ruby_bin, 'bundler-patch') # uses 'latest' bundler-patch, which can work after we've installed ours.
|
73
|
-
full_command = "#{ruby} #{bundler_patch} #{options[:original_command].gsub(/use_target_ruby/, '')}"
|
74
|
-
result = shell_command(full_command)
|
75
|
-
puts result[:stdout] unless ENV['BP_DEBUG']
|
68
|
+
tb = options[:target]
|
69
|
+
if options[:use_target_ruby] && tb.target_ruby_is_different?
|
70
|
+
launch_target_bundler_patch(options)
|
76
71
|
else
|
77
72
|
return list(options) if options[:list]
|
78
73
|
|
@@ -82,6 +77,16 @@ module Bundler::Patch
|
|
82
77
|
end
|
83
78
|
end
|
84
79
|
|
80
|
+
def launch_target_bundler_patch(options)
|
81
|
+
tb = options[:target]
|
82
|
+
ruby = tb.ruby_bin_exe
|
83
|
+
tb.install_bundler_patch_in_target
|
84
|
+
bundler_patch = File.join(tb.ruby_bin, 'bundler-patch')
|
85
|
+
full_command = "#{ruby} #{bundler_patch} #{options[:original_command].gsub(/use_target_ruby/, '')}"
|
86
|
+
result = shell_command(full_command)
|
87
|
+
puts result[:stdout] unless ENV['BP_DEBUG']
|
88
|
+
end
|
89
|
+
|
85
90
|
private
|
86
91
|
|
87
92
|
def list(options)
|
@@ -152,9 +157,9 @@ module Bundler::Patch
|
|
152
157
|
end
|
153
158
|
|
154
159
|
def shell_command(command)
|
160
|
+
puts "-command: #{command}" if ENV['BP_DEBUG']
|
155
161
|
stdout, stderr, status = Open3.capture3(command)
|
156
162
|
if ENV['BP_DEBUG']
|
157
|
-
puts "-command: #{command}"
|
158
163
|
puts "--stdout:#{indent(stdout)}"
|
159
164
|
puts "--stderr:#{indent(stderr)}"
|
160
165
|
end
|
@@ -71,6 +71,10 @@ class TargetBundle
|
|
71
71
|
File.join(ruby_bin, "#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}")
|
72
72
|
end
|
73
73
|
|
74
|
+
def target_ruby_is_different?
|
75
|
+
!(ruby_bin == RbConfig::CONFIG['bindir'])
|
76
|
+
end
|
77
|
+
|
74
78
|
# Have to run a separate process in the other Ruby, because Gem.default_dir depends on
|
75
79
|
# RbConfig::CONFIG which is all special data derived from the active runtime. It could perhaps
|
76
80
|
# be redone here, but I'd rather not copy that code in here at the moment.
|