Class: Polytrix::CLI

Inherits:
Thor
  • Object
show all
Includes:
PerformCommand, Logging
Defined in:
lib/polytrix/cli.rb

Overview

rubocop:disable ClassLength

Defined Under Namespace

Modules: PerformCommand

Constant Summary collapse

MAX_CONCURRENCY =

The maximum number of concurrent instances that can run–which is a bit high

9999

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PerformCommand

#perform

Constructor Details

#initialize(*args) ⇒ CLI

Constructs a new instance.



44
45
46
47
48
# File 'lib/polytrix/cli.rb', line 44

def initialize(*args)
  super
  Polytrix.logger = Polytrix.default_file_logger
  $stdout.sync = true
end

Class Method Details

.filter_optionsObject



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/polytrix/cli.rb', line 50

def self.filter_options
  method_option :failed,
                type: :boolean,
                desc: 'Only list tests that failed / passed'
  method_option :skipped,
                type: :boolean,
                desc: 'Only list tests that were skipped / executed'
  method_option :samples,
                type: :boolean,
                desc: 'Only list tests that have sample code / do not have sample code'
end

Instance Method Details

#list(*args) ⇒ Object



87
88
89
90
# File 'lib/polytrix/cli.rb', line 87

def list(*args)
  update_config!
  perform('list', 'list', args, options)
end

#show(*args) ⇒ Object



114
115
116
117
# File 'lib/polytrix/cli.rb', line 114

def show(*args)
  update_config!
  perform('show', 'show', args, options)
end

#test(*args) ⇒ Object



203
204
205
206
207
# File 'lib/polytrix/cli.rb', line 203

def test(*args)
  update_config!
  action_options = options.dup
  perform('test', 'test', args, action_options)
end

#versionObject



210
211
212
# File 'lib/polytrix/cli.rb', line 210

def version
  puts "Polytrix version #{Polytrix::VERSION}"
end