Module: RequireRelative

### Home Classes Methods

### In Files

- lib/version.rb
- lib/require_relative.rb

### Methods

- ::abs_file

### Class/Module Index

Quicksearch

- Kernel
- Object
- RequireRelative

No matching classes.

# RequireRelative

### Constants

VERSION

### Public Class Methods

abs_file() click to toggle source

    # File lib/require_relative.rb, line 8
    def abs_file
      if defined?(RubyVM::ThreadFrame)
        RubyVM::ThreadFrame.current.prev.source_container[1]
      elsif defined?(Rubinius) && "1.8.7" == RUBY_VERSION
        scope = Rubinius::StaticScope.of_sender
        script = scope.current_script
        if script
          script.data_path
        else
          nil
        end
      else
        file = caller.first.split(/:\d/,2).first
        if /\A\((.*)\)/ =~ file # eval, etc.
          nil
        end
        File.expand_path(file)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.