Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.