namespace :monitor do desc "executes the monitoring logic" task :run => :environment do puts "About to check #{ENV["EMAIL"]} inbox..." res = MonitorInbox.call! puts "A total of #{res.analyzed_emails_count} new emails were analyzed" puts "A total of #{res.actions_executed_count} actions were triggered" end end