Permalink
Browse files

execute require lazy

  • Loading branch information...
1 parent dac8000 commit 6e9fc2a2263d4d42a8e6f61169d2db631f0a40a4 @mkristian committed Sep 19, 2012
Showing with 5 additions and 5 deletions.
  1. +2 −1 lib/jars.rb
  2. +3 −4 spec/jars_spec.rb
View
@@ -15,7 +15,7 @@ def maybe_load_jars( specs )
def load_jars( specs )
puts "DO LOAD JARS FOR #{specs.collect { |k| k }.join(',')}"
specs.each do |spec|
- gem_dir = spec.gem_dir
+ gem_dir = spec.gem_dir rescue spec.full_gem_path # fallback for --1.8 mode
lockfile = File.join( gem_dir, "Jarfile.lock" )
if File.exists? lockfile
puts "#{spec.name} has Jarfile.lock, loading jars"
@@ -38,6 +38,7 @@ def require fn
if require_without_jars fn
@@gems_size ||= 0
+ Gem.loaded_specs if @@gems_size == 0
if @@gems_size < Gem.loaded_specs.size
@@gems_size = Gem.loaded_specs.size
jars.maybe_load_jars( Gem.loaded_specs )
View
@@ -6,11 +6,10 @@
it "should start with an empty classpath" do
# this should be nil!!
- $CLASSPATH.should eql nil
+ $CLASSPATH.size.should == 0
+ require 'solr_sail'
end
- require 'solr_sail'
-
it "should set jars" do
jars.is_a?( Jars ).should be_true
end
@@ -42,4 +41,4 @@
@server.start
@server.stop
end
-end
+end

0 comments on commit 6e9fc2a

Please sign in to comment.