Add repoman check for deprecated ruby targets, fixes bug #469616
diff --git a/bin/repoman b/bin/repoman
index 452ca48..4ffe10d 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -324,6 +324,7 @@
 	"LIVEVCS.unmasked": "This ebuild is a live checkout from a VCS but has keywords and is not masked in the global package.mask.",
 	"IUSE.invalid": "This ebuild has a variable in IUSE that is not in the use.desc or its metadata.xml file",
 	"IUSE.missing": "This ebuild has a USE conditional which references a flag that is not listed in IUSE",
+	"IUSE.rubydeprecated": "The ebuild has set a ruby interpreter in USE_RUBY, that is not available as a ruby target anymore",
 	"LICENSE.invalid": "This ebuild is listing a license that doesnt exist in portages license/ dir.",
 	"LICENSE.deprecated": "This ebuild is listing a deprecated license.",
 	"KEYWORDS.invalid": "This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
@@ -392,6 +393,7 @@
 "upstream.workaround",
 "LIVEVCS.stable",
 "LIVEVCS.unmasked",
+"IUSE.rubydeprecated",
 ))
 
 if portage.const._ENABLE_INHERIT_CHECK:
@@ -476,6 +478,11 @@
 	"dev-libs/libusb-compat":"virtual/libusb",
 }
 
+ruby_deprecated = {
+	"ruby_targets_rbx",
+	"ruby_targets_ree18",
+}
+
 metadata_xml_encoding = 'UTF-8'
 metadata_xml_declaration = '<?xml version="1.0" encoding="%s"?>' % \
 	(metadata_xml_encoding,)
@@ -2105,6 +2112,15 @@
 		for mypos in range(len(myuse)):
 			stats["IUSE.invalid"] += 1
 			fails["IUSE.invalid"].append(x + "/" + y + ".ebuild: %s" % myuse[mypos])
+		
+		# Check for outdated RUBY targets
+		if "ruby-ng" in inherited or "ruby-fakegem" in inherited or "ruby" in inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					stats["IUSE.rubydeprecated"] += 1
+					fails["IUSE.rubydeprecated"].append(
+						(relative_path + ": Deprecated ruby target: %s") % myruby)
 
 		# license checks
 		if not badlicsyntax:
diff --git a/man/repoman.1 b/man/repoman.1
index a025350..d4ced1d 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -347,6 +347,9 @@
 The ebuild uses an EAPI which is deprecated by the repository's
 metadata/layout.conf settings.
 .TP
+.B IUSE.rubydeprecated
+The ebuild has set a ruby interpreter in USE_RUBY, that is not available as a ruby target anymore
+.TP
 .B portage.internal
 The ebuild uses an internal Portage function or variable
 .TP