Module: MotionBundler::Require::Resolve

Included in:
MotionBundler::Require
Defined in:
lib/motion-bundler/require/resolve.rb

Defined Under Namespace

Classes: GemPath

Instance Method Summary collapse

Instance Method Details

#resolve(path) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/motion-bundler/require/resolve.rb', line 5

def resolve(path)
  base_path = path.gsub(/\.rb$/, "")

  load_paths.each do |load_path|
    if (file = Dir["#{load_path}/#{base_path}.rb"].first)
      return file
    end
  end

  path
end