This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'ffi' | |
| require 'digest' | |
| # Thanks to all ruby hackers everywhere who have donated their knowledge to the commons! | |
| # With thanks to @judofyr for ffi/"evil.rb" - https://gist.github.com/2238438 | |
| class Object | |
| def memory_location | |
| object_id * 2 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'ffi' | |
| class Object | |
| def memory_location | |
| object_id * 2 | |
| end | |
| def to_pointer | |
| FFI::Pointer.new(memory_location) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- rubygems-1.8.5/lib/rubygems/remote_fetcher.rb.orig 2011-07-20 00:28:13.000000000 +0900 | |
| +++ rubygems-1.8.5/lib/rubygems/remote_fetcher.rb 2011-07-20 01:09:59.000000000 +0900 | |
| @@ -69,6 +69,7 @@ | |
| when URI::HTTP then proxy | |
| else URI.parse(proxy) | |
| end | |
| + @no_proxy = (ENV['NO_PROXY'] || ENV['no_proxy'] || 'localhost, 127.0.0.1').split(/\s*,\s*/) | |
| @user_agent = user_agent | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Serializer < Struct.new(:object) | |
| def to_hash | |
| @hash ||= hash_object(object) | |
| end | |
| private | |
| def hash_object(object) | |
| hash = {} |