Permalink
Browse files

Added array for the require&rescue cases

  • Loading branch information...
1 parent e2c3049 commit 054b6102e9f78ee0d90052da0e320a14b299d043 @fabien committed Oct 13, 2008
Showing with 10 additions and 2 deletions.
  1. +4 −0 CHANGELOG
  2. +1 −1 Rakefile
  3. +5 −1 lib/minigems.rb
View
@@ -1,3 +1,7 @@
+0.9.6 - 10/13/2008:
+* Added $MINIGEMS_SKIPPABLE for specifying optional requirements; there are some
+ gems that do require&rescue to load optional requirements. This construct will
+ trigger the loading of the full rubygems system.
0.9.5 - 10/11/2008:
* Display warning when full RubyGems is loaded ($MINIGEMS_DEBUG is obsolete).
* Instead of globbing the system, just switch to full RubyGems (shows warning).
View
@@ -15,7 +15,7 @@ GEM_EMAIL = "info@atelierfabien.be"
GEM_NAME = "minigems"
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
-GEM_VERSION = (Gem::MiniGems::VERSION || "0.9.5") + PKG_BUILD
+GEM_VERSION = (Gem::MiniGems::VERSION || "0.9.6") + PKG_BUILD
RELEASE_NAME = "REL #{GEM_VERSION}"
View
@@ -2,7 +2,7 @@ module Gem
unless const_defined?(:MiniGems)
module MiniGems
- VERSION = "0.9.5"
+ VERSION = "0.9.6"
# The next line needs to be kept exactly as shown; it's being replaced
# during minigems installation.
@@ -20,6 +20,8 @@ def self.camel_case(str)
# Enable minigems unless rubygems has already loaded.
unless $LOADED_FEATURES.include?("rubygems.rb")
+ $MINIGEMS_SKIPPABLE ||= []
+
$LOADED_FEATURES << "rubygems.rb"
require 'minigems/core'
require 'rubygems/specification'
@@ -63,6 +65,8 @@ def require(path) # :nodoc:
if !path.include?('/') && (match = Gem.find_name(path))
Gem.activate_gem_from_path(match.first)
return gem_original_require(path)
+ elsif $MINIGEMS_SKIPPABLE.include?(path)
+ raise load_error
elsif spec = Gem.searcher.find(path)
Gem.activate(spec.name, "= #{spec.version}")
return gem_original_require(path)

0 comments on commit 054b610

Please sign in to comment.