class MotionBlender::Interpreters::RequireInterpreter

Public Instance Methods

candidates(arg) click to toggle source
# File lib/motion_blender/interpreters/require_interpreter.rb, line 18
def candidates arg
  path = Pathname.new(arg)
  dirs = path.relative? && load_path || ['']
  exts = path.extname.empty? ? ['', '.rb'] : ['']
  Enumerator.new do |y|
    dirs.product(exts).each do |dir, ext|
      y << Pathname.new(dir).join("#{path}#{ext}")
    end
  end
end
interpret(arg) click to toggle source
# File lib/motion_blender/interpreters/require_interpreter.rb, line 10
def interpret arg
  req = find_require(arg)
  if req
    requires << req
    req
  end
end

Private Instance Methods

load_path() click to toggle source
# File lib/motion_blender/interpreters/require_interpreter.rb, line 31
def load_path
  MotionBlender.config.motion_dirs + $LOAD_PATH
end