rubygems-update 0.8.10 → 0.8.11

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (51) hide show
  1. data/ChangeLog +66 -0
  2. data/README +17 -3
  3. data/Rakefile +29 -11
  4. data/bin/gem_mirror +67 -0
  5. data/examples/application/an-app.gemspec +2 -0
  6. data/lib/rubygems.rb +18 -3
  7. data/lib/rubygems/builder.rb +14 -1
  8. data/lib/rubygems/cmd_manager.rb +2 -0
  9. data/lib/rubygems/command.rb +26 -2
  10. data/lib/rubygems/custom_require.rb +30 -21
  11. data/lib/rubygems/format.rb +4 -4
  12. data/lib/rubygems/gem_commands.rb +161 -9
  13. data/lib/rubygems/gem_openssl.rb +34 -0
  14. data/lib/rubygems/gem_runner.rb +5 -1
  15. data/lib/rubygems/installer.rb +117 -38
  16. data/lib/rubygems/package.rb +135 -25
  17. data/lib/rubygems/remote_installer.rb +59 -29
  18. data/lib/rubygems/rubygems_version.rb +1 -1
  19. data/lib/rubygems/security.rb +478 -0
  20. data/lib/rubygems/specification.rb +48 -28
  21. data/post-install.rb +2 -1
  22. data/scripts/gemdoc.rb +2 -2
  23. data/scripts/specdoc.rb +25 -24
  24. data/scripts/upload_gemdoc.rb +134 -0
  25. data/setup.rb +1 -1
  26. data/test/data/a-0.0.1.gem +0 -0
  27. data/test/data/a-0.0.2.gem +0 -0
  28. data/test/data/b-0.0.2.gem +0 -0
  29. data/test/data/c-1.2.gem +0 -0
  30. data/test/data/gemhome/cache/a-0.0.1.gem +0 -0
  31. data/test/data/gemhome/cache/a-0.0.2.gem +0 -0
  32. data/test/data/gemhome/cache/b-0.0.2.gem +0 -0
  33. data/test/data/gemhome/cache/c-1.2.gem +0 -0
  34. data/test/data/gemhome/specifications/a-0.0.1.gemspec +1 -1
  35. data/test/data/gemhome/specifications/a-0.0.2.gemspec +1 -1
  36. data/test/data/gemhome/specifications/b-0.0.2.gemspec +1 -1
  37. data/test/data/gemhome/specifications/c-1.2.gemspec +1 -1
  38. data/test/data/one/one-0.0.1.gem +0 -0
  39. data/test/fake_certlib/openssl.rb +1 -0
  40. data/test/functional.rb +49 -14
  41. data/test/gemutilities.rb +69 -5
  42. data/test/test_cached_fetcher.rb +5 -7
  43. data/test/test_file_list.rb +96 -0
  44. data/test/test_gempaths.rb +36 -34
  45. data/test/test_installer.rb +214 -0
  46. data/test/test_local_cache.rb +45 -102
  47. data/test/test_parse_commands.rb +3 -1
  48. data/test/test_remote_installer.rb +24 -5
  49. data/test/test_specific_extras.rb +40 -0
  50. data/test/test_specification.rb +106 -16
  51. metadata +14 -3
@@ -26,7 +26,7 @@ module Gem
26
26
  #
27
27
  # file_path:: [String] Path to the gem file
28
28
  #
29
- def self.from_file_by_path(file_path)
29
+ def self.from_file_by_path(file_path, security_policy = nil)
30
30
  unless File.exist?(file_path)
31
31
  raise Gem::Exception, "Cannot load gem at [#{file_path}]"
32
32
  end
@@ -38,7 +38,7 @@ module Gem
38
38
  return OldFormat.from_file_by_path(file_path)
39
39
  else
40
40
  f = File.open(file_path, 'rb')
41
- return from_io(f, file_path)
41
+ return from_io(f, file_path, security_policy)
42
42
  end
43
43
  end
44
44
 
@@ -48,9 +48,9 @@ module Gem
48
48
  #
49
49
  # io:: [IO] Stream from which to read the gem
50
50
  #
51
- def self.from_io(io, gem_path="(io)")
51
+ def self.from_io(io, gem_path="(io)", security_policy = nil)
52
52
  format = self.new(gem_path)
53
- Package.open_from_io(io) do |pkg|
53
+ Package.open_from_io(io, 'r', security_policy) do |pkg|
54
54
  format.spec = pkg.metadata
55
55
  format.file_entries = []
56
56
  pkg.each do |entry|
@@ -51,6 +51,9 @@ module Gem
51
51
  end
52
52
  end
53
53
 
54
+ ##
55
+ # OptionParser options specific to the gem install command.
56
+
54
57
  module InstallUpdateOptions
55
58
  def add_install_update_options
56
59
  add_option('-i', '--install-dir DIR', '') do |value, options|
@@ -65,18 +68,28 @@ module Gem
65
68
  add_option('-t', '--[no-]test', 'Run unit tests prior to installation') do |value, options|
66
69
  options[:test] = value
67
70
  end
71
+ add_option('-w', '--[no-]wrappers', 'Use bin wrappers for executables',
72
+ 'Not available on dosish platforms') do |value, options|
73
+ options[:wrappers] = value
74
+ end
75
+ add_option('-P', '--trust-policy POLICY', 'Specify gem trust policy.') do |value, options|
76
+ options[:security_policy] = value
77
+ end
68
78
  add_option('--ignore-dependencies',
69
79
  'Do not install any required dependent gems') do |value, options|
70
80
  options[:ignore_dependencies] = value
71
81
  end
72
- add_option('--include-dependencies',
82
+ add_option('-y', '--include-dependencies',
73
83
  'Unconditionally install the required dependent gems') do |value, options|
74
84
  options[:include_dependencies] = value
75
85
  end
76
86
  end
77
87
 
88
+ ##
89
+ # Default options for the gem install command.
90
+
78
91
  def install_update_defaults_str
79
- '--rdoc --no-force --no-test'
92
+ '--rdoc --no-force --no-test --wrappers'
80
93
  end
81
94
  end
82
95
 
@@ -88,7 +101,9 @@ module Gem
88
101
  end
89
102
  end
90
103
 
91
- ####################################################################
104
+ ##
105
+ # Gem install command.
106
+
92
107
  class InstallCommand < Command
93
108
  include CommandAids
94
109
  include VersionOption
@@ -104,15 +119,16 @@ module Gem
104
119
  :generate_rdoc => true,
105
120
  :force => false,
106
121
  :test => false,
122
+ :wrappers => true,
107
123
  :version => "> 0",
108
- :install_dir => Gem.dir
124
+ :install_dir => Gem.dir,
125
+ :security_policy => nil,
109
126
  })
110
127
  add_version_option('install')
111
128
  add_local_remote_options
112
129
  add_install_update_options
113
130
  end
114
131
 
115
-
116
132
  def usage
117
133
  "#{program_name} GEMNAME"
118
134
  end
@@ -260,6 +276,77 @@ module Gem
260
276
  end
261
277
  end
262
278
 
279
+ class CertCommand < Command
280
+ include CommandAids
281
+
282
+ def initialize
283
+ super(
284
+ 'cert',
285
+ 'Adjust RubyGems certificate settings.',
286
+ {
287
+ })
288
+
289
+ add_option('-a', '--add CERT', 'Add a trusted certificate.') do |value, options|
290
+ cert = OpenSSL::X509::Certificate.new(File.read(value))
291
+ Gem::Security.add_trusted_cert(cert)
292
+ puts "Added #{cert.subject.to_s}"
293
+ end
294
+
295
+ add_option('-l', '--list', 'List trusted certificates.') do |value, options|
296
+ glob_str = File::join(Gem::Security::OPT[:trust_dir], '*.pem')
297
+ Dir::glob(glob_str) do |path|
298
+ cert = OpenSSL::X509::Certificate.new(File.read(path))
299
+ # this could proably be formatted more gracefully
300
+ puts cert.subject.to_s
301
+ end
302
+ end
303
+
304
+ add_option('-r', '--remove STRING', 'Remove trusted certificates containing STRING.') do |value, options|
305
+ trust_dir = Gem::Security::OPT[:trust_dir]
306
+ glob_str = File::join(trust_dir, '*.pem')
307
+
308
+ Dir::glob(glob_str) do |path|
309
+ cert = OpenSSL::X509::Certificate.new(File.read(path))
310
+ if cert.subject.to_s.downcase.index(value)
311
+ puts "Removing '#{cert.subject.to_s}'"
312
+ File.unlink(path)
313
+ end
314
+ end
315
+ end
316
+
317
+ add_option('-b', '--build EMAIL_ADDR', 'Build private key and self-signed certificate for EMAIL_ADDR.') do |value, options|
318
+ vals = Gem::Security::build_self_signed_cert(value)
319
+ File::chmod(0600, vals[:key_path])
320
+ puts "Public Cert: #{vals[:cert_path]}",
321
+ "Private Key: #{vals[:key_path]}",
322
+ "Don't forget to move the key file to somewhere private..."
323
+ end
324
+
325
+ add_option('-C', '--certificate CERT', 'Certificate for --sign command.') do |value, options|
326
+ cert = OpenSSL::X509::Certificate.new(File.read(value))
327
+ Gem::Security::OPT[:issuer_cert] = cert
328
+ end
329
+
330
+ add_option('-K', '--private-key KEY', 'Private key for --sign command.') do |value, options|
331
+ key = OpenSSL::PKey::RSA.new(File.read(value))
332
+ Gem::Security::OPT[:issuer_key] = key
333
+ end
334
+
335
+
336
+ add_option('-s', '--sign NEWCERT', 'Sign a certificate with my key and certificate.') do |value, options|
337
+ cert = OpenSSL::X509::Certificate.new(File.read(value))
338
+ my_cert = Gem::Security::OPT[:issuer_cert]
339
+ my_key = Gem::Security::OPT[:issuer_key]
340
+ cert = Gem::Security.sign_cert(cert, my_key, my_cert)
341
+ File::open(value, 'wb') { |file| file.write(cert.to_pem) }
342
+ end
343
+
344
+ end
345
+
346
+ def execute
347
+ end
348
+ end
349
+
263
350
  ####################################################################
264
351
  class DependencyCommand < Command
265
352
  include VersionOption
@@ -403,7 +490,7 @@ module Gem
403
490
  if options[:verify]
404
491
  gem_name = options[:verify]
405
492
  unless gem_name
406
- alert_error "Must specifiy a .gem file with --verify NAME"
493
+ alert_error "Must specify a .gem file with --verify NAME"
407
494
  return
408
495
  end
409
496
  unless File.exist?(gem_name)
@@ -487,7 +574,7 @@ module Gem
487
574
  summary,
488
575
  {:name=>/.*/, :domain=>:local, :details=>false}
489
576
  )
490
- add_option('-n', '--name-matches REGEXP', 'Name of gem(s) to query on maches the provided REGEXP') do |value, options|
577
+ add_option('-n', '--name-matches REGEXP', 'Name of gem(s) to query on matches the provided REGEXP') do |value, options|
491
578
  options[:name] = /#{value}/i
492
579
  end
493
580
  add_option('-d', '--[no-]details', 'Display detailed information of gem(s)') do |value, options|
@@ -635,7 +722,7 @@ module Gem
635
722
  def initialize
636
723
  super(
637
724
  'update',
638
- 'Upgrade currently installed gems in the local repository',
725
+ 'Upgrade the named gem (or all installed gems) in the local repository',
639
726
  {
640
727
  :generate_rdoc => true,
641
728
  :force => false,
@@ -709,7 +796,7 @@ module Gem
709
796
  update_dir = File.join(Gem.dir, "gems", "rubygems-update-#{version_string}")
710
797
  Dir.chdir(update_dir) do
711
798
  puts "Installing RubyGems #{version_string}"
712
- system "ruby setup.rb"
799
+ system "#{Gem.ruby} setup.rb"
713
800
  end
714
801
  end
715
802
 
@@ -1089,6 +1176,71 @@ module Gem
1089
1176
  end
1090
1177
  end
1091
1178
 
1179
+ class ContentsCommand < Command
1180
+ include CommandAids
1181
+ def initialize
1182
+ super('contents','Disply the contents of the installed gems', {:list => true, :specdirs => [] })
1183
+ add_option("-l","--list",'List the files inside a Gem') do |v,o|
1184
+ o[:list] = true
1185
+ end
1186
+
1187
+ add_option("-V","--version","Specify version for gem to view") do |v,o|
1188
+ o[:version] = v
1189
+ end
1190
+
1191
+ add_option('-s','--spec-dir a,b,c', Array, "Search for gems under specific paths") do |v,o|
1192
+ o[:specdirs] = v
1193
+ end
1194
+
1195
+ add_option('-v','--verbose','Be verbose when showing status') do |v,o|
1196
+ o[:verbose] = v
1197
+ end
1198
+ end
1199
+
1200
+ def execute(io=STDOUT)
1201
+ if options[:list]
1202
+ version = options[:version] || "> 0.0.0"
1203
+ gem = get_one_gem_name
1204
+
1205
+ s = options[:specdirs].map do |i|
1206
+ [i, File.join(i,"specifications")]
1207
+ end.flatten
1208
+
1209
+ if s.empty?
1210
+ path_kind = "default gem paths"
1211
+ system = true
1212
+ else
1213
+ path_kind = "specified path"
1214
+ system = false
1215
+ end
1216
+
1217
+ si = Gem::SourceIndex.from_installed_gems(*s)
1218
+
1219
+ gem_spec = si.search(gem, version).first
1220
+ unless gem_spec
1221
+ io.puts "Unable to find gem '#{gem}' in #{path_kind}"
1222
+ if options[:verbose]
1223
+ io.puts "\nDirectories searched:"
1224
+ if system
1225
+ Gem.path.each do |p|
1226
+ io.puts p
1227
+ end
1228
+ else
1229
+ s.each do |p|
1230
+ io.puts p
1231
+ end
1232
+ end
1233
+ end
1234
+ return
1235
+ end
1236
+ # show the list of files.
1237
+ gem_spec.files.each do |f|
1238
+ io.puts File.join(gem_spec.full_gem_path, f)
1239
+ end
1240
+ end
1241
+ end
1242
+ end
1243
+
1092
1244
  end # module
1093
1245
 
1094
1246
  ## Documentation Constants
@@ -0,0 +1,34 @@
1
+
2
+ # Some system might not have OpenSSL installed, therefore the core
3
+ # library file openssl might not be available. We localize testing
4
+ # for the presence of OpenSSL in this file.
5
+
6
+ module Gem
7
+ class << self
8
+ # Is SSL (used by the signing commands) available on this
9
+ # platform?
10
+ def ssl_available?
11
+ require 'rubygems/gem_openssl'
12
+ @ssl_available
13
+ end
14
+
15
+ # Set the value of the ssl_avilable flag.
16
+ attr_writer :ssl_available
17
+
18
+ # Ensure that SSL is available. Throw an exception if it is not.
19
+ def ensure_ssl_available
20
+ unless ssl_available?
21
+ fail Gem::Exception, "SSL is not installed on this system"
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ begin
28
+ require 'openssl'
29
+ Gem.ssl_available = true
30
+ rescue LoadError
31
+ Gem.ssl_available = false
32
+ rescue
33
+ Gem.ssl_available = false
34
+ end
@@ -6,7 +6,11 @@ module Gem
6
6
 
7
7
  def run(args)
8
8
  do_configuration(args)
9
- Gem::CommandManager.instance.run(@cfg)
9
+ cmd = Gem::CommandManager.instance
10
+ cmd.command_names.each do |c|
11
+ Command.add_specific_extra_args c, Array(@cfg[c])
12
+ end
13
+ cmd.run(@cfg)
10
14
  end
11
15
 
12
16
  private
@@ -1,3 +1,5 @@
1
+ $TESTING = false unless defined? $TESTING
2
+
1
3
  require 'pathname'
2
4
  require 'rbconfig'
3
5
  require 'rubygems/format'
@@ -12,7 +14,7 @@ module Gem
12
14
  # files contained in the .gem into the Gem.path.
13
15
  #
14
16
  class Installer
15
-
17
+
16
18
  include UserInteraction
17
19
 
18
20
  ##
@@ -44,7 +46,15 @@ module Gem
44
46
  #
45
47
  def install(force=false, install_dir=Gem.dir, ignore_this_parameter=false)
46
48
  require 'fileutils'
47
- format = Gem::Format.from_file_by_path(@gem)
49
+
50
+ # if we're forcing the install, then disable security, _unless_
51
+ # the security policy says that we only install singed gems
52
+ # (this includes Gem::Security::HighSecurity)
53
+ security_policy = @options[:security_policy]
54
+ security_policy = nil if force && security_policy &&
55
+ security_policy.only_signed != true
56
+
57
+ format = Gem::Format.from_file_by_path(@gem, security_policy)
48
58
  unless force
49
59
  spec = format.spec
50
60
  # Check the Ruby version.
@@ -53,49 +63,66 @@ module Gem
53
63
  raise "#{spec.name} requires Ruby version #{rrv}"
54
64
  end
55
65
  end
56
- # Check the dependent gems.
57
- # NOTE: THe dependent gem check is disabled. WE SHOULD NOT
58
- # REQUIRE GEMS DURING INSTALLTION. If we need to check
59
- # dependencies, we need a different way.
60
- # unless @options[:ignore_dependencies]
61
- # spec.dependencies.each do |dep_gem|
62
- # # TODO: Does this take account of *versions*?
63
- # require_gem_with_options(dep_gem, [], :auto_require=>false)
64
- # end
65
- # end
66
+ unless @options[:ignore_dependencies]
67
+ spec.dependencies.each do |dep_gem|
68
+ ensure_dependency!(spec, dep_gem)
69
+ end
70
+ end
66
71
  end
67
72
 
68
73
  raise Gem::FilePermissionError.new(install_dir) unless File.writable?(install_dir)
69
74
 
70
75
  # Build spec dir.
71
- directory = File.join(install_dir, "gems", format.spec.full_name)
72
- FileUtils.mkdir_p directory
76
+ @directory = File.join(install_dir, "gems", format.spec.full_name)
77
+ FileUtils.mkdir_p @directory
73
78
 
74
- extract_files(directory, format)
75
- generate_bin_scripts(format.spec, install_dir)
76
- build_extensions(directory, format.spec)
79
+ extract_files(@directory, format)
80
+ generate_bin(format.spec, install_dir)
81
+ build_extensions(@directory, format.spec)
77
82
 
78
83
  # Build spec/cache/doc dir.
79
84
  build_support_directories(install_dir)
80
85
 
81
86
  # Write the spec and cache files.
82
87
  write_spec(format.spec, File.join(install_dir, "specifications"))
83
- unless(File.exist?(File.join(File.join(install_dir, "cache"), @gem.split(/\//).pop)))
84
- FileUtils.cp(@gem, File.join(install_dir, "cache"))
88
+ unless File.exist? File.join(install_dir, "cache", @gem.split(/\//).pop)
89
+ FileUtils.cp @gem, File.join(install_dir, "cache")
85
90
  end
86
91
 
87
92
  format.spec.loaded_from = File.join(install_dir, 'specifications', format.spec.full_name+".gemspec")
88
93
  return format.spec
89
94
  end
90
95
 
91
- #
96
+ ##
97
+ # Ensure that the dependency is satisfied by the current
98
+ # installation of gem. If it is not, then fail (i.e. throw and
99
+ # exception).
100
+ #
101
+ # spec :: Gem::Specification
102
+ # dependency :: Gem::Dependency
103
+ def ensure_dependency!(spec, dependency)
104
+ raise "#{spec.name} requires #{dependency.name} #{dependency.version_requirements} " unless
105
+ installation_satisfies_dependency?(dependency)
106
+ end
107
+
108
+ ##
109
+ # True if the current installed gems satisfy the given dependency.
110
+ #
111
+ # dependency :: Gem::Dependency
112
+ def installation_satisfies_dependency?(dependency)
113
+ current_index = SourceIndex.from_installed_gems
114
+ current_index.find_name(dependency.name, dependency.version_requirements).size > 0
115
+ end
116
+
117
+ ##
92
118
  # Unpacks the gem into the given directory.
93
119
  #
94
120
  def unpack(directory)
95
- format = Gem::Format.from_file_by_path(@gem)
121
+ format = Gem::Format.from_file_by_path(@gem, @options[:security_policy])
96
122
  extract_files(directory, format)
97
123
  end
98
124
 
125
+ ##
99
126
  # Given a root gem directory, build supporting directories for gem
100
127
  # if they do not already exist
101
128
  def build_support_directories(install_dir)
@@ -131,7 +158,44 @@ module Gem
131
158
  if Config::CONFIG["arch"] =~ /dos|win32/i
132
159
  script_name = filename + ".cmd"
133
160
  File.open(File.join(bindir, File.basename(script_name)), "w") do |file|
134
- file.puts "@ruby \"#{File.join(bindir,filename)}\" %*"
161
+ file.puts "@#{Gem.ruby} \"#{File.join(bindir,filename)}\" %*"
162
+ end
163
+ end
164
+ end
165
+
166
+ ##
167
+ # Determines the directory for binaries
168
+ #
169
+ def bindir(install_dir=Gem.dir)
170
+ if(install_dir == Gem.default_dir)
171
+ # mac framework support
172
+ if defined? RUBY_FRAMEWORK_VERSION
173
+ File.join(File.dirname(Config::CONFIG["sitedir"]), File.basename(Config::CONFIG["bindir"]))
174
+ else # generic install
175
+ Config::CONFIG['bindir']
176
+ end
177
+ else
178
+ File.join(install_dir, "bin")
179
+ end
180
+ end
181
+
182
+ def generate_bin(spec, install_dir=Gem.dir)
183
+ return unless spec.executables && ! spec.executables.empty?
184
+
185
+ # If the user has asked for the gem to be installed in
186
+ # a directory that is the system gem directory, then
187
+ # use the system bin directory, else create (or use) a
188
+ # new bin dir under the install_dir.
189
+ bindir = bindir(install_dir)
190
+
191
+ Dir.mkdir bindir unless File.exist? bindir
192
+ raise Gem::FilePermissionError.new(bindir) unless File.writable?(bindir)
193
+
194
+ spec.executables.each do |filename|
195
+ if @options[:wrappers] then
196
+ generate_bin_script spec, filename, bindir, install_dir
197
+ else
198
+ generate_bin_symlink spec, filename, bindir, install_dir
135
199
  end
136
200
  end
137
201
  end
@@ -139,22 +203,37 @@ module Gem
139
203
  ##
140
204
  # Creates the scripts to run the applications in the gem.
141
205
  #
142
- def generate_bin_scripts(spec, install_dir=Gem.dir)
143
- if spec.executables && ! spec.executables.empty?
144
- bindir = if(install_dir == Gem.default_dir)
145
- Config::CONFIG['bindir']
146
- else
147
- File.join(install_dir, "bin")
148
- end
149
- Dir.mkdir(bindir) unless File.exist?(bindir)
150
- raise Gem::FilePermissionError.new(bindir) unless File.writable?(bindir)
151
- spec.executables.each do |filename|
152
- File.open(File.join(bindir, File.basename(filename)), "w", 0755) do |file|
153
- file.print(app_script_text(spec, install_dir, filename))
154
- end
155
- generate_windows_script(bindir, filename)
206
+ def generate_bin_script(spec, filename, bindir, install_dir)
207
+ File.open(File.join(bindir, File.basename(filename)), "w", 0755) do |file|
208
+ file.print app_script_text(spec, install_dir, filename)
209
+ end
210
+ generate_windows_script bindir, filename
211
+ end
212
+
213
+ ##
214
+ # Creates the symlinks to run the applications in the gem. Moves
215
+ # the symlink if the gem being installed has a newer version.
216
+ #
217
+ def generate_bin_symlink(spec, filename, bindir, install_dir)
218
+ if Config::CONFIG["arch"] =~ /dos|win32/i then
219
+ warn "Unable to use symlinks on win32, installing wrapper" unless $TESTING # HACK
220
+ generate_bin_script spec, filename, bindir, install_dir
221
+ return
222
+ end
223
+
224
+ src = File.join @directory, 'bin', filename
225
+ dst = File.join bindir, File.basename(filename)
226
+
227
+ if File.exist? dst then
228
+ if File.symlink? dst then
229
+ link = File.readlink(dst).split File::SEPARATOR
230
+ cur_version = Gem::Version.create(link[-3].sub(/^.*-/, ''))
231
+ return if spec.version < cur_version
156
232
  end
233
+ File.unlink dst
157
234
  end
235
+
236
+ File.symlink src, dst
158
237
  end
159
238
 
160
239
  def shebang(spec, install_dir, bin_file_name)
@@ -207,8 +286,8 @@ TEXT
207
286
  dest_path = File.join(directory, spec.require_paths[0])
208
287
  spec.extensions.each do |extension|
209
288
  Dir.chdir File.join(directory, File.dirname(extension))
210
- results = ["ruby #{File.basename(extension)} #{ARGV.join(" ")}"]
211
- results << `ruby #{File.basename(extension)} #{ARGV.join(" ")}`
289
+ results = ["#{Gem.ruby} #{File.basename(extension)} #{ARGV.join(" ")}"]
290
+ results << `#{Gem.ruby} #{File.basename(extension)} #{ARGV.join(" ")}`
212
291
  if File.exist?('Makefile')
213
292
  mf = File.read('Makefile')
214
293
  mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$.*/, "RUBYARCHDIR = #{dest_path}")