Skip to content

Instantly share code, notes, and snippets.

@Saicheg
Forked from stepheneb/list-native-gems.rb
Created September 10, 2013 19:08
Show Gist options
  • Save Saicheg/6514113 to your computer and use it in GitHub Desktop.
Save Saicheg/6514113 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
gempaths = Gem::default_path
puts
puts "Scanning paths in Gem::default_path for RubyGems with native extensions ..."
puts
gempaths.each do |gempath|
native_gems = Dir.glob("#{gempath}/gems/**/*.{so,bundle,dylib}").collect { |p| p[/#{Gem::default_path[1]}\/gems\/.*?\//] }.uniq
puts "#{gempath}/gems: #{native_gems.length} gems with native extensions"
puts
unless native_gems.empty?
native_gems.sort.each do |gem|
puts " #{File.basename(gem)}"
end
puts
end
end
$ /home/sbannasch/src/list-native-gems.rb
Scanning paths in Gem::default_path for RubyGems with native extensions ...
/home/sbannasch/.gem/ruby/1.8: 0 gems with native extensions
/usr/local/lib/ruby/gems/1.8: 59 gems with native extensions
RedCloth-3.301
RedCloth-4.0.3
RedCloth-4.1.1
RedCloth-4.1.9
RedCloth-4.2.2
bcrypt-ruby-2.0.5
do_sqlite3-0.9.10.1
em-http-request-0.2.7
eventmachine-0.12.10
fastthread-0.6.4.1
fastthread-1.0.1
fastthread-1.0
ffi-0.6.3
god-0.7.12
hpricot-0.5.110
hpricot-0.5
hpricot-0.6.164
hpricot-0.6
johnson-1.2.0
json-1.0.1
json-1.1.1
json-1.1.2
json-1.1.3
json-1.2.3
json-1.4.3
libxml-ruby-0.5.4
libxml-ruby-0.6.0
libxml-ruby-0.7.0
libxml-ruby-0.8.0
libxml-ruby-0.9.8
libxml-ruby-1.1.3
linecache-0.42
linecache-0.43
mongrel-1.0.1
mongrel-1.1.1
mongrel-1.1.2
mongrel-1.1.4
mongrel-1.1.5
mysql-2.7
mysql-2.8.1
passenger-2.0.6
passenger-2.1.2
passenger-2.1.3
passenger-2.2.15
passenger-2.2.4
passenger-3.0.1
ruby-debug-0.7.5
ruby-debug-base-0.10.1
ruby-debug-base-0.10.3
ruby-debug-base-0.8.1
ruby-debug-base-0.9.3
selenium-webdriver-0.0.24
sqlite3-ruby-1.2.5
superredcloth-1.160-mswin32
superredcloth-1.160
superredcloth-1.163
superredcloth-1.167
termios-0.9.4
thin-1.2.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment