mentity
nitc :: CmdIniMaintainer :: defaultinit
nitc :: CmdIniMaintainer :: maintainer=
Maintainer namenitc $ CmdIniMaintainer :: SELF
Type of this instance, automatically specialized in every classnitc :: html_commands $ CmdIniMaintainer :: to_html
Render results as a HTML stringnitc :: json_commands $ CmdIniMaintainer :: to_json
Return a JSON Serializable representation ofself
results
nitc :: md_commands $ CmdIniMaintainer :: to_md
Render results as a Markdown stringnitc :: CmdEntity :: _mentity_name
Name of the mentity this command is aboutcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: DocCommand :: cmd_filter
Return a new filter for that command execution.nitc :: CmdIni :: defaultinit
nitc :: DocCommand :: defaultinit
nitc :: CmdIniMaintainer :: defaultinit
core :: Object :: defaultinit
nitc :: CmdEntity :: defaultinit
nitc :: DocCommand :: execute
nitc :: DocCommand :: filter=
ModelFilter to apply if anynitc :: DocCommand :: http_init
Init the command from an HTTPRequestcore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: CmdIniMaintainer :: maintainer=
Maintainer namenitc :: CmdEntity :: mentity_name
Name of the mentity this command is aboutnitc :: CmdEntity :: mentity_name=
Name of the mentity this command is aboutcore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: DocCommand :: parser_init
Initialize the command from the CommandParser datanitc :: DocCommand :: to_json
Return a JSON Serializable representation ofself
results
# Cmd that finds the maintainer name of an `mentity`
class CmdIniMaintainer
super CmdIni
# Maintainer name
var maintainer: nullable String = null
redef fun init_command do
var res = super
if not res isa CmdSuccess then return res
var mentity = self.mentity.as(not null)
var ini = self.ini.as(not null)
var maintainer = ini["package.maintainer"]
if maintainer == null then return new WarningNoMaintainer(mentity)
self.maintainer = maintainer
return res
end
end
src/doc/commands/commands_ini.nit:160,1--180,3
redef class CmdIniMaintainer
redef fun to_md do
var name = self.maintainer
if name == null then return ""
return "**{name}**"
end
end
src/doc/templates/md_commands.nit:229,1--235,3
redef class CmdIniMaintainer
redef fun to_json do
var obj = new JsonObject
obj["maintainer"] = maintainer
return obj
end
end
src/doc/templates/json_commands.nit:198,1--204,3
redef class CmdIniMaintainer
redef fun execute(no_color) do
var title = "Maintainer from ini file:"
print_ini(title, maintainer, no_color)
end
end
src/doc/term/term.nit:395,1--400,3
redef class CmdIniMaintainer
redef fun to_html do
var name = self.maintainer
if name == null then return ""
return "<b>{name.html_escape}</b>"
end
end
src/doc/templates/html_commands.nit:254,1--261,3