ext/mkrf_conf_xapian.rb in sup-1.0 vs ext/mkrf_conf_xapian.rb in sup-1.1

- old
+ new

@@ -8,17 +8,23 @@ rescue NoMethodError end puts "xapian: platform specific dependencies.." -inst = Gem::DependencyInstaller.new +destination = File.writable?(Gem.dir) ? Gem.dir : Gem.user_dir +inst = Gem::DependencyInstaller.new(:install_dir => destination) begin if !RbConfig::CONFIG['arch'].include?('openbsd') # update version in Gemfile as well name = "xapian-ruby" - version = "~> 1.2" + version = + if /^2\.0\./ =~ RUBY_VERSION + ["~> 1.2", "< 1.3.6"] + else + "~> 1.2" + end begin # try to load gem gem name, version @@ -32,11 +38,11 @@ end else STDERR.puts "xapian: openbsd: you have to install xapian-core and xapian-bindings manually, have a look at: https://github.com/sup-heliotrope/sup/wiki/Installation%3A-OpenBSD" end -rescue - +rescue StandardError => e + STDERR.puts "Unable to install #{name} gem: #{e.inspect}" exit(1) end # create dummy rakefile to indicate success