Skip to content

Instantly share code, notes, and snippets.

Created January 27, 2011 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/798256 to your computer and use it in GitHub Desktop.
Save anonymous/798256 to your computer and use it in GitHub Desktop.
diff --git a/lib/ruby/site_ruby/1.8/rubygems/config_file.rb b/lib/ruby/site_ruby/1.8/rubygems/config_file.rb
index 7eb755a..be6f3da 100644
--- a/lib/ruby/site_ruby/1.8/rubygems/config_file.rb
+++ b/lib/ruby/site_ruby/1.8/rubygems/config_file.rb
@@ -44,6 +44,15 @@ class Gem::ConfigFile
# rubygems/defaults/#{RUBY_ENGINE}.rb
PLATFORM_DEFAULTS = {}
+
+ require 'ffi'
+ class XYZ
+ def initialize
+ @lib = FFI::DynamicLibrary.open('/usr/lib/libc.dylib', FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_GLOBAL)
+ sym = @lib.find_function('fork')
+ @func = FFI::Function.new(FFI::Type::INT, [], sym)
+ end
+ end
system_config_path =
begin
@@ -63,6 +72,7 @@ class Gem::ConfigFile
path.strip
rescue LoadError
+ YumYumYum = XYZ.new
'/etc'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment