Module: Reloadable::ClassMethods

Defined in:
lib/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/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_filesObject



21
22
23
# File 'lib/reloadable.rb', line 21

def reloadable_files
  @reloadable_files ||= []
end

#require_reloadable_files(*files) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/reloadable.rb', line 13

def require_reloadable_files *files
  files.each do |a| 
    fpath = File.expand_path(a.index(".rb") ? a : "#{a}.rb")
    reloadable_files << fpath 
    require fpath
  end
end