Sha256: a829853b65264f75cd1c27f36ea8c5524a46d4562dfefd42f3ffc8def32d1536

Contents?: true

Size: 362 Bytes

Versions: 34

Compression:

Stored size: 362 Bytes

Contents

# frozen_string_literal: true

module DeepCover
  module Tools::RequireRelativeDir
    def require_relative_dir(dir_name, except: [])
      dir = File.dirname(caller(1..1).first.partition(/\.rb:\d/).first)
      Dir["#{dir}/#{dir_name}/*.rb"].sort.each do |file|
        require file unless except.include? File.basename(file, '.rb')
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
deep-cover-core-1.1.0 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-1.0.0 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.8.1 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.8.0 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.10 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.9 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.8 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.7 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.6 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.5 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.4 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.3 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.2 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.1 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.7.0 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.6.4 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.6.3 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-core-0.6.3.pre lib/deep_cover/tools/require_relative_dir.rb
deep-cover-0.6.2 lib/deep_cover/tools/require_relative_dir.rb
deep-cover-0.6.1 lib/deep_cover/tools/require_relative_dir.rb