Class: Dri::Commands::Add

Inherits:
Thor
  • Object
show all
Defined in:
lib/dri/commands/add.rb,
lib/dri/commands/add/fast_quarantine.rb

Defined Under Namespace

Classes: FastQuarantine

Instance Method Summary collapse

Instance Method Details

#fastquarantineObject

rubocop:enable Layout/LineLength



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/dri/commands/add.rb', line 27

def fastquarantine(*)
  if options[:help]
    invoke :help, ['fastquarantine']
    return
  end

  if options[:failure_url].nil? && options[:test_id].nil?
    say 'Validation error: either failure_url or test_id is required.', :red
    return
  elsif options[:failure_url] && options[:test_id]
    say 'Validation error: only one of failure_url or test_id should be provided, not both.', :red
    return
  end

  require_relative 'add/fast_quarantine'
  Dri::Commands::Add::FastQuarantine.new(options).execute
end