Class: Polytrix::Command::Show
- Includes:
- Reporters, Util::FileSystem, Util::String
- Defined in:
- lib/polytrix/command/show.rb
Constant Summary
Constants included from Reporters
Reporters::ASSETS_DIR, Reporters::GENERATORS_DIR, Reporters::RESOURCES_DIR
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(cmd_args, cmd_options, options = {}) ⇒ Show
constructor
A new instance of Show.
Methods included from Util::FileSystem
Methods included from Util::String
Methods included from Util::String::ClassMethods
#ansi2html, #escape_html, #highlight, #slugify
Methods included from Reporters
Methods included from DefaultLogger
Methods included from DefaultLogger::ClassMethods
Constructor Details
#initialize(cmd_args, cmd_options, options = {}) ⇒ Show
Returns a new instance of Show.
10 11 12 13 |
# File 'lib/polytrix/command/show.rb', line 10 def initialize(cmd_args, , = {}) @indent_level = 0 super end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/polytrix/command/show.rb', line 15 def call setup @reporter = Polytrix::Reporters.reporter([:format], shell) challenges = parse_subcommand(args.pop) challenges.each do | challenge | status_color = challenge.status_color.to_sym status(challenge.slug, colorize(challenge.status_description, status_color), status_color) indent do status('Test suite', challenge.suite) status('Test scenario', challenge.name) status('Implementor', challenge.implementor.name) source_file = challenge.absolute_source_file ? relativize(challenge.absolute_source_file, Dir.pwd) : colorize('<No code sample>', :red) status('Source', source_file) display_source(challenge) display_execution_result(challenge) display_validations(challenge) display_spy_data(challenge) end end end |