[DRE-commits] [SCM] ruby-minitest.git branch, master, updated. debian/5.0.3-1-6-g9bcf0b0
Cédric Boutillier
boutil at debian.org
Wed Jun 12 18:59:23 UTC 2013
The following commit has been merged in the master branch:
commit 775484b412b38fdc105cbef74bbb961fb8fe6291
Author: Cédric Boutillier <boutil at debian.org>
Date: Wed Jun 12 16:37:48 2013 +0200
make load_plugin work with Ruby1.8 without using rubygems
diff --git a/debian/patches/load_plugins_noop_ruby18.patch b/debian/patches/load_plugins_noop_ruby18.patch
deleted file mode 100644
index ecc4fe5..0000000
--- a/debian/patches/load_plugins_noop_ruby18.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: make load_plugins do nothing with Ruby1.8 and without rubygems
- To activate load_plugins, require "rubygems"
-Author: Cédric Boutillier <boutil at debian.org>
-Forwarded: not-needed
-Last-Update: 2013-05-16
-
---- a/lib/minitest.rb
-+++ b/lib/minitest.rb
-@@ -67,6 +67,7 @@
-
- def self.load_plugins # :nodoc:
- return unless self.extensions.empty?
-+ return if RUBY_VERSION =~ /1\.8/ and not (defined?(Gem) and Gem.method_defined?(:find_files))
-
- seen = {}
-
diff --git a/debian/patches/load_plugins_ruby18.patch b/debian/patches/load_plugins_ruby18.patch
new file mode 100644
index 0000000..7f0c6d6
--- /dev/null
+++ b/debian/patches/load_plugins_ruby18.patch
@@ -0,0 +1,28 @@
+Description: make load_plugins work with Ruby1.8 and without rubygems
+ Without Gem.find_files, it will only search for MiniTest plugins in the
+ $LOAD_PATH. To activate the original version, require "rubygems".
+ It needs to work to load at least the pride_plugin shipped with MiniTest.
+Author: Cédric Boutillier <boutil at debian.org>
+Forwarded: not-needed
+Last-Update: 2013-06-12
+
+--- a/lib/minitest.rb
++++ b/lib/minitest.rb
+@@ -69,8 +69,16 @@
+ return unless self.extensions.empty?
+
+ seen = {}
++ if RUBY_VERSION =~ /1\.8/ and not (defined?(Gem) and Gem.method_defined?(:find_files))
++ # code inspired from Gem.find_files
++ list_plugins=$LOAD_PATH.map { |load_path|
++ Dir[File.expand_path "minitest/*_plugin.rb", load_path]
++ }.flatten.select { |file| File.file? file.untaint }.uniq
++ else
++ list_plugins=Gem.find_files("minitest/*_plugin.rb")
++ end
+
+- Gem.find_files("minitest/*_plugin.rb").each do |plugin_path|
++ list_plugins.each do |plugin_path|
+ name = File.basename plugin_path, "_plugin.rb"
+
+ next if seen[name]
diff --git a/debian/patches/series b/debian/patches/series
index 8ba88d8..23ec7ea 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,3 @@
disable-require-rubygems
disable-some-tests
-load_plugins_noop_ruby18.patch
+load_plugins_ruby18.patch
--
ruby-minitest.git
More information about the Pkg-ruby-extras-commits
mailing list