Skip to content

Instantly share code, notes, and snippets.

@igrep
Created January 16, 2011 03:09
Show Gist options
  • Save igrep/781513 to your computer and use it in GitHub Desktop.
Save igrep/781513 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# vim: set fileencoding=utf-8 :
$VERBOSE = true
=begin
`which' command for Ruby libraries.
=end
lib = ARGV.shift
exts = %w/ .rb .so .dll /
puts $LOAD_PATH.map{|path|
exts.map{|e| File.join path, lib + e }
}.flatten.find{|path| File.exist? path }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment