Skip to content

Instantly share code, notes, and snippets.

@bf4
Created March 14, 2014 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bf4/9557774 to your computer and use it in GitHub Desktop.
Save bf4/9557774 to your computer and use it in GitHub Desktop.
acts as slimgems
diff --git a/Gemfile b/Gemfile
index 22bde6e..a429815 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,15 @@
source 'https://rubygems.org'
+require 'rubygems'
+def Gem.source_index
+ STDERR.puts "Guess who wants Gem.source_index? #{caller[0]}"
+ # see https://github.com/slimgems/slimgems/blob/master/lib/rubygems/source_index.rb#L124
+ Gem.const_set(:SourceIndex, Class.new do
+ def initialize(specifications={})
+ p ["Source index", specifications]
+ end
+ end)
+end unless Gem.respond_to?(:source_index)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment