Method: Ima.libdir

Defined in:
lib/ima/_lib.rb

.libdir(*args, &block) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/ima/_lib.rb', line 37

def libdir(*args, &block)
  @libdir ||= File.dirname(File.expand_path(__FILE__))
  args.empty? ? @libdir : File.join(@libdir, *args)
ensure
  if block
    begin
      $LOAD_PATH.unshift(@libdir)
      block.call
    ensure
      $LOAD_PATH.shift
    end
  end
end