Module: Puppet_X::Coi

Defined in:
lib/puppet_x/coi/jboss.rb

Overview

A COI puppet_x module

Defined Under Namespace

Modules: Jboss

Class Method Summary collapse

Class Method Details

.require_relative(relative_path, lvl = 0) ⇒ Object

Require relative kernel-like method



6
7
8
9
10
11
12
13
# File 'lib/puppet_x/coi/jboss.rb', line 6

def self.require_relative(relative_path, lvl = 0)
  stack = Kernel.caller
  file = stack[lvl].split(/:\d/,2).first
  file = './' if ['(eval)', '(pry)', ''].include?(file)
  file = File.dirname(file)
  path = File.expand_path(File.join(file, relative_path))
  Kernel.require(path)
end