Object
# File lib/rubygems/ext/builder.rb, line 9 9: def self.class_name 10: name =~ /Ext::(.*)Builder/ 11: $1.downcase 12: end
# File lib/rubygems/ext/builder.rb, line 14 14: def self.make(dest_path, results) 15: unless File.exist? 'Makefile' then 16: raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" 17: end 18: 19: mf = File.read('Makefile') 20: mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}") 21: mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}") 22: 23: File.open('Makefile', 'wb') {|f| f.print mf} 24: 25: # try to find make program from Ruby configure arguments first 26: RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/ 27: make_program = $1 || ENV['make'] 28: unless make_program then 29: make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make' 30: end 31: 32: ['', ' install'].each do |target| 33: cmd = "#{make_program}#{target}" 34: results << cmd 35: results << `#{cmd} #{redirector}` 36: 37: raise Gem::InstallError, "make#{target} failed:\n\n#{results}" unless 38: $?.success? 39: end 40: end
# File lib/rubygems/ext/builder.rb, line 42 42: def self.redirector 43: '2>&1' 44: end
# File lib/rubygems/ext/builder.rb, line 46 46: def self.run(command, results) 47: results << command 48: results << `#{command} #{redirector}` 49: 50: unless $?.success? then 51: raise Gem::InstallError, "#{class_name} failed:\n\n#{results.join "\n"}" 52: end 53: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.