From 1ce05411e05897ed425a88f6eaff3f96fe2ab386 Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 21 Nov 2023 00:26:17 +0100 Subject: [PATCH] feat: add scaffold for operations (command design pattern) --- src/cli.cr | 2 ++ src/operations.cr | 2 ++ src/operations/abstract_command.cr | 8 ++++++++ src/operations/filesystem_create_command.cr | 12 ++++++++++++ src/operations/filesystem_delete_command.cr | 12 ++++++++++++ src/operations/filesystem_edit_command.cr | 12 ++++++++++++ src/operations/filesystem_mount_command.cr | 12 ++++++++++++ src/operations/filesystem_umount_command.cr | 12 ++++++++++++ 8 files changed, 72 insertions(+) create mode 100644 src/operations.cr create mode 100644 src/operations/abstract_command.cr create mode 100644 src/operations/filesystem_create_command.cr create mode 100644 src/operations/filesystem_delete_command.cr create mode 100644 src/operations/filesystem_edit_command.cr create mode 100644 src/operations/filesystem_mount_command.cr create mode 100644 src/operations/filesystem_umount_command.cr diff --git a/src/cli.cr b/src/cli.cr index 631d390..9195377 100644 --- a/src/cli.cr +++ b/src/cli.cr @@ -8,6 +8,8 @@ require "./config" require "./fzf" require "./version" +require "./operations" + module GX class Cli Log = ::Log.for("cli") diff --git a/src/operations.cr b/src/operations.cr new file mode 100644 index 0000000..ae965e8 --- /dev/null +++ b/src/operations.cr @@ -0,0 +1,2 @@ + +require "./operations/*" diff --git a/src/operations/abstract_command.cr b/src/operations/abstract_command.cr new file mode 100644 index 0000000..2b697ad --- /dev/null +++ b/src/operations/abstract_command.cr @@ -0,0 +1,8 @@ + +module GX + module Operations + abstract class AbstractCommand + abstract def execute() + end + end +end diff --git a/src/operations/filesystem_create_command.cr b/src/operations/filesystem_create_command.cr new file mode 100644 index 0000000..b041d01 --- /dev/null +++ b/src/operations/filesystem_create_command.cr @@ -0,0 +1,12 @@ + +require "./abstract_command" + +module GX + module Operations + class FilesystemCreateCommand < AbstractCommand + def execute() + raise "Not Implemented" + end + end + end +end diff --git a/src/operations/filesystem_delete_command.cr b/src/operations/filesystem_delete_command.cr new file mode 100644 index 0000000..494180c --- /dev/null +++ b/src/operations/filesystem_delete_command.cr @@ -0,0 +1,12 @@ + +require "./abstract_command" + +module GX + module Operations + class FilesystemDeleteCommand < AbstractCommand + def execute() + raise "Not Implemented" + end + end + end +end diff --git a/src/operations/filesystem_edit_command.cr b/src/operations/filesystem_edit_command.cr new file mode 100644 index 0000000..270ace9 --- /dev/null +++ b/src/operations/filesystem_edit_command.cr @@ -0,0 +1,12 @@ + +require "./abstract_command" + +module GX + module Operations + class FilesystemEditCommand < AbstractCommand + def execute() + raise "Not Implemented" + end + end + end +end diff --git a/src/operations/filesystem_mount_command.cr b/src/operations/filesystem_mount_command.cr new file mode 100644 index 0000000..944184a --- /dev/null +++ b/src/operations/filesystem_mount_command.cr @@ -0,0 +1,12 @@ + +require "./abstract_command" + +module GX + module Operations + class FilesystemMountCommand < AbstractCommand + def execute() + raise "Not Implemented" + end + end + end +end diff --git a/src/operations/filesystem_umount_command.cr b/src/operations/filesystem_umount_command.cr new file mode 100644 index 0000000..fd76741 --- /dev/null +++ b/src/operations/filesystem_umount_command.cr @@ -0,0 +1,12 @@ + +require "./abstract_command" + +module GX + module Operations + class FilesystemUmountCommand < AbstractCommand + def execute() + raise "Not Implemented" + end + end + end +end