Class: Support::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/support/loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ Loader

Returns a new instance of Loader.



5
6
7
8
9
# File 'lib/support/loader.rb', line 5

def initialize(pattern)
  @pattern = pattern
  @files = []
  @names = []
end

Instance Method Details

#findObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/support/loader.rb', line 15

def find
  scan!

  if reload?
    unload!
    load!
  end

  modules
end

#reload?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/support/loader.rb', line 11

def reload?
  !last_scanned || !last_loaded || last_loaded < last_modified
end