Class: Mutant::CLI
- Inherits:
-
Object
- Object
- Mutant::CLI
- Includes:
- Adamantium::Flat, NodeHelpers
- Defined in:
- lib/mutant/cli.rb
Overview
Comandline parser
Defined Under Namespace
Classes: Builder
Constant Summary collapse
- Error =
Error raised when CLI argv is invalid
Class.new(RuntimeError)
- EXIT_FAILURE =
1
- EXIT_SUCCESS =
0
Constants included from NodeHelpers
NodeHelpers::INFINITY, NodeHelpers::NAN, NodeHelpers::NEGATIVE_INFINITY, NodeHelpers::N_EMPTY, NodeHelpers::N_FALSE, NodeHelpers::N_NIL, NodeHelpers::N_SELF, NodeHelpers::N_TRUE, NodeHelpers::RAISE
Class Method Summary collapse
-
.run(arguments) ⇒ Fixnum
private
Run cli with arguments.
Instance Method Summary collapse
-
#config ⇒ Config
private
Return config.
-
#initialize(arguments = []) ⇒ undefined
constructor
private
Initialize objecct.
Methods included from NodeHelpers
Constructor Details
#initialize(arguments = []) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize objecct
178 179 180 181 182 183 184 185 186 |
# File 'lib/mutant/cli.rb', line 178 def initialize(arguments = []) @builder = Builder.new @debug = @fail_fast = @zombie = false @expected_coverage = 100.0 @strategy = Strategy::Null.new @cache = Mutant::Cache.new parse(arguments) config # trigger lazyness now end |
Class Method Details
.run(arguments) ⇒ Fixnum
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Run cli with arguments
26 27 28 29 30 31 32 33 |
# File 'lib/mutant/cli.rb', line 26 def self.run(arguments) config = new(arguments).config runner = Runner::Config.run(config) runner.success? ? EXIT_SUCCESS : EXIT_FAILURE rescue Error => exception $stderr.puts(exception.) EXIT_FAILURE end |
Instance Method Details
#config ⇒ Config
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return config
194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/mutant/cli.rb', line 194 def config Config.new( cache: @cache, zombie: @zombie, debug: @debug, matcher: @builder.matcher, strategy: @strategy, fail_fast: @fail_fast, reporter: Reporter::CLI.new($stdout), expected_coverage: @expected_coverage ) end |