Class: RailsConsolePro::Commands::JobsCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- RailsConsolePro::Commands::JobsCommand
- Defined in:
- lib/rails_console_pro/commands/jobs_command.rb
Constant Summary collapse
- DEFAULT_LIMIT =
20
Instance Method Summary collapse
Methods included from RailsConsolePro::ColorHelper
#bold_color, #color, #method_missing, #pastel, #respond_to_missing?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RailsConsolePro::ColorHelper
Instance Method Details
#execute(options = nil) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rails_console_pro/commands/jobs_command.rb', line 8 def execute( = nil) unless feature_enabled? puts pastel.yellow("Jobs command is disabled. Enable it with: RailsConsolePro.configure { |c| c.queue_command_enabled = true }") return nil end unless active_job_available? puts pastel.red("ActiveJob is not loaded. Queue insights require ActiveJob to be available.") return nil end = () , , = () action_results = perform_actions(, ) action_results.each { |result| print_action_result(result) } result = fetcher.fetch(**) return result unless result apply_filters(result, ) rescue => e RailsConsolePro::ErrorHandler.handle(e, context: :jobs) end |