Move the mastodon/*_cli files to mastodon/cli/* (#24139)
parent
c9f980b268
commit
b6b4ea4ca5
@ -1,13 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'set'
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class AccountsCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class Accounts < Thor
|
||||
include Helper
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
@ -1,12 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class CacheCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class Cache < Thor
|
||||
include Helper
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
@ -1,13 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'concurrent'
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class CanonicalEmailBlocksCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class CanonicalEmailBlocks < Thor
|
||||
include Helper
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
@ -1,13 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'concurrent'
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class DomainsCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class Domains < Thor
|
||||
include Helper
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
@ -1,13 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'concurrent'
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class EmailDomainBlocksCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class EmailDomainBlocks < Thor
|
||||
include Helper
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
@ -1,12 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rubygems/package'
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class EmojiCLI < Thor
|
||||
module Mastodon::CLI
|
||||
class Emoji < Thor
|
||||
def self.exit_on_failure?
|
||||
true
|
||||
end
|
@ -1,12 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class FeedsCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class Feeds < Thor
|
||||
include Helper
|
||||
include Redisable
|
||||
|
||||
def self.exit_on_failure?
|
@ -1,12 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rubygems/package'
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class IpBlocksCLI < Thor
|
||||
module Mastodon::CLI
|
||||
class IpBlocks < Thor
|
||||
def self.exit_on_failure?
|
||||
true
|
||||
end
|
@ -1,73 +1,73 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'thor'
|
||||
require_relative 'mastodon/media_cli'
|
||||
require_relative 'mastodon/emoji_cli'
|
||||
require_relative 'mastodon/accounts_cli'
|
||||
require_relative 'mastodon/feeds_cli'
|
||||
require_relative 'mastodon/search_cli'
|
||||
require_relative 'mastodon/settings_cli'
|
||||
require_relative 'mastodon/statuses_cli'
|
||||
require_relative 'mastodon/domains_cli'
|
||||
require_relative 'mastodon/preview_cards_cli'
|
||||
require_relative 'mastodon/cache_cli'
|
||||
require_relative 'mastodon/upgrade_cli'
|
||||
require_relative 'mastodon/email_domain_blocks_cli'
|
||||
require_relative 'mastodon/canonical_email_blocks_cli'
|
||||
require_relative 'mastodon/ip_blocks_cli'
|
||||
require_relative 'mastodon/maintenance_cli'
|
||||
require_relative 'mastodon/version'
|
||||
|
||||
module Mastodon
|
||||
class CLI < Thor
|
||||
require_relative 'media'
|
||||
require_relative 'emoji'
|
||||
require_relative 'accounts'
|
||||
require_relative 'feeds'
|
||||
require_relative 'search'
|
||||
require_relative 'settings'
|
||||
require_relative 'statuses'
|
||||
require_relative 'domains'
|
||||
require_relative 'preview_cards'
|
||||
require_relative 'cache'
|
||||
require_relative 'upgrade'
|
||||
require_relative 'email_domain_blocks'
|
||||
require_relative 'canonical_email_blocks'
|
||||
require_relative 'ip_blocks'
|
||||
require_relative 'maintenance'
|
||||
require_relative '../version'
|
||||
|
||||
module Mastodon::CLI
|
||||
class Main < Thor
|
||||
def self.exit_on_failure?
|
||||
true
|
||||
end
|
||||
|
||||
desc 'media SUBCOMMAND ...ARGS', 'Manage media files'
|
||||
subcommand 'media', Mastodon::MediaCLI
|
||||
subcommand 'media', Media
|
||||
|
||||
desc 'emoji SUBCOMMAND ...ARGS', 'Manage custom emoji'
|
||||
subcommand 'emoji', Mastodon::EmojiCLI
|
||||
subcommand 'emoji', Emoji
|
||||
|
||||
desc 'accounts SUBCOMMAND ...ARGS', 'Manage accounts'
|
||||
subcommand 'accounts', Mastodon::AccountsCLI
|
||||
subcommand 'accounts', Accounts
|
||||
|
||||
desc 'feeds SUBCOMMAND ...ARGS', 'Manage feeds'
|
||||
subcommand 'feeds', Mastodon::FeedsCLI
|
||||
subcommand 'feeds', Feeds
|
||||
|
||||
desc 'search SUBCOMMAND ...ARGS', 'Manage the search engine'
|
||||
subcommand 'search', Mastodon::SearchCLI
|
||||
subcommand 'search', Search
|
||||
|
||||
desc 'settings SUBCOMMAND ...ARGS', 'Manage dynamic settings'
|
||||
subcommand 'settings', Mastodon::SettingsCLI
|
||||
subcommand 'settings', Settings
|
||||
|
||||
desc 'statuses SUBCOMMAND ...ARGS', 'Manage statuses'
|
||||
subcommand 'statuses', Mastodon::StatusesCLI
|
||||
subcommand 'statuses', Statuses
|
||||
|
||||
desc 'domains SUBCOMMAND ...ARGS', 'Manage account domains'
|
||||
subcommand 'domains', Mastodon::DomainsCLI
|
||||
subcommand 'domains', Domains
|
||||
|
||||
desc 'preview_cards SUBCOMMAND ...ARGS', 'Manage preview cards'
|
||||
subcommand 'preview_cards', Mastodon::PreviewCardsCLI
|
||||
subcommand 'preview_cards', PreviewCards
|
||||
|
||||
desc 'cache SUBCOMMAND ...ARGS', 'Manage cache'
|
||||
subcommand 'cache', Mastodon::CacheCLI
|
||||
subcommand 'cache', Cache
|
||||
|
||||
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'
|
||||
subcommand 'email_domain_blocks', Mastodon::EmailDomainBlocksCLI
|
||||
subcommand 'email_domain_blocks', EmailDomainBlocks
|
||||
|
||||
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'
|
||||
subcommand 'canonical_email_blocks', Mastodon::CanonicalEmailBlocksCLI
|
||||
subcommand 'canonical_email_blocks', CanonicalEmailBlocks
|
||||
|
||||
desc 'maintenance SUBCOMMAND ...ARGS', 'Various maintenance utilities'
|
||||
subcommand 'maintenance', Mastodon::MaintenanceCLI
|
||||
subcommand 'maintenance', Maintenance
|
||||
|
||||
option :dry_run, type: :boolean
|
||||
desc 'self-destruct', 'Erase the server from the federation'
|
@ -1,13 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'tty-prompt'
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class MaintenanceCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class Maintenance < Thor
|
||||
include Helper
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
@ -1,13 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class MediaCLI < Thor
|
||||
module Mastodon::CLI
|
||||
class Media < Thor
|
||||
include ActionView::Helpers::NumberHelper
|
||||
include CLIHelper
|
||||
include Helper
|
||||
|
||||
VALID_PATH_SEGMENTS_SIZE = [7, 10].freeze
|
||||
|
@ -1,14 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'tty-prompt'
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class PreviewCardsCLI < Thor
|
||||
module Mastodon::CLI
|
||||
class PreviewCards < Thor
|
||||
include ActionView::Helpers::NumberHelper
|
||||
include CLIHelper
|
||||
include Helper
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
@ -1,12 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class SearchCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class Search < Thor
|
||||
include Helper
|
||||
|
||||
# Indices are sorted by amount of data to be expected in each, so that
|
||||
# smaller indices can go online sooner
|
@ -1,12 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class StatusesCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class Statuses < Thor
|
||||
include Helper
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
def self.exit_on_failure?
|
@ -1,12 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../../config/boot'
|
||||
require_relative '../../config/environment'
|
||||
require_relative 'cli_helper'
|
||||
require_relative '../../../config/boot'
|
||||
require_relative '../../../config/environment'
|
||||
require_relative 'helper'
|
||||
|
||||
module Mastodon
|
||||
class UpgradeCLI < Thor
|
||||
include CLIHelper
|
||||
module Mastodon::CLI
|
||||
class Upgrade < Thor
|
||||
include Helper
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
@ -1,9 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
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 }
|
||||
|
||||
describe '#add' do
|
@ -1,9 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
require 'cli'
|
||||
require 'mastodon/cli/main'
|
||||
|
||||
describe Mastodon::CLI do
|
||||
describe Mastodon::CLI::Main do
|
||||
describe 'version' do
|
||||
it 'returns the Mastodon version' do
|
||||
expect { described_class.new.invoke(:version) }.to output(
|
@ -1,11 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
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
|
||||
let(:cli) { Mastodon::RegistrationsCLI.new }
|
||||
let(:cli) { Mastodon::CLI::Registrations.new }
|
||||
|
||||
before do
|
||||
Setting.registrations_mode = nil
|
Loading…
Reference in new issue