1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Translate catalog entities to JSON
20 redef class MPackageMetadata
23 redef fun core_serialize_to
(v
) do
25 v
.serialize_attribute
("license", license
)
26 v
.serialize_attribute
("maintainers", maintainers
)
27 v
.serialize_attribute
("contributors", contributors
)
28 v
.serialize_attribute
("tags", tags
)
29 v
.serialize_attribute
("tryit", tryit
)
30 v
.serialize_attribute
("apk", apk
)
31 v
.serialize_attribute
("homepage", homepage
)
32 v
.serialize_attribute
("browse", browse
)
33 v
.serialize_attribute
("git", git
)
34 v
.serialize_attribute
("issues", issues
)
35 v
.serialize_attribute
("first_date", first_date
)
36 v
.serialize_attribute
("last_date", last_date
)
41 redef class CatalogStats
44 redef fun core_serialize_to
(v
) do
46 v
.serialize_attribute
("packages", packages
)
47 v
.serialize_attribute
("maintainers", maintainers
)
48 v
.serialize_attribute
("contributors", contributors
)
49 v
.serialize_attribute
("tags", tags
)
50 v
.serialize_attribute
("modules", modules
)
51 v
.serialize_attribute
("classes", classes
)
52 v
.serialize_attribute
("methods", methods
)
53 v
.serialize_attribute
("loc", loc
)
57 # MPackage statistics for the catalog
58 redef class MPackageStats
61 redef fun core_serialize_to
(v
) do
63 v
.serialize_attribute
("mmodules", mmodules
)
64 v
.serialize_attribute
("mclasses", mclasses
)
65 v
.serialize_attribute
("mmethods", mmethods
)
66 v
.serialize_attribute
("loc", loc
)
67 v
.serialize_attribute
("errors", errors
)
68 v
.serialize_attribute
("warnings", warnings
)
69 v
.serialize_attribute
("warnings_per_kloc", warnings_per_kloc
)
70 v
.serialize_attribute
("documentation_score", documentation_score
)
71 v
.serialize_attribute
("commits", commits
)
72 v
.serialize_attribute
("score", score
)
79 redef fun core_serialize_to
(v
) do
81 v
.serialize_attribute
("name", name
)
82 v
.serialize_attribute
("email", email
)
83 v
.serialize_attribute
("gravatar", gravatar
)