Class: ConsoleUtils::JSONOutput::JqFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- ConsoleUtils::JSONOutput::JqFormatter
- Defined in:
- lib/console_utils/json_output/jq_formatter.rb
Overview
The jq formatter uses the external jq utility.
Instance Method Summary collapse
-
#format(body) ⇒ Object
:nodoc:.
Methods inherited from BaseFormatter
Instance Method Details
#format(body) ⇒ Object
:nodoc:
9 10 11 12 13 14 15 |
# File 'lib/console_utils/json_output/jq_formatter.rb', line 9 def format(body) #:nodoc: output, err, s = Open3.capture3(jq_command, stdin_data: body) raise ParseError, err.squish unless s.success? output end |