def _find_file!(name, reference_path)
      sub_path = File.expand_path(name, File.dirname(reference_path))

      if File.exist?(sub_path)
        return if sub_path.end_with?('.rb') # handled in Generator
        sub_path
      else
        bade_path = "#{sub_path}.bade"
        rb_path = "#{sub_path}.rb"

        bade_exist = File.exist?(bade_path)
        rb_exist = File.exist?(rb_path)
        relative = Pathname.new(reference_path).relative_path_from(Pathname.new(File.dirname(file_path))).to_s

        if bade_exist && rb_exist
          message = "Found both .bade and .rb files for `#{name}` in file #{relative}, "\
                    'change the import path so it references uniq file.'
          raise LoadError.new(name, reference_path, message)
        elsif bade_exist
          return bade_path
        elsif rb_exist
          return # handled in Generator
        else
          message = "Can't find file matching name `#{name}` referenced from file #{relative}"
          raise LoadError.new(name, reference_path, message)
        end
      end
    end
def _find_file!(name, reference_path)
      sub_path = File.expand_path(name, File.dirname(reference_path))

      if File.exist?(sub_path)
        return if sub_path.end_with?('.rb') # handled in Generator
        sub_path
      else
        bade_path = "#{sub_path}.bade"
        rb_path = "#{sub_path}.rb"

        bade_exist = File.exist?(bade_path)
        rb_exist = File.exist?(rb_path)
        relative = Pathname.new(reference_path).relative_path_from(Pathname.new(File.dirname(file_path))).to_s

        if bade_exist && rb_exist
          message = "Found both .bade and .rb files for `#{name}` in file #{relative}, "\
                    'change the import path so it references uniq file.'
          raise LoadError.new(name, reference_path, message)
        elsif bade_exist
          return bade_path
        elsif rb_exist
          return # handled in Generator
        else
          message = "Can't find file matching name `#{name}` referenced from file #{relative}"
          raise LoadError.new(name, reference_path, message)
        end
      end
    end
Tries to find file with name, if no file could be found or there are multiple files matching the name error is
 raised

 @param [String] name  name of the file that should be found
 @param [String] reference_path  path to file from which is loading/finding

 @return [String, nil] returns nil when this file should be skipped otherwise absolute path to file