From 9ce84ddb914eb933d59d4dfb1a40a9429ca5519b Mon Sep 17 00:00:00 2001 From: Katsuhiko Nishimra Date: Mon, 29 Apr 2013 18:10:40 +0900 Subject: Use Kernel.system instead of `command` --- ext/openbabel/extconf.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/openbabel/extconf.rb b/ext/openbabel/extconf.rb index e0dfbae..9e67b8f 100644 --- a/ext/openbabel/extconf.rb +++ b/ext/openbabel/extconf.rb @@ -15,27 +15,27 @@ begin Dir.chdir main_dir do FileUtils.rm_rf ob_main_dir puts "Downloading OpenBabel sources" - puts `curl -L -d use_mirror=netcologne "http://downloads.sourceforge.net/project/openbabel/openbabel/#{ob_num_ver}/openbabel-#{ob_num_ver}.tar.gz" | tar xz` + system "curl -L -d use_mirror=netcologne 'http://downloads.sourceforge.net/project/openbabel/openbabel/#{ob_num_ver}/openbabel-#{ob_num_ver}.tar.gz' | tar xz" end Dir.chdir ob_main_dir do puts "Configuring OpenBabel" - puts `cmake #{ob_main_dir} -DCMAKE_INSTALL_PREFIX=#{lib_dir}` + system "cmake #{ob_main_dir} -DCMAKE_INSTALL_PREFIX=#{lib_dir}" openbabel_libs = have_library('openbabel') unless openbabel_libs puts "OpenBabel not installed. Compiling sources." - puts `make` - puts `make install` + system "make" + system "make install" end end Dir.chdir ob_bindings_dir do puts "Compiling and instaling OpenBabel Ruby bindings." - `sed -i -e 's/Init_OpenBabel/Init_openbabel/g' *cpp` + system "sed -i -e 's/Init_OpenBabel/Init_openbabel/g' *cpp" # get include and lib from pkg-config ob_include=`pkg-config openbabel-2.0 --cflags-only-I`.sub(/\s+/,'').sub(/-I/,'') ob_lib=`pkg-config openbabel-2.0 --libs-only-L`.sub(/\s+/,'').sub(/-L/,'') - `ruby extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}` - `sed -i -e 's/-flat_namespace//' Makefile` - puts `make` + system "ruby extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}" + system "sed -i -e 's/-flat_namespace//' Makefile" + system "make" end FileUtils.cp(ob_bindings_dir+"/openbabel.#{RbConfig::CONFIG["DLEXT"]}", "./") File.open('Makefile', 'w') do |makefile| -- cgit v1.2.3