Sha256: 2049d9dd1b5dee9e1049687bf3e7b2e7f29893c5b9e99853c397f799abb73a36

Contents?: true

Size: 464 Bytes

Versions: 1

Compression:

Stored size: 464 Bytes

Contents

# frozen_string_literal: true

module FactoryBotRails
  class DefinitionFilePaths
    def initialize(definition_file_paths)
      @files = []
      @directories = {}

      definition_file_paths.each do |path|
        @files << "#{path}.rb"
        @directories[path.to_s] = [:rb]
      end
    end

    def directories
      @directories.select { |path| Dir.exist?(path) }
    end

    def files
      @files.select { |file| File.exist?(file) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
factory_bot_rails-5.0.1 lib/factory_bot_rails/definition_file_paths.rb