nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1d0a5e
)
src/catalog: export package stats to map
author
Alexandre Terrasa
<alexandre@moz-code.org>
Fri, 1 Jun 2018 15:06:28 +0000
(11:06 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Sun, 10 Jun 2018 17:25:06 +0000
(13:25 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
src/catalog/catalog.nit
patch
|
blob
|
history
diff --git
a/src/catalog/catalog.nit
b/src/catalog/catalog.nit
index
dd891ac
..
6a12238
100644
(file)
--- a/
src/catalog/catalog.nit
+++ b/
src/catalog/catalog.nit
@@
-586,6
+586,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