Class: Mutant::CLI::Command::Session::GC Private
- Inherits:
-
Mutant::CLI::Command::Session
- Object
- Mutant::CLI::Command
- Mutant::CLI::Command::Session
- Mutant::CLI::Command::Session::GC
- Defined in:
- lib/mutant/cli/command/session.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Subject
Constant Summary collapse
- NAME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'gc'- SHORT_DESCRIPTION =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'Remove incompatible and old session results'- SUBCOMMANDS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[].freeze
- OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%i[add_gc_options].freeze
- DEFAULT_KEEP =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Result::SessionFiles::KEEP
Constants inherited from Mutant::CLI::Command::Session
Instance Method Summary collapse
- #action ⇒ Object private
-
#initialize ⇒ GC
constructor
private
A new instance of GC.
Methods inherited from Mutant::CLI::Command
#call, command_name, #full_name, parse, short_description
Constructor Details
#initialize ⇒ GC
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.
Returns a new instance of GC.
243 244 245 246 |
# File 'lib/mutant/cli/command/session.rb', line 243 def initialize(*) super @keep = DEFAULT_KEEP end |
Instance Method Details
#action ⇒ Object
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.
248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/mutant/cli/command/session.rb', line 248 def action incompatible, compatible = partition_sessions incompatible.each(&:delete) excess = compatible.length > @keep ? compatible.first(compatible.length - @keep) : [] excess.each(&:delete) print("Removed #{incompatible.length + excess.length} session(s)") Either::Right.new(nil) end |