Module: Reloadable::ClassMethods
- Defined in:
- lib/butterfly/reloadable.rb
Overview
Force reload of this file
Instance Method Summary collapse
Instance Method Details
#reload_files! ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/butterfly/reloadable.rb', line 4 def reload_files! @reloading = true reloadable_files.each do |f| $LOADED_FEATURES.delete(f) ::Kernel.load f end @reloading = false end |
#reloadable_files ⇒ Object
21 22 23 |
# File 'lib/butterfly/reloadable.rb', line 21 def reloadable_files @reloadable_files ||= [] end |
#require_reloadable_files(*files) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/butterfly/reloadable.rb', line 13 def require_reloadable_files *files files.each do |a| fpath = File.(a.index(".rb") ? a : "#{a}.rb") reloadable_files << fpath require fpath end end |