Skip to content

Commit 8ef75a0

Browse files
Merge pull request #360 from HarlemSquirrel/require-relative
Use require_relative instead of require
2 parents 2f3b3c2 + 1a13b87 commit 8ef75a0

14 files changed

+33
-33
lines changed

lib/net-ldap.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# -*- ruby encoding: utf-8 -*-
2-
require 'net/ldap'
2+
require_relative 'net/ldap'

lib/net/ber.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- ruby encoding: utf-8 -*-
2-
require 'net/ldap/version'
2+
require_relative 'ldap/version'
33

44
module Net # :nodoc:
55
##
@@ -349,4 +349,4 @@ def to_ber
349349
Null = Net::BER::BerIdentifiedNull.new
350350
end
351351

352-
require 'net/ber/core_ext'
352+
require_relative 'ber/core_ext'

lib/net/ber/core_ext.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- ruby encoding: utf-8 -*-
2-
require 'net/ber/ber_parser'
2+
require_relative 'ber_parser'
33
# :stopdoc:
44
class IO
55
include Net::BER::BERParser
@@ -19,35 +19,35 @@ class OpenSSL::SSL::SSLSocket
1919
module Net::BER::Extensions # :nodoc:
2020
end
2121

22-
require 'net/ber/core_ext/string'
22+
require_relative 'core_ext/string'
2323
# :stopdoc:
2424
class String
2525
include Net::BER::BERParser
2626
include Net::BER::Extensions::String
2727
end
2828

29-
require 'net/ber/core_ext/array'
29+
require_relative 'core_ext/array'
3030
# :stopdoc:
3131
class Array
3232
include Net::BER::Extensions::Array
3333
end
3434
# :startdoc:
3535

36-
require 'net/ber/core_ext/integer'
36+
require_relative 'core_ext/integer'
3737
# :stopdoc:
3838
class Integer
3939
include Net::BER::Extensions::Integer
4040
end
4141
# :startdoc:
4242

43-
require 'net/ber/core_ext/true_class'
43+
require_relative 'core_ext/true_class'
4444
# :stopdoc:
4545
class TrueClass
4646
include Net::BER::Extensions::TrueClass
4747
end
4848
# :startdoc:
4949

50-
require 'net/ber/core_ext/false_class'
50+
require_relative 'core_ext/false_class'
5151
# :stopdoc:
5252
class FalseClass
5353
include Net::BER::Extensions::FalseClass

lib/net/ldap.rb

+13-13
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ class LDAP
1717
end
1818
require 'socket'
1919

20-
require 'net/ber'
21-
require 'net/ldap/pdu'
22-
require 'net/ldap/filter'
23-
require 'net/ldap/dataset'
24-
require 'net/ldap/password'
25-
require 'net/ldap/entry'
26-
require 'net/ldap/instrumentation'
27-
require 'net/ldap/connection'
28-
require 'net/ldap/version'
29-
require 'net/ldap/error'
30-
require 'net/ldap/auth_adapter'
31-
require 'net/ldap/auth_adapter/simple'
32-
require 'net/ldap/auth_adapter/sasl'
20+
require_relative 'ber'
21+
require_relative 'ldap/pdu'
22+
require_relative 'ldap/filter'
23+
require_relative 'ldap/dataset'
24+
require_relative 'ldap/password'
25+
require_relative 'ldap/entry'
26+
require_relative 'ldap/instrumentation'
27+
require_relative 'ldap/connection'
28+
require_relative 'ldap/version'
29+
require_relative 'ldap/error'
30+
require_relative 'ldap/auth_adapter'
31+
require_relative 'ldap/auth_adapter/simple'
32+
require_relative 'ldap/auth_adapter/sasl'
3333

3434
Net::LDAP::AuthAdapter.register([:simple, :anon, :anonymous], Net::LDAP::AuthAdapter::Simple)
3535
Net::LDAP::AuthAdapter.register(:sasl, Net::LDAP::AuthAdapter::Sasl)

lib/net/ldap/auth_adapter/gss_spnego.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
require 'net/ldap/auth_adapter'
2-
require 'net/ldap/auth_adapter/sasl'
1+
require_relative '../auth_adapter'
2+
require_relative 'sasl'
33

44
module Net
55
class LDAP

lib/net/ldap/auth_adapter/sasl.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'net/ldap/auth_adapter'
1+
require_relative '../auth_adapter'
22

33
module Net
44
class LDAP

lib/net/ldap/auth_adapter/simple.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'net/ldap/auth_adapter'
1+
require_relative '../auth_adapter'
22

33
module Net
44
class LDAP

lib/net/ldap/dataset.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,4 @@ def read_ldif(io)
165165
end
166166
end
167167

168-
require 'net/ldap/entry' unless defined? Net::LDAP::Entry
168+
require_relative 'entry' unless defined? Net::LDAP::Entry

lib/net/ldap/entry.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,4 @@ def setter?(sym)
189189
private :setter?
190190
end # class Entry
191191

192-
require 'net/ldap/dataset' unless defined? Net::LDAP::Dataset
192+
require_relative 'dataset' unless defined? Net::LDAP::Dataset

lib/net/snmp.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- ruby encoding: utf-8 -*-
2-
require 'net/ldap/version'
2+
require_relative 'ldap/version'
33

44
# :stopdoc:
55
module Net

net-ldap.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- encoding: utf-8 -*-
22
lib = File.expand_path('../lib', __FILE__)
33
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4-
require 'net/ldap/version'
4+
require_relative 'lib/net/ldap/version'
55

66
Gem::Specification.new do |s|
77
s.name = %q{net-ldap}

test/test_dn.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require_relative 'test_helper'
2-
require 'net/ldap/dn'
2+
require_relative '../lib/net/ldap/dn'
33

44
class TestDN < Test::Unit::TestCase
55
def test_escape

test/test_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add 'lib' to load path.
22
require 'test/unit'
3-
require 'net/ldap'
3+
require_relative '../lib/net/ldap'
44
require 'flexmock/test_unit'
55

66
# Whether integration tests should be run.

test/test_snmp.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# $Id: testsnmp.rb 231 2006-12-21 15:09:29Z blackhedd $
22

33
require_relative 'test_helper'
4-
require 'net/snmp'
4+
require_relative '../lib/net/snmp'
55

66
class TestSnmp < Test::Unit::TestCase
77
def self.raw_string(s)

0 commit comments

Comments
 (0)