From a8db897f2236405dd0d7c506bf392fd1702bb1ee Mon Sep 17 00:00:00 2001 From: SenjeyB Date: Mon, 9 Dec 2024 19:14:25 +0300 Subject: [PATCH 1/7] added a simple impl --- src/commands/docs.js | 7 +++++++ src/eoc.js | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 src/commands/docs.js diff --git a/src/commands/docs.js b/src/commands/docs.js new file mode 100644 index 0000000..5dafdd4 --- /dev/null +++ b/src/commands/docs.js @@ -0,0 +1,7 @@ +/** + * Command to create docs from .EO sources. + * @param {Hash} opts - All options + */ +module.exports = function(opts) { + console.info('Hello World!'); +}; \ No newline at end of file diff --git a/src/eoc.js b/src/eoc.js index 536c44a..d048a16 100755 --- a/src/eoc.js +++ b/src/eoc.js @@ -49,6 +49,7 @@ const common = { sodg: require('./commands/sodg'), unphi: require('./commands/unphi'), lint: require('./commands/lint'), + docs: require('./commands/docs'), jeo_disassemble: require('./commands/jeo/disassemble'), jeo_assemble: require('./commands/jeo/assemble') }; @@ -347,6 +348,12 @@ program.command('test') } }); +program.command('docs') + .description('Generate documentation from XMIR files') + .action((str, opts) => { + coms().docs(program.opts()); + }); + program.command('jeo:disassemble') .description('Disassemble .class files to .xmir files') .option('--jeo-version ', 'Version of JEO to use', '0.6.11') From 4d5211315dcb798e3cbfea52f2501907ef13e341 Mon Sep 17 00:00:00 2001 From: SenjeyB Date: Mon, 9 Dec 2024 19:47:13 +0300 Subject: [PATCH 2/7] Newline --- src/commands/docs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/docs.js b/src/commands/docs.js index 5dafdd4..49a482f 100644 --- a/src/commands/docs.js +++ b/src/commands/docs.js @@ -4,4 +4,4 @@ */ module.exports = function(opts) { console.info('Hello World!'); -}; \ No newline at end of file +}; From 7e1897458987b1434c018dfbce65f261b30aff6d Mon Sep 17 00:00:00 2001 From: SenjeyB Date: Mon, 9 Dec 2024 20:19:30 +0300 Subject: [PATCH 3/7] fix --- src/commands/docs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/docs.js b/src/commands/docs.js index 49a482f..8041962 100644 --- a/src/commands/docs.js +++ b/src/commands/docs.js @@ -3,5 +3,5 @@ * @param {Hash} opts - All options */ module.exports = function(opts) { - console.info('Hello World!'); + console.info('Hello World!'); }; From e510ccf92f548f9fb19e46acb63990e918668147 Mon Sep 17 00:00:00 2001 From: SenjeyB Date: Tue, 10 Dec 2024 15:51:47 +0300 Subject: [PATCH 4/7] Changes license --- .github/workflows/telegram.yml | 2 +- src/commands/docs.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/telegram.yml b/.github/workflows/telegram.yml index 61180a5..31614f8 100644 --- a/.github/workflows/telegram.yml +++ b/.github/workflows/telegram.yml @@ -1,6 +1,6 @@ # The MIT License (MIT) # -# Copyright (c) 2016-2024 Objectionary.com +# Copyright (c) 2022-2024 Objectionary.com # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/src/commands/docs.js b/src/commands/docs.js index 8041962..3039586 100644 --- a/src/commands/docs.js +++ b/src/commands/docs.js @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2022-2024 Objectionary.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + /** * Command to create docs from .EO sources. * @param {Hash} opts - All options From 2e5a2c808fd15c387d7af6a280ccd0730790104d Mon Sep 17 00:00:00 2001 From: SenjeyB Date: Tue, 10 Dec 2024 16:39:05 +0300 Subject: [PATCH 5/7] Changed message --- src/commands/docs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/docs.js b/src/commands/docs.js index 3039586..cf39b63 100644 --- a/src/commands/docs.js +++ b/src/commands/docs.js @@ -27,5 +27,5 @@ * @param {Hash} opts - All options */ module.exports = function(opts) { - console.info('Hello World!'); + console.info('This command is not yet implemented, sorry'); }; From a557fff1a1e0ba945de7c3c82decde177c020928 Mon Sep 17 00:00:00 2001 From: SenjeyB Date: Tue, 10 Dec 2024 16:52:55 +0300 Subject: [PATCH 6/7] Added tests --- test/commands/test_docs.js | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/commands/test_docs.js diff --git a/test/commands/test_docs.js b/test/commands/test_docs.js new file mode 100644 index 0000000..824b1c6 --- /dev/null +++ b/test/commands/test_docs.js @@ -0,0 +1,43 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2022-2024 Objectionary.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +const assert = require('assert'); +const {runSync} = require('../helpers'); + +/** + * It should print a "not yet implemented" message when run. + * @param {Function} done - Mocha's callback to signal completion + */ +describe('docs', function() { + + it('generate documentation from XMIR files', function(done) { + const stdout = runSync(['docs']); + assert( + stdout.includes('This command is not yet implemented, sorry'), + `Expected "This command is not yet implemented, sorry" but got: ${stdout}` + ); + done(); + }); + +}); From 18af1c195ba818bab5f228f5a2492a5ac4f56d58 Mon Sep 17 00:00:00 2001 From: SenjeyB Date: Tue, 10 Dec 2024 17:15:31 +0300 Subject: [PATCH 7/7] Test fix --- test/commands/test_docs.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/commands/test_docs.js b/test/commands/test_docs.js index 824b1c6..287ceeb 100644 --- a/test/commands/test_docs.js +++ b/test/commands/test_docs.js @@ -30,7 +30,6 @@ const {runSync} = require('../helpers'); * @param {Function} done - Mocha's callback to signal completion */ describe('docs', function() { - it('generate documentation from XMIR files', function(done) { const stdout = runSync(['docs']); assert( @@ -39,5 +38,4 @@ describe('docs', function() { ); done(); }); - });