Sha256: d48c1699b1c1731275ef5f46690ccf769add129e4e47e791b7eb99f0afe65334

Contents?: true

Size: 320 Bytes

Versions: 1

Compression:

Stored size: 320 Bytes

Contents

module MultiRequire

  extend self

  def require_pattern(pattern)
    Dir[pattern].sort.each { |f| require f if File.file? f }
    true
  end

  def require_relative_pattern(pattern)
    source_path = File.dirname caller_locations[0].absolute_path
    require_pattern File.join(source_path, pattern)
    true
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
multi_require-1.0.0 lib/multi_require.rb