Permalink
Browse files

Makes Rails 2 fixture run again

  • Loading branch information...
nesquena committed Sep 3, 2013
1 parent 9a101d9 commit bffd9e0f1a941cfd6c1a952ee8dac3d24ffc33e5
Showing with 22 additions and 0 deletions.
  1. +22 −0 fixtures/rails2/config/environment.rb
@@ -6,6 +6,28 @@
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
+# Hot patch since Gem.source_index was deprecated in later rubygems
+unless Gem.method_defined?(:source_index)
+ module Gem
+ def self.source_index
+ sources
+ end
+
+ def self.cache
+ sources
+ end
+
+ SourceIndex = Specification
+
+ class SourceList
+ # If you want vendor gems, this is where to start writing code.
+ def search( *args ); []; end
+ def each( &block ); end
+ include Enumerable
+ end
+ end
+end
+
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers

0 comments on commit bffd9e0

Please sign in to comment.