This backports a fix to rubygems that I made upstream last year. Without this commit, after a Gem.refresh, which gems get loaded can depend on the order of directory entries, which can break working code just by restoring a backup.
This is especially important fix if you are using www/ruby-unicorn, as that uses Gem.refresh internally. This only affects ruby 1.8 and 1.9, the other ruby implementations in the tree already have an updated rubygems. Tested on amd64. Will be committing later this week unless I hear objections. Thanks, Jeremy Index: devel/ruby-gems/Makefile =================================================================== RCS file: /cvs/ports/devel/ruby-gems/Makefile,v retrieving revision 1.30 diff -u -p -r1.30 Makefile --- devel/ruby-gems/Makefile 6 Jan 2014 02:24:49 -0000 1.30 +++ devel/ruby-gems/Makefile 24 Jun 2014 21:22:40 -0000 @@ -5,7 +5,7 @@ COMMENT= package management framework fo V= 1.8.23 DISTNAME= rubygems-$V PKGNAME= ruby-gems-$V -REVISION= 1 +REVISION= 2 CATEGORIES= devel HOMEPAGE= http://docs.rubygems.org/ Index: devel/ruby-gems/patches/patch-lib_rubygems_specification_rb =================================================================== RCS file: devel/ruby-gems/patches/patch-lib_rubygems_specification_rb diff -N devel/ruby-gems/patches/patch-lib_rubygems_specification_rb --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/ruby-gems/patches/patch-lib_rubygems_specification_rb 24 Jun 2014 21:22:25 -0000 @@ -0,0 +1,20 @@ +$OpenBSD$ + +Backport fix for Gem.refresh from upstream commit +b61c621fb2e00e215bcc8ad7d9fe45433881da14. + +--- lib/rubygems/specification.rb.orig Tue Jun 24 14:21:46 2014 ++++ lib/rubygems/specification.rb Tue Jun 24 14:21:52 2014 +@@ -275,6 +275,12 @@ class Gem::Specification + + @@all = specs.values + ++ # After a reset, make sure already loaded specs ++ # are still marked as activated. ++ specs = {} ++ Gem.loaded_specs.each_value{|s| specs[s] = true} ++ @@all.each{|s| s.activated = true if specs[s]} ++ + _resort! + end + @@all Index: lang/ruby/1.9/Makefile =================================================================== RCS file: /cvs/ports/lang/ruby/1.9/Makefile,v retrieving revision 1.44 diff -u -p -r1.44 Makefile --- lang/ruby/1.9/Makefile 11 Mar 2014 20:07:07 -0000 1.44 +++ lang/ruby/1.9/Makefile 24 Jun 2014 21:25:33 -0000 @@ -18,6 +18,7 @@ PKGNAME-gdbm = ruby-gdbm-${VERSION}.${P PKGNAME-dbm = ruby-dbm-${VERSION}.${PATCHLEVEL} PKGNAME-tk = ruby-tk-${VERSION}.${PATCHLEVEL} PKGNAME-ri_docs = ruby-ri_docs-${VERSION}.${PATCHLEVEL} +REVISION-main = 0 PKG_ARCH-ri_docs = * WANTLIB-ri_docs = # empty Index: lang/ruby/1.9/patches/patch-lib_rubygems_specification_rb =================================================================== RCS file: lang/ruby/1.9/patches/patch-lib_rubygems_specification_rb diff -N lang/ruby/1.9/patches/patch-lib_rubygems_specification_rb --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lang/ruby/1.9/patches/patch-lib_rubygems_specification_rb 24 Jun 2014 21:24:12 -0000 @@ -0,0 +1,20 @@ +$OpenBSD$ + +Backport fix for Gem.refresh from upstream commit +b61c621fb2e00e215bcc8ad7d9fe45433881da14. + +--- lib/rubygems/specification.rb.orig Tue Jun 24 14:21:46 2014 ++++ lib/rubygems/specification.rb Tue Jun 24 14:21:52 2014 +@@ -275,6 +275,12 @@ class Gem::Specification + + @@all = specs.values + ++ # After a reset, make sure already loaded specs ++ # are still marked as activated. ++ specs = {} ++ Gem.loaded_specs.each_value{|s| specs[s] = true} ++ @@all.each{|s| s.activated = true if specs[s]} ++ + _resort! + end + @@all
