Module: Cardio::Utils
- Included in:
- Cardio
- Defined in:
- lib/cardio/utils.rb
Overview
Utilities that may need to be run even when mods are not loaded.
Instance Method Summary collapse
-
#delete_tmp_files!(id = nil) ⇒ Object
deletes tmp directory within files directory It’s here because it gets called as part of cache clearing, which sometimes gets called in a context where card mods are not loaded.
- #seed_test_db ⇒ Object
- #tr(key, args = {}) ⇒ Object
Instance Method Details
#delete_tmp_files!(id = nil) ⇒ Object
deletes tmp directory within files directory It’s here because it gets called as part of cache clearing, which sometimes gets called in a context where card mods are not loaded. Why does cache clearing need to do this??
18 19 20 21 22 23 |
# File 'lib/cardio/utils.rb', line 18 def delete_tmp_files! id=nil raise "no files directory" unless files_dir delete_tmp_files id rescue StandardError Rails.logger.info "failed to remove tmp files" end |
#seed_test_db ⇒ Object
10 11 12 |
# File 'lib/cardio/utils.rb', line 10 def seed_test_db system "env RAILS_ENV=test bundle exec rake db:fixtures:load" end |