-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into scratch-dev-suite
- Loading branch information
Showing
29 changed files
with
362 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require_relative 'serialize' | ||
|
||
module Inferno | ||
module CLI | ||
class Execute | ||
# @private | ||
class JSONOutputter | ||
include Serialize | ||
|
||
def print_start_message(_options); end | ||
|
||
def print_around_run(_options, &) | ||
yield | ||
end | ||
|
||
def print_results(_options, results) | ||
puts serialize(results) | ||
end | ||
|
||
def print_end_message(_options); end | ||
|
||
def print_error(_options, exception) | ||
puts exception.to_json | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require_relative 'console_outputter' | ||
|
||
module Inferno | ||
module CLI | ||
class Execute | ||
# @private | ||
class PlainOutputter < ConsoleOutputter | ||
def print_error(_options, exception) | ||
puts "Error: #{exception.full_message(highlight: false)}" | ||
end | ||
|
||
def color | ||
@color ||= Pastel.new(enabled: false) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Inferno | ||
module CLI | ||
class Execute | ||
# @private | ||
class QuietOutputter | ||
def print_start_message(_options); end | ||
|
||
def print_around_run(_options, &) | ||
yield | ||
end | ||
|
||
def print_results(_options, _results); end | ||
|
||
def print_end_message(_options); end | ||
|
||
def print_error(options, exception) | ||
puts "Error: #{exception.full_message}" if options[:verbose] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'active_support' | ||
require_relative '../../web/serializers/test_run' | ||
require_relative '../../web/serializers/result' | ||
|
||
module Inferno | ||
module CLI | ||
class Execute | ||
# @private | ||
module Serialize | ||
def serialize(entity) | ||
case entity.class.to_s | ||
when 'Array' | ||
JSON.pretty_generate(entity.map { |item| JSON.parse serialize(item) }) | ||
else | ||
Inferno::Web::Serializers.const_get(entity.class.to_s.demodulize).render(entity) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.