Class: Licensed::Commands::Cache
- Defined in:
- lib/licensed/commands/cache.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
-
#default_reporter(options) ⇒ Object
Returns the default reporter to use during the command run.
-
#run(**options) ⇒ Object
Run the command.
Methods inherited from Command
Constructor Details
This class inherits a constructor from Licensed::Commands::Command
Instance Method Details
#default_reporter(options) ⇒ Object
Returns the default reporter to use during the command run
options - The options the command was run with
Returns a Licensed::Reporters::CacheReporter
10 11 12 |
# File 'lib/licensed/commands/cache.rb', line 10 def default_reporter() Licensed::Reporters::CacheReporter.new end |
#run(**options) ⇒ Object
Run the command. Removes any cached records that don’t match a current application dependency.
options - Options to run the command with
Returns whether the command was a success
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/licensed/commands/cache.rb', line 21 def run(**) begin result = super clear_stale_cached_records if result result ensure cache_paths.clear files.clear end end |