Class: Rails::Command::Karst::VerifyCommand

Inherits:
Base
  • Object
show all
Includes:
Boot
Defined in:
lib/rails/commands/karst/verify/verify_command.rb

Overview

Rails command entry point for the shared Access::Search adapter.

Instance Method Summary collapse

Instance Method Details

#perform(*arguments) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/rails/commands/karst/verify/verify_command.rb', line 17

def perform(*arguments)
  method, path = parse(arguments)
  boot_karst_application!
  exit(::Karst::CLI::Verification.new(path: path, http_method: method, json: options[:json]).call)
rescue ArgumentError => e
  document = { schema_version: 1, error: { type: "input_error", message: e.message } }
  puts(options[:json] ? JSON.generate(document) : "Karst cannot verify this route:\n#{e.message}")
  exit(2)
end