import commands::commands_graph
import commands::commands_usage
import commands::commands_catalog
+import commands::commands_ini
import templates::templates_json
import catalog::catalog_json
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
cmd.init_command
print_json cmd.to_json
end
+
+ # CmdIni
+
+ fun test_cmd_ini_desc is test do
+ var cmd = new CmdIniDescription(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_git is test do
+ var cmd = new CmdIniGitUrl(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_clone is test do
+ var cmd = new CmdIniCloneCommand(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_issues is test do
+ var cmd = new CmdIniIssuesUrl(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_maintainer is test do
+ var cmd = new CmdIniMaintainer(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_contributors is test do
+ var cmd = new CmdIniContributors(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_license is test do
+ var cmd = new CmdIniLicense(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_license_file is test do
+ var cmd = new CmdLicenseFile(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ cmd.file = cmd.file.as(not null).basename # for testing path
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_license_file_content is test do
+ var cmd = new CmdLicenseFileContent(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ cmd.file = cmd.file.as(not null).basename # for testing path
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_contrib_file is test do
+ var cmd = new CmdContribFile(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ cmd.file = cmd.file.as(not null).basename # for testing path
+ print_json cmd.to_json
+ end
+
+ fun test_cmd_ini_contrib_file_content is test do
+ var cmd = new CmdContribFileContent(test_view, mentity_name = "test_prog")
+ cmd.init_command
+ cmd.file = cmd.file.as(not null).basename # for testing path
+ print_json cmd.to_json
+ end
end
redef class nitc::Location
--- /dev/null
+{
+ "command": "git clone https://github.com/nitlang/nit.git"
+}
--- /dev/null
+{
+ "file": "CONTRIBUTING.md"
+}
--- /dev/null
+{
+ "file": "CONTRIBUTING.md",
+ "content": "# Contributing rules\n\n* Be nice\n* Be polite\n* Code well\n"
+}
--- /dev/null
+{
+ "contributors": ["Riri <riri@example.com>", "Fifi (http://www.example.com/~fifi)", "Loulou"]
+}
--- /dev/null
+{
+ "desc": "Dummy program used for testing Nit tools"
+}
--- /dev/null
+{
+ "url": "https://github.com/nitlang/nit.git"
+}
--- /dev/null
+{
+ "url": "https://github.com/nitlang/nit/issues"
+}
--- /dev/null
+{
+ "license": "Apache-2.0"
+}
--- /dev/null
+{
+ "file": "LICENSE.md"
+}
--- /dev/null
+{
+ "file": "LICENSE.md",
+ "content": "# My Custom License\n\nThis is the license content.\n"
+}
--- /dev/null
+{
+ "maintainer": "John Doe <jdoe@example.com> (http://www.example.com/~jdoe), Spider-Man"
+}