forked from ruby-debug/ruby-debug-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkrf_conf.rb
44 lines (38 loc) · 1.23 KB
/
mkrf_conf.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
install_dir = File.expand_path("../../../..", __FILE__)
jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
rbx = defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE
unless jruby || rbx
require 'rubygems'
require 'rubygems/command.rb'
require 'rubygems/dependency.rb'
require 'rubygems/dependency_installer.rb'
begin
Gem::Command.build_args = ARGV
rescue NoMethodError
end
if RUBY_VERSION < "1.9"
dep = Gem::Dependency.new("ruby-debug-base", '>=0.10.4')
elsif RUBY_VERSION < '2.0'
dep = Gem::Dependency.new("ruby-debug-base19x", '>=0.11.30.pre15')
else
dep = Gem::Dependency.new("debase", '> 0')
end
begin
puts "Installing base gem"
inst = Gem::DependencyInstaller.new(:prerelease => dep.prerelease?, :install_dir => install_dir)
inst.install dep
rescue
begin
inst = Gem::DependencyInstaller.new(:prerelease => true, :install_dir => install_dir)
inst.install dep
rescue Exception => e
puts e
puts e.backtrace.join "\n "
exit(1)
end
end unless dep.nil? || dep.matching_specs.any?
end
# create dummy rakefile to indicate success
f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w")
f.write("task :default\n")
f.close