Class: Navo::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/navo/cli.rb

Overview

Command line application interface.

Instance Method Summary collapse

Instance Method Details

#converge(pattern = nil) ⇒ Object



14
15
16
# File 'lib/navo/cli.rb', line 14

def converge(pattern = nil)
  exit suites_for(pattern).map(&:converge).all? ? 0 : 1
end

#create(pattern = nil) ⇒ Object



9
10
11
# File 'lib/navo/cli.rb', line 9

def create(pattern = nil)
  exit suites_for(pattern).map(&:create).all? ? 0 : 1
end

#destroy(pattern = nil) ⇒ Object



29
30
31
# File 'lib/navo/cli.rb', line 29

def destroy(pattern = nil)
  exit suites_for(pattern).map(&:destroy).all? ? 0 : 1
end

#login(pattern) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/navo/cli.rb', line 34

def (pattern)
  suites = suites_for(pattern)
  if suites.size > 1
    puts 'Pattern matched more than one test suite'
    exit 1
  else
    suites.first.
  end
end

#test(pattern = nil) ⇒ Object



24
25
26
# File 'lib/navo/cli.rb', line 24

def test(pattern = nil)
  exit suites_for(pattern).map(&:test).all? ? 0 : 1
end

#verify(pattern = nil) ⇒ Object



19
20
21
# File 'lib/navo/cli.rb', line 19

def verify(pattern = nil)
  exit suites_for(pattern).map(&:verify).all? ? 0 : 1
end