Class: Polytrix::Command::Action

Inherits:
Base
  • Object
show all
Includes:
RunAction
Defined in:
lib/polytrix/command/action.rb

Constant Summary collapse

IMPLEMENTOR_ACTIONS =

These are run once per implementor, not per test

[:clone, :bootstrap]

Instance Method Summary collapse

Methods included from RunAction

#run_action

Methods inherited from Base

#initialize

Methods included from Util::FileSystem

#find_file, #relativize

Methods included from Util::String

included

Methods included from Util::String::ClassMethods

#ansi2html, #escape_html, #highlight, #slugify

Methods included from DefaultLogger

included

Methods included from DefaultLogger::ClassMethods

#logger

Constructor Details

This class inherits a constructor from Polytrix::Command::Base

Instance Method Details

#callObject

Invoke the command.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/polytrix/command/action.rb', line 11

def call
  banner "Starting Polytrix (v#{Polytrix::VERSION})"
  elapsed = Benchmark.measure do
    setup
    tests = parse_subcommand(args.pop)
    implementors = tests.map(&:implementor).uniq
    if IMPLEMENTOR_ACTIONS.include? action # actions on implementors
      run_action(action, implementors)
    else # actions on tests
      run_action(action, tests)
    end
  end
  banner "Polytrix is finished. #{Util.duration(elapsed.real)}"
end