> > 
> > > > +      if Puppet.features.rubygems?
> > > > +        Thread.current[:gemsearch_directories] ||= []
> > > > +        Thread.current[:gemsearch_directories] =
> > > > Gem.all_load_paths
> > > > if Thread.current[:gemsearch_directories].empty?
> > > > +        return Thread.current[:gemsearch_directories]
> > > > +      end
> > > 
> > > This should really just be:
> > > 
> > > if Puppet.features.rubygems?
> > >    return Thread.current[:gemsearch_directories] ||=
> > >    Gem.all_load_paths
> > > end
> > 
> > :) You took the words right out of my mouth...er, email--I was about
> > to suggest just that.  
> 
> funny how looking at code in a different syntax highlighter (or none) 
> changes what you see :)

Yep.  I tend to code with syntax highlighting off for that reason.

> > Also, if you are going to follow the per-compile pattern of module_dir 
> > (which seems reasonable) you should also clear the thread var (see 
> > lib/puppet/configurer.rb around line 160) so that it doesn't get stale.
> 
> this is good I was wondering about clearing it but really have no idea how
> this code works inside, this will cover both the agent and the master? 
> Should I be clearing it in puppet/parser/compiler.rb line 25 too?

Yes, but above the new() rather than in the ensure block (in other
words, make sure you're applying it on top of something with the fix for
#5318 (commit:68c106e3ef192) in it.

> running the specs with an added Thread.current[:gemsearch_directories] = nil
> in both cases doesnt kill my machine like before or make more tests fail 
> (lots of failing tests even before I started) so it seems sane to me.

Hmmm.  Lots of failing tests?  That shouldn't be happening, as far as I
know.

-- Markus


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to