Skip to content

Instantly share code, notes, and snippets.

@maasha

maasha/test.rb Secret

Created October 12, 2018 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maasha/62ffc5caa4eee1d750c49a2c0e883b60 to your computer and use it in GitHub Desktop.
Save maasha/62ffc5caa4eee1d750c49a2c0e883b60 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'pp'
require 'open3'
entries = File.open('/Users/iehdk/install/src/chem-O-matic/data/mega.sdf').read.split("$$$$")
entries.each do |entry|
Open3.popen3("obabel -i sdf -o smi") do |stdin, stdout, stderr, wait_thr|
entries.each do |entry|
stdin.puts entry
stdin.close
stdout.each_line { |line| puts line }
end
puts wait_thr.value
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment