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.
100
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.
235 236 237 238 |
# File 'lib/mutant/cli/command/session.rb', line 235 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.
240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/mutant/cli/command/session.rb', line 240 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 |