mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 11:48:06 +01:00
Move the mastodon/*_cli files to mastodon/cli/* (#24139)
This commit is contained in:
parent
c9f980b268
commit
b6b4ea4ca5
23 changed files with 149 additions and 151 deletions
18
.rubocop.yml
18
.rubocop.yml
|
@ -43,7 +43,7 @@ Layout/LineLength:
|
||||||
- !ruby/regexp / \# .*$/
|
- !ruby/regexp / \# .*$/
|
||||||
- !ruby/regexp /^\# .*$/
|
- !ruby/regexp /^\# .*$/
|
||||||
Exclude:
|
Exclude:
|
||||||
- lib/**/*cli*.rb
|
- 'lib/mastodon/cli/*.rb'
|
||||||
- db/*migrate/**/*
|
- db/*migrate/**/*
|
||||||
- db/seeds/**/*
|
- db/seeds/**/*
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ Lint/UselessAccessModifier:
|
||||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsabcsize
|
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsabcsize
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'lib/**/*cli*.rb'
|
- 'lib/mastodon/cli/*.rb'
|
||||||
- db/*migrate/**/*
|
- db/*migrate/**/*
|
||||||
|
|
||||||
# Reason: Some functions cannot be broken up, but others may be refactor candidates
|
# Reason: Some functions cannot be broken up, but others may be refactor candidates
|
||||||
|
@ -66,7 +66,7 @@ Metrics/BlockLength:
|
||||||
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
|
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'config/routes.rb'
|
- 'config/routes.rb'
|
||||||
- 'lib/mastodon/*_cli.rb'
|
- 'lib/mastodon/cli/*.rb'
|
||||||
- 'lib/tasks/*.rake'
|
- 'lib/tasks/*.rake'
|
||||||
- 'app/models/concerns/account_associations.rb'
|
- 'app/models/concerns/account_associations.rb'
|
||||||
- 'app/models/concerns/account_interactions.rb'
|
- 'app/models/concerns/account_interactions.rb'
|
||||||
|
@ -95,14 +95,14 @@ Metrics/BlockLength:
|
||||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocknesting
|
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocknesting
|
||||||
Metrics/BlockNesting:
|
Metrics/BlockNesting:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'lib/mastodon/*_cli.rb'
|
- 'lib/mastodon/cli/*.rb'
|
||||||
|
|
||||||
# Reason: Some Excluded files would be candidates for refactoring but not currently addressed
|
# Reason: Some Excluded files would be candidates for refactoring but not currently addressed
|
||||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
|
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
|
||||||
Metrics/ClassLength:
|
Metrics/ClassLength:
|
||||||
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
|
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'lib/mastodon/*_cli.rb'
|
- 'lib/mastodon/cli/*.rb'
|
||||||
- 'app/controllers/admin/accounts_controller.rb'
|
- 'app/controllers/admin/accounts_controller.rb'
|
||||||
- 'app/controllers/api/base_controller.rb'
|
- 'app/controllers/api/base_controller.rb'
|
||||||
- 'app/controllers/api/v1/admin/accounts_controller.rb'
|
- 'app/controllers/api/v1/admin/accounts_controller.rb'
|
||||||
|
@ -146,7 +146,7 @@ Metrics/ClassLength:
|
||||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricscyclomaticcomplexity
|
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricscyclomaticcomplexity
|
||||||
Metrics/CyclomaticComplexity:
|
Metrics/CyclomaticComplexity:
|
||||||
Exclude:
|
Exclude:
|
||||||
- lib/mastodon/*cli*.rb
|
- lib/mastodon/cli/*.rb
|
||||||
- db/*migrate/**/*
|
- db/*migrate/**/*
|
||||||
|
|
||||||
# Reason: Currently disabled in .rubocop_todo.yml
|
# Reason: Currently disabled in .rubocop_todo.yml
|
||||||
|
@ -154,7 +154,7 @@ Metrics/CyclomaticComplexity:
|
||||||
Metrics/MethodLength:
|
Metrics/MethodLength:
|
||||||
CountAsOne: [array, heredoc]
|
CountAsOne: [array, heredoc]
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'lib/mastodon/*_cli.rb'
|
- 'lib/mastodon/cli/*.rb'
|
||||||
|
|
||||||
# Reason:
|
# Reason:
|
||||||
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmodulelength
|
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmodulelength
|
||||||
|
@ -176,9 +176,7 @@ Rails/HttpStatus:
|
||||||
Rails/Exit:
|
Rails/Exit:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'config/boot.rb'
|
- 'config/boot.rb'
|
||||||
- 'lib/mastodon/*_cli.rb'
|
- 'lib/mastodon/cli/*.rb'
|
||||||
- 'lib/mastodon/cli_helper.rb'
|
|
||||||
- 'lib/cli.rb'
|
|
||||||
|
|
||||||
# Reason: Some single letter camel case files shouldn't be split
|
# Reason: Some single letter camel case files shouldn't be split
|
||||||
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath
|
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath
|
||||||
|
|
|
@ -846,9 +846,9 @@ Rails/SkipsModelValidations:
|
||||||
- 'db/post_migrate/20220617202502_migrate_roles.rb'
|
- 'db/post_migrate/20220617202502_migrate_roles.rb'
|
||||||
- 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb'
|
- 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb'
|
||||||
- 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb'
|
- 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb'
|
||||||
- 'lib/cli.rb'
|
- 'lib/mastodon/cli/accounts.rb'
|
||||||
- 'lib/mastodon/accounts_cli.rb'
|
- 'lib/mastodon/cli/main.rb'
|
||||||
- 'lib/mastodon/maintenance_cli.rb'
|
- 'lib/mastodon/cli/maintenance.rb'
|
||||||
- 'spec/controllers/api/v1/admin/accounts_controller_spec.rb'
|
- 'spec/controllers/api/v1/admin/accounts_controller_spec.rb'
|
||||||
- 'spec/lib/activitypub/activity/follow_spec.rb'
|
- 'spec/lib/activitypub/activity/follow_spec.rb'
|
||||||
- 'spec/services/follow_service_spec.rb'
|
- 'spec/services/follow_service_spec.rb'
|
||||||
|
@ -929,7 +929,7 @@ Rails/WhereExists:
|
||||||
- 'app/validators/vote_validator.rb'
|
- 'app/validators/vote_validator.rb'
|
||||||
- 'app/workers/move_worker.rb'
|
- 'app/workers/move_worker.rb'
|
||||||
- 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb'
|
- 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb'
|
||||||
- 'lib/mastodon/email_domain_blocks_cli.rb'
|
- 'lib/mastodon/cli/email_domain_blocks.rb'
|
||||||
- 'lib/tasks/tests.rake'
|
- 'lib/tasks/tests.rake'
|
||||||
- 'spec/controllers/api/v1/accounts/notes_controller_spec.rb'
|
- 'spec/controllers/api/v1/accounts/notes_controller_spec.rb'
|
||||||
- 'spec/controllers/api/v1/tags_controller_spec.rb'
|
- 'spec/controllers/api/v1/tags_controller_spec.rb'
|
||||||
|
@ -991,7 +991,7 @@ Style/FormatStringToken:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/models/privacy_policy.rb'
|
- 'app/models/privacy_policy.rb'
|
||||||
- 'config/initializers/devise.rb'
|
- 'config/initializers/devise.rb'
|
||||||
- 'lib/mastodon/maintenance_cli.rb'
|
- 'lib/mastodon/cli/maintenance.rb'
|
||||||
- 'lib/paperclip/color_extractor.rb'
|
- 'lib/paperclip/color_extractor.rb'
|
||||||
|
|
||||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||||
|
@ -1436,9 +1436,9 @@ Style/GuardClause:
|
||||||
- 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb'
|
- 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb'
|
||||||
- 'lib/devise/two_factor_ldap_authenticatable.rb'
|
- 'lib/devise/two_factor_ldap_authenticatable.rb'
|
||||||
- 'lib/devise/two_factor_pam_authenticatable.rb'
|
- 'lib/devise/two_factor_pam_authenticatable.rb'
|
||||||
- 'lib/mastodon/accounts_cli.rb'
|
- 'lib/mastodon/cli/accounts.rb'
|
||||||
- 'lib/mastodon/maintenance_cli.rb'
|
- 'lib/mastodon/cli/maintenance.rb'
|
||||||
- 'lib/mastodon/media_cli.rb'
|
- 'lib/mastodon/cli/media.rb'
|
||||||
- 'lib/paperclip/attachment_extensions.rb'
|
- 'lib/paperclip/attachment_extensions.rb'
|
||||||
- 'lib/tasks/repo.rake'
|
- 'lib/tasks/repo.rake'
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
APP_PATH = File.expand_path('../config/application', __dir__)
|
APP_PATH = File.expand_path('../config/application', __dir__)
|
||||||
|
|
||||||
require_relative '../config/boot'
|
require_relative '../config/boot'
|
||||||
require_relative '../lib/cli'
|
require_relative '../lib/mastodon/cli/main'
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Chewy.strategy(:mastodon) do
|
Chewy.strategy(:mastodon) do
|
||||||
Mastodon::CLI.start(ARGV)
|
Mastodon::CLI::Main.start(ARGV)
|
||||||
end
|
end
|
||||||
rescue Interrupt
|
rescue Interrupt
|
||||||
exit(130)
|
exit(130)
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'set'
|
require 'set'
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class AccountsCLI < Thor
|
class Accounts < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
|
@ -1,12 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class CacheCLI < Thor
|
class Cache < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
|
@ -1,13 +1,13 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'concurrent'
|
require 'concurrent'
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class CanonicalEmailBlocksCLI < Thor
|
class CanonicalEmailBlocks < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
|
@ -1,13 +1,13 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'concurrent'
|
require 'concurrent'
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class DomainsCLI < Thor
|
class Domains < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
|
@ -1,13 +1,13 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'concurrent'
|
require 'concurrent'
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class EmailDomainBlocksCLI < Thor
|
class EmailDomainBlocks < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
|
@ -1,12 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rubygems/package'
|
require 'rubygems/package'
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class EmojiCLI < Thor
|
class Emoji < Thor
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
||||||
end
|
end
|
|
@ -1,12 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class FeedsCLI < Thor
|
class Feeds < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
include Redisable
|
include Redisable
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
|
@ -9,8 +9,8 @@ HttpLog.configuration.logger = dev_null
|
||||||
Paperclip.options[:log] = false
|
Paperclip.options[:log] = false
|
||||||
Chewy.logger = dev_null
|
Chewy.logger = dev_null
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
module CLIHelper
|
module Helper
|
||||||
def dry_run?
|
def dry_run?
|
||||||
options[:dry_run]
|
options[:dry_run]
|
||||||
end
|
end
|
|
@ -1,12 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rubygems/package'
|
require 'rubygems/package'
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class IpBlocksCLI < Thor
|
class IpBlocks < Thor
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
||||||
end
|
end
|
|
@ -1,73 +1,73 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'thor'
|
require 'thor'
|
||||||
require_relative 'mastodon/media_cli'
|
require_relative 'media'
|
||||||
require_relative 'mastodon/emoji_cli'
|
require_relative 'emoji'
|
||||||
require_relative 'mastodon/accounts_cli'
|
require_relative 'accounts'
|
||||||
require_relative 'mastodon/feeds_cli'
|
require_relative 'feeds'
|
||||||
require_relative 'mastodon/search_cli'
|
require_relative 'search'
|
||||||
require_relative 'mastodon/settings_cli'
|
require_relative 'settings'
|
||||||
require_relative 'mastodon/statuses_cli'
|
require_relative 'statuses'
|
||||||
require_relative 'mastodon/domains_cli'
|
require_relative 'domains'
|
||||||
require_relative 'mastodon/preview_cards_cli'
|
require_relative 'preview_cards'
|
||||||
require_relative 'mastodon/cache_cli'
|
require_relative 'cache'
|
||||||
require_relative 'mastodon/upgrade_cli'
|
require_relative 'upgrade'
|
||||||
require_relative 'mastodon/email_domain_blocks_cli'
|
require_relative 'email_domain_blocks'
|
||||||
require_relative 'mastodon/canonical_email_blocks_cli'
|
require_relative 'canonical_email_blocks'
|
||||||
require_relative 'mastodon/ip_blocks_cli'
|
require_relative 'ip_blocks'
|
||||||
require_relative 'mastodon/maintenance_cli'
|
require_relative 'maintenance'
|
||||||
require_relative 'mastodon/version'
|
require_relative '../version'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class CLI < Thor
|
class Main < Thor
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'media SUBCOMMAND ...ARGS', 'Manage media files'
|
desc 'media SUBCOMMAND ...ARGS', 'Manage media files'
|
||||||
subcommand 'media', Mastodon::MediaCLI
|
subcommand 'media', Media
|
||||||
|
|
||||||
desc 'emoji SUBCOMMAND ...ARGS', 'Manage custom emoji'
|
desc 'emoji SUBCOMMAND ...ARGS', 'Manage custom emoji'
|
||||||
subcommand 'emoji', Mastodon::EmojiCLI
|
subcommand 'emoji', Emoji
|
||||||
|
|
||||||
desc 'accounts SUBCOMMAND ...ARGS', 'Manage accounts'
|
desc 'accounts SUBCOMMAND ...ARGS', 'Manage accounts'
|
||||||
subcommand 'accounts', Mastodon::AccountsCLI
|
subcommand 'accounts', Accounts
|
||||||
|
|
||||||
desc 'feeds SUBCOMMAND ...ARGS', 'Manage feeds'
|
desc 'feeds SUBCOMMAND ...ARGS', 'Manage feeds'
|
||||||
subcommand 'feeds', Mastodon::FeedsCLI
|
subcommand 'feeds', Feeds
|
||||||
|
|
||||||
desc 'search SUBCOMMAND ...ARGS', 'Manage the search engine'
|
desc 'search SUBCOMMAND ...ARGS', 'Manage the search engine'
|
||||||
subcommand 'search', Mastodon::SearchCLI
|
subcommand 'search', Search
|
||||||
|
|
||||||
desc 'settings SUBCOMMAND ...ARGS', 'Manage dynamic settings'
|
desc 'settings SUBCOMMAND ...ARGS', 'Manage dynamic settings'
|
||||||
subcommand 'settings', Mastodon::SettingsCLI
|
subcommand 'settings', Settings
|
||||||
|
|
||||||
desc 'statuses SUBCOMMAND ...ARGS', 'Manage statuses'
|
desc 'statuses SUBCOMMAND ...ARGS', 'Manage statuses'
|
||||||
subcommand 'statuses', Mastodon::StatusesCLI
|
subcommand 'statuses', Statuses
|
||||||
|
|
||||||
desc 'domains SUBCOMMAND ...ARGS', 'Manage account domains'
|
desc 'domains SUBCOMMAND ...ARGS', 'Manage account domains'
|
||||||
subcommand 'domains', Mastodon::DomainsCLI
|
subcommand 'domains', Domains
|
||||||
|
|
||||||
desc 'preview_cards SUBCOMMAND ...ARGS', 'Manage preview cards'
|
desc 'preview_cards SUBCOMMAND ...ARGS', 'Manage preview cards'
|
||||||
subcommand 'preview_cards', Mastodon::PreviewCardsCLI
|
subcommand 'preview_cards', PreviewCards
|
||||||
|
|
||||||
desc 'cache SUBCOMMAND ...ARGS', 'Manage cache'
|
desc 'cache SUBCOMMAND ...ARGS', 'Manage cache'
|
||||||
subcommand 'cache', Mastodon::CacheCLI
|
subcommand 'cache', Cache
|
||||||
|
|
||||||
desc 'upgrade SUBCOMMAND ...ARGS', 'Various version upgrade utilities'
|
desc 'upgrade SUBCOMMAND ...ARGS', 'Various version upgrade utilities'
|
||||||
subcommand 'upgrade', Mastodon::UpgradeCLI
|
subcommand 'upgrade', Upgrade
|
||||||
|
|
||||||
desc 'email_domain_blocks SUBCOMMAND ...ARGS', 'Manage e-mail domain blocks'
|
desc 'email_domain_blocks SUBCOMMAND ...ARGS', 'Manage e-mail domain blocks'
|
||||||
subcommand 'email_domain_blocks', Mastodon::EmailDomainBlocksCLI
|
subcommand 'email_domain_blocks', EmailDomainBlocks
|
||||||
|
|
||||||
desc 'ip_blocks SUBCOMMAND ...ARGS', 'Manage IP blocks'
|
desc 'ip_blocks SUBCOMMAND ...ARGS', 'Manage IP blocks'
|
||||||
subcommand 'ip_blocks', Mastodon::IpBlocksCLI
|
subcommand 'ip_blocks', IpBlocks
|
||||||
|
|
||||||
desc 'canonical_email_blocks SUBCOMMAND ...ARGS', 'Manage canonical e-mail blocks'
|
desc 'canonical_email_blocks SUBCOMMAND ...ARGS', 'Manage canonical e-mail blocks'
|
||||||
subcommand 'canonical_email_blocks', Mastodon::CanonicalEmailBlocksCLI
|
subcommand 'canonical_email_blocks', CanonicalEmailBlocks
|
||||||
|
|
||||||
desc 'maintenance SUBCOMMAND ...ARGS', 'Various maintenance utilities'
|
desc 'maintenance SUBCOMMAND ...ARGS', 'Various maintenance utilities'
|
||||||
subcommand 'maintenance', Mastodon::MaintenanceCLI
|
subcommand 'maintenance', Maintenance
|
||||||
|
|
||||||
option :dry_run, type: :boolean
|
option :dry_run, type: :boolean
|
||||||
desc 'self-destruct', 'Erase the server from the federation'
|
desc 'self-destruct', 'Erase the server from the federation'
|
|
@ -1,13 +1,13 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'tty-prompt'
|
require 'tty-prompt'
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class MaintenanceCLI < Thor
|
class Maintenance < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
|
@ -1,13 +1,13 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class MediaCLI < Thor
|
class Media < Thor
|
||||||
include ActionView::Helpers::NumberHelper
|
include ActionView::Helpers::NumberHelper
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
VALID_PATH_SEGMENTS_SIZE = [7, 10].freeze
|
VALID_PATH_SEGMENTS_SIZE = [7, 10].freeze
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'tty-prompt'
|
require 'tty-prompt'
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class PreviewCardsCLI < Thor
|
class PreviewCards < Thor
|
||||||
include ActionView::Helpers::NumberHelper
|
include ActionView::Helpers::NumberHelper
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
|
@ -1,12 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class SearchCLI < Thor
|
class Search < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
# Indices are sorted by amount of data to be expected in each, so that
|
# Indices are sorted by amount of data to be expected in each, so that
|
||||||
# smaller indices can go online sooner
|
# smaller indices can go online sooner
|
|
@ -1,11 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class RegistrationsCLI < Thor
|
class Registrations < Thor
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
@ -37,8 +37,8 @@ module Mastodon
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class SettingsCLI < Thor
|
class Settings < Thor
|
||||||
desc 'registrations SUBCOMMAND ...ARGS', 'Manage state of registrations'
|
desc 'registrations SUBCOMMAND ...ARGS', 'Manage state of registrations'
|
||||||
subcommand 'registrations', RegistrationsCLI
|
subcommand 'registrations', Registrations
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,12 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class StatusesCLI < Thor
|
class Statuses < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
include ActionView::Helpers::NumberHelper
|
include ActionView::Helpers::NumberHelper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
|
@ -1,12 +1,12 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../config/boot'
|
require_relative '../../../config/boot'
|
||||||
require_relative '../../config/environment'
|
require_relative '../../../config/environment'
|
||||||
require_relative 'cli_helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
module Mastodon
|
module Mastodon::CLI
|
||||||
class UpgradeCLI < Thor
|
class Upgrade < Thor
|
||||||
include CLIHelper
|
include Helper
|
||||||
|
|
||||||
def self.exit_on_failure?
|
def self.exit_on_failure?
|
||||||
true
|
true
|
|
@ -1,9 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
require 'mastodon/ip_blocks_cli'
|
require 'mastodon/cli/ip_blocks'
|
||||||
|
|
||||||
RSpec.describe Mastodon::IpBlocksCLI do
|
RSpec.describe Mastodon::CLI::IpBlocks do
|
||||||
let(:cli) { described_class.new }
|
let(:cli) { described_class.new }
|
||||||
|
|
||||||
describe '#add' do
|
describe '#add' do
|
|
@ -1,9 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
require 'cli'
|
require 'mastodon/cli/main'
|
||||||
|
|
||||||
describe Mastodon::CLI do
|
describe Mastodon::CLI::Main do
|
||||||
describe 'version' do
|
describe 'version' do
|
||||||
it 'returns the Mastodon version' do
|
it 'returns the Mastodon version' do
|
||||||
expect { described_class.new.invoke(:version) }.to output(
|
expect { described_class.new.invoke(:version) }.to output(
|
|
@ -1,11 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
require 'mastodon/settings_cli'
|
require 'mastodon/cli/settings'
|
||||||
|
|
||||||
RSpec.describe Mastodon::SettingsCLI do
|
RSpec.describe Mastodon::CLI::Settings do
|
||||||
describe 'subcommand "registrations"' do
|
describe 'subcommand "registrations"' do
|
||||||
let(:cli) { Mastodon::RegistrationsCLI.new }
|
let(:cli) { Mastodon::CLI::Registrations.new }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
Setting.registrations_mode = nil
|
Setting.registrations_mode = nil
|
Loading…
Reference in a new issue