Module: MotionBlender::Interpreters::Requirable

Extended by:
ActiveSupport::Concern
Included in:
RequireInterpreter
Defined in:
lib/motion_blender/interpreters/requirable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#find_require(arg) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/motion_blender/interpreters/requirable.rb', line 12

def find_require arg
  return if excluded_arg? arg

  req = Require.new(file, method, arg)
  req.file = resolve_path req.arg
  return if excluded_file? req.file

  req
end

#resolve_path(arg) ⇒ Object

Raises:

  • (LoadError)


22
23
24
25
26
# File 'lib/motion_blender/interpreters/requirable.rb', line 22

def resolve_path arg
  path = candidates(arg).find(&:file?)
  raise LoadError, "not found `#{arg}'" unless path
  explicit_relative path
end