Skip to content

Instantly share code, notes, and snippets.

@thibault-ml
Created May 4, 2010 21: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 thibault-ml/00be9e82ed4fd548c29d to your computer and use it in GitHub Desktop.
Save thibault-ml/00be9e82ed4fd548c29d to your computer and use it in GitHub Desktop.
Index: ext/extconf.rb
--- ext/extconf.rb (Working copy)
+++ ext/extconf.rb (Patch)
@@ -7,8 +7,7 @@
### Read the output of a command using the fork+pipe syntax so execution errors
### propagate to Ruby.
def read_cmd_output( *cmd )
- output = IO.read( '|-' ) or exec( *cmd )
- return output.chomp
+ return IO.popen([*cmd]) { |io| io.read.chomp }
end
### Turn a version string into a Comparable binary datastructure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment