Sha256: 91cce8ab0b5b206340621470ccb645d77e0215e58524fcef72d4a2a5e0adb3d0

Contents?: true

Size: 1.38 KB

Versions: 14

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

module Miteru
  module Commands
    module Main
      class << self
        def included(thor)
          thor.class_eval do
            include Concerns::DatabaseConnectable

            method_option :auto_download, type: :boolean, default: false,
              desc: "Enable or disable auto-downloading of phishing kits"
            method_option :directory_traveling, type: :boolean, default: false,
              desc: "Enable or disable directory traveling"
            method_option :download_to, type: :string, default: "/tmp", desc: "Directory to download phishing kits"
            method_option :threads, type: :numeric, desc: "Number of threads to use", default: Parallel.processor_count
            method_option :verbose, type: :boolean, default: true
            desc "execute", "Execute the crawler"
            around :with_db_connection
            def execute
              Miteru.config.tap do |config|
                config.auto_download = options["auto_download"]
                config.directory_traveling = options["directory_traveling"]
                config.download_to = options["download_to"]
                config.threads = options["threads"]
                config.verbose = options["verbose"]
              end

              Orchestrator.call
            end
            default_command :execute
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
miteru-2.4.0 lib/miteru/commands/main.rb
miteru-2.3.2 lib/miteru/commands/main.rb
miteru-2.3.1 lib/miteru/commands/main.rb
miteru-2.3.0 lib/miteru/commands/main.rb
miteru-2.2.4 lib/miteru/commands/main.rb
miteru-2.2.3 lib/miteru/commands/main.rb
miteru-2.2.2 lib/miteru/commands/main.rb
miteru-2.2.1 lib/miteru/commands/main.rb
miteru-2.2.0 lib/miteru/commands/main.rb
miteru-2.1.1 lib/miteru/commands/main.rb
miteru-2.1.0 lib/miteru/commands/main.rb
miteru-2.0.3 lib/miteru/commands/main.rb
miteru-2.0.2 lib/miteru/commands/main.rb
miteru-2.0.1 lib/miteru/commands/main.rb