Class: Im::GemLoader

Inherits:
Loader
  • Object
show all
Defined in:
lib/im/gem_loader.rb

Constant Summary

Constants inherited from Loader

Loader::UNBOUND_METHOD_MODULE_TO_S, Loader::UNBOUND_METHOD_REMOVE_CONST

Instance Attribute Summary

Attributes inherited from Loader

#autoloaded_dirs, #autoloads, #module_cpaths, #module_prefix, #mutex, #mutex2, #namespace_dirs, #shadowed_files, #to_unload

Attributes included from Loader::Config

#inflector, #logger, #root_dirs

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Loader

all_dirs, eager_load_all, eager_load_namespace, for_gem, #inspect, #pretty_print, #reload, #shadowed_file?, #unload, #unloadable_cpath?, #unloadable_cpaths, #unregister

Methods included from Loader::EagerLoad

#eager_load, #eager_load_dir, #eager_load_namespace, #load_file

Methods included from Loader::Config

#collapse, #dirs, #do_not_eager_load, #enable_reloading, #ignore, #log!, #on_load, #on_setup, #on_unload, #push_dir, #reloading_enabled?, #tag, #tag=

Methods included from Internal

#internal

Methods included from Loader::Callbacks

#on_dir_autoloaded, #on_file_autoloaded, #on_namespace_loaded

Constructor Details

#initialize(root_file, warn_on_extra_files:) ⇒ GemLoader

Returns a new instance of GemLoader.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/im/gem_loader.rb', line 17

def initialize(root_file, warn_on_extra_files:)
  super()

  @tag                 = File.basename(root_file, ".rb")
  @inflector           = GemInflector.new(root_file)
  @root_file           = File.expand_path(root_file)
  @lib                 = File.dirname(root_file)
  @warn_on_extra_files = warn_on_extra_files

  push_dir(@lib)
end

Class Method Details

._new(root_file, warn_on_extra_files:) ⇒ Object



12
13
14
# File 'lib/im/gem_loader.rb', line 12

def self._new(root_file, warn_on_extra_files:)
  new(root_file, warn_on_extra_files: warn_on_extra_files)
end

Instance Method Details

#setupObject



30
31
32
33
# File 'lib/im/gem_loader.rb', line 30

def setup
  warn_on_extra_files if @warn_on_extra_files
  super
end