module Kernel
Kernel
extensions
Kernel
extensions - mock up the Modulation
API with nop methods, so requiring a gem would work. Sample usage:
require 'modulation/gem' export_default :MyGem module MyGem MyClass = import('my_class') MyOtherClass = import('my_other_class') end
Constants
- CALLER_RANGE
Public Instance Methods
# File lib/modulation/ext.rb, line 33 def auto_import_map(path, options = {}, caller_location = caller(CALLER_RANGE).first) Modulation.auto_import_map(path, options, caller_location) end
Stub for export method, does nothing in the context of a required gem
# File lib/modulation/gem.rb, line 17 def export(*args); end
Stub for export_default
method, does nothing in the context of a required gem
# File lib/modulation/gem.rb, line 21 def export_default(value); end
Imports a module @param path [String] module file name @param caller_location [String] caller location @return [Module] module object
# File lib/modulation/ext.rb, line 11 def import(path, caller_location = caller(CALLER_RANGE).first) Modulation.import(path, caller_location) end
Imports all modules in given directory @param path [String] directory path @param caller_location [String] caller location @return [Array] array of module objects
# File lib/modulation/ext.rb, line 19 def import_all(path, caller_location = caller(CALLER_RANGE).first) Modulation.import_all(path, caller_location) end
Imports all modules in given directory, returning a hash mapping filenames to modules @param path [String] directory path @param caller_location [String] caller location @return [Hash] hash mapping filenames to module objects
# File lib/modulation/ext.rb, line 28 def import_map(path, options = {}, caller_location = caller(CALLER_RANGE).first) Modulation.import_map(path, options, caller_location) end