Class: TypeSpecFromSerializers::Runner
- Inherits:
-
Object
- Object
- TypeSpecFromSerializers::Runner
- Defined in:
- lib/typespec_from_serializers/runner.rb
Overview
Public: Executes TypeSpec commands, providing conveniences for debugging.
Defined Under Namespace
Classes: MissingExecutableError
Instance Method Summary collapse
-
#initialize(config) ⇒ Runner
constructor
A new instance of Runner.
-
#run(argv, chdir: nil, with_output: nil) ⇒ Object
Public: Executes TypeSpec with the specified arguments.
Constructor Details
#initialize(config) ⇒ Runner
9 10 11 |
# File 'lib/typespec_from_serializers/runner.rb', line 9 def initialize(config) @config = config end |
Instance Method Details
#run(argv, chdir: nil, with_output: nil) ⇒ Object
Public: Executes TypeSpec with the specified arguments.
14 15 16 17 18 19 20 21 22 |
# File 'lib/typespec_from_serializers/runner.rb', line 14 def run(argv, chdir: nil, with_output: nil) cmd = command_for(argv) opts = {} opts[:chdir] = chdir if chdir TypeSpecFromSerializers::IO.capture(*cmd, with_output: with_output, **opts) rescue Errno::ENOENT => error raise MissingExecutableError, "TypeSpec executable not found: #{error.message}" end |