cli: shorten mixin names

This commit is contained in:
0x1eef 2024-01-16 17:46:47 -03:00
parent a017048b21
commit ed761c2418
9 changed files with 14 additions and 14 deletions

View file

@ -6,8 +6,8 @@ class Twenty::Command < Cmd
##
# mixins
require_relative "command/mixin/common_option_mixin"
require_relative "command/mixin/pending_migration_mixin"
require_relative "command/mixin/sqlite_connection_mixin"
require_relative "command/mixin/migration_mixin"
require_relative "command/mixin/sqlite_mixin"
##
# commands

View file

@ -3,8 +3,8 @@
class Twenty::Command::Connect < Twenty::Command
set_banner usage: "twenty connect [OPTIONS]",
description: "Connect a project to twenty"
prepend Twenty::Command::PendingMigrationMixin
prepend Twenty::Command::SQLiteConnectionMixin
prepend Twenty::Command::MigrationMixin
prepend Twenty::Command::SQLiteMixin
def run
options = parse_options(argv)

View file

@ -4,8 +4,8 @@ class Twenty::Command::Console < Twenty::Command
set_banner usage: "twenty console [OPTIONS]",
description: "Start the twenty developer console"
include CommonOptionMixin
prepend Twenty::Command::PendingMigrationMixin
prepend Twenty::Command::SQLiteConnectionMixin
prepend Twenty::Command::MigrationMixin
prepend Twenty::Command::SQLiteMixin
def run
options = parse_options(argv)

View file

@ -3,8 +3,8 @@
class Twenty::Command::Disconnect < Twenty::Command
set_banner usage: "twenty disconnect [OPTIONS]",
description: "Disconnect a project from twenty"
prepend Twenty::Command::PendingMigrationMixin
prepend Twenty::Command::SQLiteConnectionMixin
prepend Twenty::Command::MigrationMixin
prepend Twenty::Command::SQLiteMixin
def run
options = parse_options(argv)

View file

@ -3,7 +3,7 @@
class Twenty::Command::Down < Twenty::Command
set_banner usage: "twenty down [OPTIONS]",
description: "Stop the twenty web server"
prepend Twenty::Command::SQLiteConnectionMixin
prepend Twenty::Command::SQLiteMixin
def run
options = parse_options(argv)

View file

@ -4,7 +4,7 @@ class Twenty::Command::Migrate < Twenty::Command
set_banner usage: "twenty migrate [OPTIONS]",
description: "Migrate the database"
include CommonOptionMixin
prepend Twenty::Command::SQLiteConnectionMixin
prepend Twenty::Command::SQLiteMixin
def run
options = parse_options(argv)

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
module Twenty::Command::PendingMigrationMixin
module Twenty::Command::MigrationMixin
def run_command(...)
if pending_migrations?
warn "There are pending migrations.\n" \

View file

@ -1,4 +1,4 @@
module Twenty::Command::SQLiteConnectionMixin
module Twenty::Command::SQLiteMixin
def run_command(options)
path = options.database || Twenty.default_database
Twenty.establish_connection(path:)

View file

@ -4,8 +4,8 @@ class Twenty::Command::Up < Twenty::Command
set_banner usage: "twenty up [OPTIONS]",
description: "Start the twenty web server"
include CommonOptionMixin
prepend Twenty::Command::PendingMigrationMixin
prepend Twenty::Command::SQLiteConnectionMixin
prepend Twenty::Command::MigrationMixin
prepend Twenty::Command::SQLiteMixin
def run
options = parse_options(argv)