Sha256: 716cfdca774b00b76fbfffa63ec31b6a87e243fc1935531900826473dd9a7a71

Contents?: true

Size: 321 Bytes

Versions: 2

Compression:

Stored size: 321 Bytes

Contents

# frozen_string_literal: true

module Kernel
  def require_relative_all(paths, sub = nil)
    main_path = File.dirname(caller.first.sub(/:\d+$/, ''))
    main_path = File.join(main_path, sub) if sub

    [*paths].each do |path|
      Dir[File.join(main_path, path, '*.rb')].each { |file| require file }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
locomotivecms_common-0.6.0.alpha1 lib/locomotive/common/core_ext/kernel.rb
locomotivecms_common-0.5.0 lib/locomotive/common/core_ext/kernel.rb