Sha256: 053b326a119286d19a1d0dcec3a04b5493b9091866a66c4900459bd298b80f4f

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 Bytes

Contents

#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
# Copyright Freya Dorn <freya.siv.dorn@gmail.com>, 2013
# License: GNU GPL 3 <http://www.gnu.org/copyleft/gpl.html>

def require_local lib_name, location=caller_locations.first.path
  file	= File.symlink?(location) ? File.readlink(location) : location
  dir 	= File.dirname(file)
  lib 	= File.join(dir, "#{lib_name}.rb")

  raise "couldn't find local module: «#{lib_name}» in «#{dir}»" if not File.exist? lib
  require lib
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
muflax-0.7.0 lib/muflax/library.rb