Skip to content

Commit f4c1b94

Browse files
committed
fix trailing whitespaces
1 parent 88f6066 commit f4c1b94

File tree

12 files changed

+60
-60
lines changed

12 files changed

+60
-60
lines changed

lib/net/ber/core_ext.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,35 @@ class String
2828

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

3636
require 'net/ber/core_ext/bignum'
3737
# :stopdoc:
38-
class Bignum
38+
class Bignum
3939
include Net::BER::Extensions::Bignum
4040
end
4141
# :startdoc:
4242

4343
require 'net/ber/core_ext/fixnum'
4444
# :stopdoc:
45-
class Fixnum
45+
class Fixnum
4646
include Net::BER::Extensions::Fixnum
4747
end
4848
# :startdoc:
4949

5050
require 'net/ber/core_ext/true_class'
5151
# :stopdoc:
52-
class TrueClass
52+
class TrueClass
5353
include Net::BER::Extensions::TrueClass
5454
end
5555
# :startdoc:
5656

5757
require 'net/ber/core_ext/false_class'
5858
# :stopdoc:
59-
class FalseClass
59+
class FalseClass
6060
include Net::BER::Extensions::FalseClass
6161
end
6262
# :startdoc:

lib/net/ldap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def authenticate(username, password)
486486
# standard port for simple-TLS encrypted connections is 636. Be sure you
487487
# are using the correct port.
488488
#
489-
# The :start_tls like the :simple_tls encryption method also encrypts all
489+
# The :start_tls like the :simple_tls encryption method also encrypts all
490490
# communcations with the LDAP server. With the exception that it operates
491491
# over the standard TCP port.
492492
def encryption(args)

lib/net/ldap/entry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def [](name)
115115

116116
##
117117
# Read the first value for the provided attribute. The attribute name
118-
# is canonicalized prior to reading. Returns nil if the attribute does
118+
# is canonicalized prior to reading. Returns nil if the attribute does
119119
# not exist.
120120
def first(name)
121121
self[name].first

lib/net/ldap/filter.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def present?(attribute)
242242

243243
# http://tools.ietf.org/html/rfc4515 lists these exceptions from UTF1
244244
# charset for filters. All of the following must be escaped in any normal
245-
# string using a single backslash ('\') as escape.
245+
# string using a single backslash ('\') as escape.
246246
#
247247
ESCAPES = {
248248
"\0" => '00', # NUL = %x00 ; null character
@@ -251,10 +251,10 @@ def present?(attribute)
251251
')' => '29', # RPARENS = %x29 ; right parenthesis (")")
252252
'\\' => '5C', # ESC = %x5C ; esc (or backslash) ("\")
253253
}
254-
# Compiled character class regexp using the keys from the above hash.
254+
# Compiled character class regexp using the keys from the above hash.
255255
ESCAPE_RE = Regexp.new(
256-
"[" +
257-
ESCAPES.keys.map { |e| Regexp.escape(e) }.join +
256+
"[" +
257+
ESCAPES.keys.map { |e| Regexp.escape(e) }.join +
258258
"]")
259259

260260
##
@@ -310,8 +310,8 @@ def parse_ber(ber)
310310
present?(ber.to_s)
311311
when 0xa9 # context-specific constructed 9, "extensible comparison"
312312
raise Net::LDAP::LdapError, "Invalid extensible search filter, should be at least two elements" if ber.size<2
313-
314-
# Reassembles the extensible filter parts
313+
314+
# Reassembles the extensible filter parts
315315
# (["sn", "2.4.6.8.10", "Barbara Jones", '1'])
316316
type = value = dn = rule = nil
317317
ber.each do |element|
@@ -327,7 +327,7 @@ def parse_ber(ber)
327327
attribute << type if type
328328
attribute << ":#{dn}" if dn
329329
attribute << ":#{rule}" if rule
330-
330+
331331
ex(attribute, value)
332332
else
333333
raise Net::LDAP::LdapError, "Invalid BER tag-value (#{ber.ber_identifier}) in search filter."

spec/integration/ssl_ber_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require 'timeout'
55

66
describe "BER serialisation (SSL)" do
7-
# Transmits str to #to and reads it back from #from.
7+
# Transmits str to #to and reads it back from #from.
88
#
99
def transmit(str)
1010
Timeout::timeout(1) do
@@ -14,26 +14,26 @@ def transmit(str)
1414
from.read
1515
end
1616
end
17-
17+
1818
attr_reader :to, :from
1919
before(:each) do
2020
@from, @to = IO.pipe
21-
21+
2222
# The production code operates on sockets, which do need #connect called
23-
# on them to work. Pipes are more robust for this test, so we'll skip
24-
# the #connect call since it fails.
23+
# on them to work. Pipes are more robust for this test, so we'll skip
24+
# the #connect call since it fails.
2525
flexmock(OpenSSL::SSL::SSLSocket).
2626
new_instances.should_receive(:connect => nil)
27-
27+
2828
@to = Net::LDAP::Connection.wrap_with_ssl(to)
2929
@from = Net::LDAP::Connection.wrap_with_ssl(from)
3030
end
31-
31+
3232
it "should transmit strings" do
3333
transmit('foo').should == 'foo'
34-
end
34+
end
3535
it "should correctly transmit numbers" do
3636
to.write 1234.to_ber
3737
from.read_ber.should == 1234
38-
end
38+
end
3939
end

spec/unit/ber/ber_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
describe "BER encoding of" do
77

8-
RSpec::Matchers.define :properly_encode_and_decode do
8+
RSpec::Matchers.define :properly_encode_and_decode do
99
match do |given|
1010
given.to_ber.read_ber.should == given
1111
end
@@ -64,13 +64,13 @@
6464
n = 2 << p
6565
n.should properly_encode_and_decode
6666
end
67-
end
67+
end
6868
it "should correctly handle powers of ten" do
6969
100.times do |p|
7070
n = 5 * 10**p
7171
n.should properly_encode_and_decode
7272
end
73-
end
73+
end
7474
end
7575
end
7676
if "Ruby 1.9".respond_to?(:encoding)
@@ -106,7 +106,7 @@
106106
"0$\002\001\001`\037\002\001\003\004\rAdministrator\200\vad_is_bogus".
107107
read_ber(Net::LDAP::AsnSyntax).should ==
108108
[1, [3, "Administrator", "ad_is_bogus"]]
109-
end
109+
end
110110
end
111111
end
112112

spec/unit/ber/core_ext/string_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
@str = raw_string("0$\002\001\001`\037\002\001\003\004\rAdministrator\200\vad_is_bogus UNCONSUMED")
1010
@result = str.read_ber!(Net::LDAP::AsnSyntax)
1111
end
12-
12+
1313
it "should correctly parse the ber message" do
1414
result.should == [1, [3, "Administrator", "ad_is_bogus"]]
15-
end
15+
end
1616
it "should leave unconsumed part of message in place" do
1717
str.should == " UNCONSUMED"
1818
end
@@ -21,9 +21,9 @@
2121
attr_reader :initial_value
2222
before(:each) do
2323
stub_exception_class = Class.new(StandardError)
24-
24+
2525
@initial_value = raw_string("0$\002\001\001`\037\002\001\003\004\rAdministrator\200\vad_is_bogus")
26-
@str = initial_value.dup
26+
@str = initial_value.dup
2727

2828
# Defines a string
2929
io = StringIO.new(initial_value)
@@ -32,16 +32,16 @@
3232
raise stub_exception_class
3333
end
3434
flexmock(StringIO).should_receive(:new).and_return(io)
35-
35+
3636
begin
37-
str.read_ber!(Net::LDAP::AsnSyntax)
37+
str.read_ber!(Net::LDAP::AsnSyntax)
3838
rescue stub_exception_class
3939
# EMPTY ON PURPOSE
4040
else
4141
raise "The stub code should raise an exception!"
4242
end
4343
end
44-
44+
4545
it "should not modify string" do
4646
str.should == initial_value
4747
end

spec/unit/ldap/dn_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
it "should construct a Net::LDAP::DN" do
1313
dn.should be_an_instance_of(Net::LDAP::DN)
14-
end
14+
end
1515

1616
it "should escape all the required characters" do
1717
dn.to_s.should == 'cn=\\,\\+\\"\\\\\\<\\>\\;,ou=company'
@@ -75,6 +75,6 @@
7575
describe "<- .escape(str)" do
7676
it "should escape ,, +, \", \\, <, >, and ;" do
7777
Net::LDAP::DN.escape(',+"\\<>;').should == '\\,\\+\\"\\\\\\<\\>\\;'
78-
end
78+
end
7979
end
8080
end

spec/unit/ldap/entry_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,38 @@
1414
describe "entry access" do
1515
it "should always respond to #dn" do
1616
entry.should respond_to(:dn)
17-
end
18-
17+
end
18+
1919
context "<- #foo" do
2020
it "should respond_to?" do
2121
entry.should respond_to(:foo)
22-
end
22+
end
2323
it "should return 'foo'" do
2424
entry.foo.should == ['foo']
2525
end
2626
end
2727
context "<- #Foo" do
2828
it "should respond_to?" do
2929
entry.should respond_to(:Foo)
30-
end
30+
end
3131
it "should return 'foo'" do
3232
entry.foo.should == ['foo']
33-
end
33+
end
3434
end
3535
context "<- #foo=" do
3636
it "should respond_to?" do
3737
entry.should respond_to(:foo=)
38-
end
38+
end
3939
it "should set 'foo'" do
4040
entry.foo= 'bar'
4141
entry.foo.should == ['bar']
42-
end
42+
end
4343
end
4444
context "<- #fOo=" do
4545
it "should return 'foo'" do
4646
entry.fOo= 'bar'
4747
entry.fOo.should == ['bar']
48-
end
48+
end
4949
end
5050
end
5151
end

spec/unit/ldap/filter_spec.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
end
1010
it "should convert to 'foo:=bar'" do
1111
filter.to_s.should == '(foo:=bar)'
12-
end
12+
end
1313
it "should survive roundtrip via to_s/from_rfc2254" do
1414
Net::LDAP::Filter.from_rfc2254(filter.to_s).should == filter
15-
end
15+
end
1616
it "should survive roundtrip conversion to/from ber" do
1717
ber = filter.to_ber
1818
Net::LDAP::Filter.parse_ber(ber.read_ber(Net::LDAP::AsnSyntax)).should ==
1919
filter
20-
end
20+
end
2121
end
2222
context "various legal inputs" do
2323
[
24-
'(o:dn:=Ace Industry)',
25-
'(:dn:2.4.8.10:=Dino)',
26-
'(cn:dn:1.2.3.4.5:=John Smith)',
24+
'(o:dn:=Ace Industry)',
25+
'(:dn:2.4.8.10:=Dino)',
26+
'(cn:dn:1.2.3.4.5:=John Smith)',
2727
'(sn:dn:2.4.6.8.10:=Barbara Jones)',
2828
'(&(sn:dn:2.4.6.8.10:=Barbara Jones))'
2929
].each do |filter_str|
@@ -35,20 +35,20 @@
3535

3636
it "should decode into a Net::LDAP::Filter" do
3737
filter.should be_an_instance_of(Net::LDAP::Filter)
38-
end
38+
end
3939
it "should survive roundtrip conversion to/from ber" do
4040
ber = filter.to_ber
4141
Net::LDAP::Filter.parse_ber(ber.read_ber(Net::LDAP::AsnSyntax)).should ==
4242
filter
43-
end
43+
end
4444
end
4545
end
4646
end
4747
end
4848
describe "<- .construct" do
4949
it "should accept apostrophes in filters (regression)" do
5050
Net::LDAP::Filter.construct("uid=O'Keefe").to_rfc2254.should == "(uid=O'Keefe)"
51-
end
51+
end
5252
end
5353

5454
describe "convenience filter constructors" do
@@ -58,28 +58,28 @@ def eq(attribute, value)
5858
describe "<- .equals(attr, val)" do
5959
it "should delegate to .eq with escaping" do
6060
described_class.equals('dn', 'f*oo').should == eq('dn', 'f\2Aoo')
61-
end
61+
end
6262
end
6363
describe "<- .begins(attr, val)" do
6464
it "should delegate to .eq with escaping" do
6565
described_class.begins('dn', 'f*oo').should == eq('dn', 'f\2Aoo*')
66-
end
66+
end
6767
end
6868
describe "<- .ends(attr, val)" do
6969
it "should delegate to .eq with escaping" do
7070
described_class.ends('dn', 'f*oo').should == eq('dn', '*f\2Aoo')
71-
end
71+
end
7272
end
7373
describe "<- .contains(attr, val)" do
7474
it "should delegate to .eq with escaping" do
7575
described_class.contains('dn', 'f*oo').should == eq('dn', '*f\2Aoo*')
76-
end
76+
end
7777
end
7878
end
7979
describe "<- .escape(str)" do
8080
it "should escape nul, *, (, ) and \\" do
8181
Net::LDAP::Filter.escape("\0*()\\").should == "\\00\\2A\\28\\29\\5C"
82-
end
82+
end
8383
end
8484

8585
context 'with a well-known BER string' do

0 commit comments

Comments
 (0)