Parent

Class Index [+]

Quicksearch

Gem::Ext::Builder

Public Class Methods

class_name() click to toggle source
    # File lib/rubygems/ext/builder.rb, line 9
 9:   def self.class_name
10:     name =~ /Ext::(.*)Builder/
11:     $1.downcase
12:   end
make(dest_path, results) click to toggle source
    # 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:     make_program = ENV['make']
26:     unless make_program then
27:       make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
28:     end
29: 
30:     ['', ' install'].each do |target|
31:       cmd = "#{make_program}#{target}"
32:       results << cmd
33:       results << `#{cmd} #{redirector}`
34: 
35:       raise Gem::InstallError, "make#{target} failed:\n\n#{results}" unless
36:         $?.success?
37:     end
38:   end
redirector() click to toggle source
    # File lib/rubygems/ext/builder.rb, line 40
40:   def self.redirector
41:     '2>&1'
42:   end
run(command, results) click to toggle source
    # File lib/rubygems/ext/builder.rb, line 44
44:   def self.run(command, results)
45:     results << command
46:     results << `#{command} #{redirector}`
47: 
48:     unless $?.success? then
49:       raise Gem::InstallError, "#{class_name} failed:\n\n#{results.join "\n"}"
50:     end
51:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.