Class: Testjour::CLI::List

Inherits:
BaseCommand show all
Includes:
Bonjour
Defined in:
lib/testjour/commands/list.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#non_options, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Bonjour

#bonjour_serve, #bonjour_servers, #found_bonjour_server

Methods inherited from BaseCommand

detailed_help, help, inherited, #option_parser, options, #testjour_bin_path

Constructor Details

#initialize(*args) ⇒ List

Returns a new instance of List.



15
16
17
18
19
20
21
# File 'lib/testjour/commands/list.rb', line 15

def initialize(*args)
  super
  Testjour.load_cucumber
  require "testjour/colorer"
rescue LoadError
  # No cucumber, we can't use color :(
end

Class Method Details

.commandObject



11
12
13
# File 'lib/testjour/commands/list.rb', line 11

def self.command
  "list"
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/testjour/commands/list.rb', line 23

def run
  if bonjour_servers.any?
    puts
    puts "Testjour servers:"
    puts
    
    bonjour_servers.each do |server|
      puts server.status_line
    end
  else
    puts
    puts "No testjour servers found."
  end
end