Skip to content
Browse files

memprof --info to show info about ruby binary

  • Loading branch information...
1 parent aa83bca commit 6bffc26be6a97c1b09fb1b72db64ff582f5bacfe @tmm1 tmm1 committed Apr 22, 2010
Showing with 16 additions and 0 deletions.
  1. +16 −0 bin/memprof
View
16 bin/memprof
@@ -33,6 +33,22 @@ class MemprofUploader
opts.on("--put-my-data-on-the-internet", "Confirm that you understand\n" +
"memprof.com will show all your \n".rjust(80) +
"internal data on the internet (required)".rjust(80)) {|arg| @confirmed = true}
+ opts.on("--info") do
+ require 'rbconfig'
+ puts RUBY_DESCRIPTION if defined? RUBY_DESCRIPTION
+ puts "CFLAGS='#{Config::CONFIG["CFLAGS"]}' ./configure #{Config::CONFIG["configure_args"]}"
+ bin = "#{Config::CONFIG['bindir']}/#{Config::CONFIG['ruby_install_name']}"
+ puts `file #{bin}`
+
+ if RUBY_PLATFORM =~ /darwin/
+ puts `otool -L #{bin}`
+ else
+ puts `ldd #{bin}`
+ end
+
+ puts
+ exit!
+ end
end
begin

0 comments on commit 6bffc26

Please sign in to comment.
Something went wrong with that request. Please try again.