nitcc: tests script return non-zero on failure (print is not enough)
[nit.git] / src / catalog / catalog.nit
index dd891ac..140278e 100644 (file)
@@ -165,24 +165,6 @@ class Person
                return email.md5.to_lower
        end
 
-       # Return a full-featured link to a person
-       fun to_html: String
-       do
-               var res = ""
-               var e = name.html_escape
-               var page = self.page
-               if page != null then
-                       res += "<a href=\"{page.html_escape}\">"
-               end
-               var gravatar = self.gravatar
-               if gravatar != null then
-                       res += "<img src=\"https://secure.gravatar.com/avatar/{gravatar}?size=20&amp;default=retro\">&nbsp;"
-               end
-               res += e
-               if page != null then res += "</a>"
-               return res
-       end
-
        # The standard representation of a person.
        #
        # ~~~
@@ -586,6 +568,20 @@ class CatalogStats
 
        # Number of line of codes
        var loc = 0
+
+       # Return the stats as a Map associating each stat key to its value
+       fun to_map: Map[String, Int] do
+               var map = new HashMap[String, Int]
+               map["packages"] = packages
+               map["maintainers"] = maintainers
+               map["contributors"] = contributors
+               map["tags"] = tags
+               map["modules"] = modules
+               map["classes"] = classes
+               map["methods"] = methods
+               map["loc"] = loc
+               return map
+       end
 end
 
 # MPackage statistics for the catalog