Class: RailsPulse::Tasks::CleanupTaskRunner
- Inherits:
-
Object
- Object
- RailsPulse::Tasks::CleanupTaskRunner
- Defined in:
- lib/rails_pulse/tasks/cleanup_task_runner.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(output: $stdout) ⇒ CleanupTaskRunner
constructor
A new instance of CleanupTaskRunner.
- #run ⇒ Object
Constructor Details
#initialize(output: $stdout) ⇒ CleanupTaskRunner
Returns a new instance of CleanupTaskRunner.
10 11 12 13 |
# File 'lib/rails_pulse/tasks/cleanup_task_runner.rb', line 10 def initialize(output: $stdout) @output = output @config = RailsPulse.configuration end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/rails_pulse/tasks/cleanup_task_runner.rb', line 4 def config @config end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/rails_pulse/tasks/cleanup_task_runner.rb', line 4 def output @output end |
Class Method Details
.run(output: $stdout) ⇒ Object
6 7 8 |
# File 'lib/rails_pulse/tasks/cleanup_task_runner.rb', line 6 def self.run(output: $stdout) new(output: output).run end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rails_pulse/tasks/cleanup_task_runner.rb', line 15 def run output.puts "Starting Rails Pulse data cleanup..." unless config.archiving_enabled output.puts "Cleanup is disabled (archiving_enabled = false). Exiting." return false end stats = perform_cleanup print_results(stats) true rescue => e handle_error(e) false end |