RobertDober/lab42_core

View on GitHub
lib/lab42/core/kernel.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Kernel
  def require_relative_dir &blk
    raise ArgumentError, 'need a block to determine source location' unless blk
    dir = File.expand_path File.join( '..', blk.(), '*.rb'), blk.source_location.first
    Dir.glob( dir ).each do | file |
      require file
    end
  end
end
include Kernel
# SPDX-License-Identifier: Apache-2.0