Class: MotionBlender::Interpreters::RequireRelativeInterpreter

Inherits:
RequireInterpreter show all
Defined in:
lib/motion_blender/interpreters/require_relative_interpreter.rb

Instance Attribute Summary

Attributes inherited from Base

#collector, #object

Instance Method Summary collapse

Methods inherited from RequireInterpreter

#interpret

Methods included from Requirable

#find_require, #resolve_path

Methods inherited from Base

#initialize, interprets, key, requirable?

Constructor Details

This class inherits a constructor from MotionBlender::Interpreters::Base

Instance Method Details

#candidates(arg) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/motion_blender/interpreters/require_relative_interpreter.rb', line 8

def candidates arg
  path = Pathname.new(file).dirname.join(arg)
  exts = path.extname.empty? ? ['', '.rb'] : ['']
  Enumerator.new do |y|
    exts.each do |ext|
      y << Pathname.new("#{path}#{ext}")
    end
  end
end