class MotionBlender::Interpreters::OriginalInterpreter

Attributes

original[R]

Public Instance Methods

interpret() click to toggle source
# File lib/motion_blender/interpreters/original_interpreter.rb, line 10
def interpret
  dir = MotionBlender.config.motion_dirs.find { |d| file.start_with? d }
  raise 'not found in motion_dirs' unless dir
  arg = Pathname.new(file).relative_path_from(Pathname.new(dir))
  @original = candidates_for(arg).find(&:file?).try(&:to_s)
end

Private Instance Methods

candidates_for(arg) click to toggle source
# File lib/motion_blender/interpreters/original_interpreter.rb, line 19
def candidates_for arg
  Enumerator.new do |y|
    $LOAD_PATH.each do |dir|
      y << Pathname.new(dir).join(arg)
    end
  end
end