Sha256: 9f8ae331a2b5652d1532d1e6dbdba1fb3a517263cba6fa8b043890e1e4bcc9be

Contents?: true

Size: 316 Bytes

Versions: 1

Compression:

Stored size: 316 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.first.split(':').first
    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.1 lib/multi_require.rb