ruby-ldap / ruby-net-ldap

Pure Ruby LDAP library
https://rubygems.org/gems/net-ldap
Other
399 stars 253 forks source link

remove a circular require #380

Closed jethrodaniel closed 4 years ago

jethrodaniel commented 4 years ago

If applied, this commit removes some circular requires.

Prior to this change, we had the following circular requires

require_relative 'entry' unless defined? Net::LDAP::Entry     # dataset
require_relative 'dataset' unless defined? Net::LDAP::Dataset # entry

This works (both classes need each other in methods), but it's unnecessary, since calling require twice does nothing, since $LOADED_FEATURES has already been updated.

This change moves those requires to the toplevel, and removes the defined? check.


No tests were added, since the existing tests passed without issue.