nitc :: json_commands $ CmdCatalogContributing
Retrieve the packages contributed by a personnitc :: json_commands $ CmdCatalogMaintaining
Retrieve the packages maintained by a personnitc :: json_commands $ CmdCatalogPerson
Retrieve a person from the catalognitc :: json_commands $ CmdCode
Abstract command that returns source-code piecesnitc :: json_commands $ CmdContribFile
Cmd that finds the contributing file related to anmentity
nitc :: json_commands $ CmdContribFileContent
Cmd that finds the contrib file content related to anmentity
nitc :: json_commands $ CmdEntityLink
Get the link to a MEntity API documentationnitc :: json_commands $ CmdEntityList
A command about a MEntity that returns a list of mentitiesnitc :: json_commands $ CmdGraph
An abstract command that returns a dot graphnitc :: json_commands $ CmdIniCloneCommand
Cmd that finds the git clone command related to anmentity
nitc :: json_commands $ CmdIniContributors
Cmd that finds the contributors list of anmentity
nitc :: json_commands $ CmdIniDescription
Cmd that finds the ini description related to anmentity
nitc :: json_commands $ CmdIniGitUrl
Cmd that finds the clone url related to anmentity
nitc :: json_commands $ CmdIniIssuesUrl
Cmd that finds the issues link related to anmentity
nitc :: json_commands $ CmdIniLicense
Cmd that finds the license related to anmentity
nitc :: json_commands $ CmdIniMaintainer
Cmd that finds the maintainer name of anmentity
nitc :: json_commands $ CmdLicenseFile
Cmd that finds the license file related to anmentity
nitc :: json_commands $ CmdLicenseFileContent
Cmd that finds the license file content related to anmentity
nitc :: json_commands $ CmdList
A command that returns a list of resultsnitc :: json_commands $ CmdMainCompile
Cmd that finds the nitc command related to anmentity
nitc :: json_commands $ CmdMetadata
Retrieve the catalog metadata for a MPackagenitc :: json_commands $ CmdTesting
Cmd that finds the nitunit command related to anmentity
nitc :: json_commands $ CmdCatalogContributing
Retrieve the packages contributed by a personnitc :: json_commands $ CmdCatalogMaintaining
Retrieve the packages maintained by a personnitc :: json_commands $ CmdCatalogPerson
Retrieve a person from the catalognitc :: json_commands $ CmdCode
Abstract command that returns source-code piecesnitc :: json_commands $ CmdContribFile
Cmd that finds the contributing file related to anmentity
nitc :: json_commands $ CmdContribFileContent
Cmd that finds the contrib file content related to anmentity
nitc :: json_commands $ CmdEntityLink
Get the link to a MEntity API documentationnitc :: json_commands $ CmdEntityList
A command about a MEntity that returns a list of mentitiesnitc :: json_commands $ CmdGraph
An abstract command that returns a dot graphnitc :: json_commands $ CmdIniCloneCommand
Cmd that finds the git clone command related to anmentity
nitc :: json_commands $ CmdIniContributors
Cmd that finds the contributors list of anmentity
nitc :: json_commands $ CmdIniDescription
Cmd that finds the ini description related to anmentity
nitc :: json_commands $ CmdIniGitUrl
Cmd that finds the clone url related to anmentity
nitc :: json_commands $ CmdIniIssuesUrl
Cmd that finds the issues link related to anmentity
nitc :: json_commands $ CmdIniLicense
Cmd that finds the license related to anmentity
nitc :: json_commands $ CmdIniMaintainer
Cmd that finds the maintainer name of anmentity
nitc :: json_commands $ CmdLicenseFile
Cmd that finds the license file related to anmentity
nitc :: json_commands $ CmdLicenseFileContent
Cmd that finds the license file content related to anmentity
nitc :: json_commands $ CmdList
A command that returns a list of resultsnitc :: json_commands $ CmdMainCompile
Cmd that finds the nitc command related to anmentity
nitc :: json_commands $ CmdMetadata
Retrieve the catalog metadata for a MPackagenitc :: json_commands $ CmdTesting
Cmd that finds the nitunit command related to anmentity
nitc :: actors_injection_phase
Injects model for the classes annotated with "is actor" sonitc :: astbuilder
Instantiation and transformation of semantic nodes in the AST of expressions and statementsnitc :: i18n_phase
Basic support of internationalization through the generation of id-to-string tablesSerializable::inspect
to show more useful information
nitc :: modelbuilder
more_collections :: more_collections
Highly specific, but useful, collections-related classes.threaded
annotation
serialization :: serialization_core
Abstract services to serialize Nit objects to different formatsnitc :: serialization_model_phase
Phase generating methods (model-only) to serialize Nit objectsserialize_to_json
and JsonSerializer
nitc :: toolcontext
Common command-line tool infrastructure than handle options and error messagesnitc :: uml_module
Services for generation of a UML package diagram based on aModel
core :: union_find
union–find algorithm using an efficient disjoint-set data structure
# Translate command results to json
module json_commands
import commands_catalog
import commands_graph
import commands_ini
import commands_main
import commands_usage
import templates::json_model
import json::static
redef class DocCommand
# Return a JSON Serializable representation of `self` results
fun to_json: nullable Serializable is abstract
end
# Message handling
redef class CmdMessage
# Return a JSON Serializable representation of `self`
fun to_json: nullable Serializable do
var obj = new JsonObject
obj["status"] = class_name
obj["message"] = to_s
return obj
end
end
redef class CmdEntity
redef fun to_json do return mentity
end
redef class CmdList
redef fun to_json do
var obj = new JsonObject
obj["results"] = results
obj["page"] = page
obj["count"] = count
obj["limit"] = limit
obj["max"] = max
return obj
end
end
redef class CmdEntityList
redef fun to_json do return super
end
# Model commands
redef class CmdComment
redef fun to_json do
var obj = new JsonObject
var render = self.render_comment
if render != null then
obj["documentation"] = render.write_to_string
end
return obj
end
end
redef class CmdEntityLink
redef fun to_json do
var obj = new JsonObject
var text = self.text
if text != null then obj["text"] = text
var title = self.title
if title != null then obj["title"] = title
return obj
end
end
redef class CmdCode
redef fun to_json do
var obj = new JsonObject
var node = self.node
if node == null then return obj
var code = render_code(node)
obj["location"] = node.location
obj["code"] = code.write_to_string
return obj
end
end
redef class CmdGraph
redef fun to_json do
var obj = new JsonObject
var output = render
if output != null then
obj["graph"] = output.write_to_string
end
return obj
end
end
redef class CmdMetadata
redef fun to_json do return metadata
end
# CmdCatalog
redef class CmdCatalogStats
redef fun to_json do return stats
end
redef class CmdCatalogTags
redef fun to_json do return packages_count_by_tags
end
redef class CmdCatalogTag
redef fun to_json do
var obj = super.as(JsonObject)
obj["tag"] = tag
return obj
end
end
redef class CmdCatalogPerson
redef fun to_json do return person
end
redef class CmdCatalogMaintaining
redef fun to_json do
var obj = new JsonObject
obj["person"] = person
obj["results"] = results
obj["page"] = page
obj["count"] = count
obj["limit"] = limit
obj["max"] = max
return obj
end
end
redef class CmdCatalogContributing
redef fun to_json do
var obj = new JsonObject
obj["person"] = person
obj["results"] = results
obj["page"] = page
obj["count"] = count
obj["limit"] = limit
obj["max"] = max
return obj
end
end
# CmdIni
redef class CmdIniDescription
redef fun to_json do
var obj = new JsonObject
obj["desc"] = desc
return obj
end
end
redef class CmdIniGitUrl
redef fun to_json do
var obj = new JsonObject
obj["url"] = url
return obj
end
end
redef class CmdIniCloneCommand
redef fun to_json do
var obj = new JsonObject
obj["command"] = command
return obj
end
end
redef class CmdIniIssuesUrl
redef fun to_json do
var obj = new JsonObject
obj["url"] = url
return obj
end
end
redef class CmdIniMaintainer
redef fun to_json do
var obj = new JsonObject
obj["maintainer"] = maintainer
return obj
end
end
redef class CmdIniContributors
redef fun to_json do
var obj = new JsonObject
obj["contributors"] = contributors
return obj
end
end
redef class CmdIniLicense
redef fun to_json do
var obj = new JsonObject
obj["license"] = license
return obj
end
end
redef class CmdLicenseFile
redef fun to_json do
var obj = new JsonObject
obj["file"] = file
return obj
end
end
redef class CmdLicenseFileContent
redef fun to_json do
var obj = super.as(JsonObject)
obj["content"] = content
return obj
end
end
redef class CmdContribFile
redef fun to_json do
var obj = new JsonObject
obj["file"] = file
return obj
end
end
redef class CmdContribFileContent
redef fun to_json do
var obj = super.as(JsonObject)
obj["content"] = content
return obj
end
end
# CmdMain
redef class CmdMains
redef fun to_json do
var obj = new JsonObject
obj["results"] = results
return obj
end
end
redef class CmdMainCompile
redef fun to_json do
var obj = new JsonObject
obj["command"] = command
return obj
end
end
redef class CmdTesting
redef fun to_json do
var obj = new JsonObject
obj["command"] = command
return obj
end
end
redef class CmdManSynopsis
redef fun to_json do
var obj = new JsonObject
obj["synopsis"] = synopsis
return obj
end
end
redef class CmdManOptions
redef fun to_json do
var obj = new JsonObject
obj["options"] = options
return obj
end
end
src/doc/templates/json_commands.nit:15,1--294,3