! Fixes tests for everything BUT the number conversion

This commit removes read_ber! since no one seems to be using it. YAGNI.
This commit is contained in:
Kaspar Schiess 2010-02-12 11:59:46 +01:00
parent 4c24cf239a
commit 75f37c58b9
10 changed files with 186 additions and 270 deletions

View file

@ -32,16 +32,15 @@ module Net
StringIO.new(self).read_ber(syntax)
end
def read_ber! syntax=nil
obj,n_consumed = read_ber_from_string(self, syntax)
if n_consumed
self.slice!(0...n_consumed)
obj
else
nil
end
end
# def read_ber! syntax=nil
# obj,n_consumed = read_ber_from_string(self, syntax)
# if n_consumed
# self.slice!(0...n_consumed)
# obj
# else
# nil
# end
# end
end
end
end

View file

@ -32,25 +32,26 @@ module Net
class LDAP
class Dataset < Hash
attr_reader :comments
class IOFilter
def initialize(io)
@io = io
end
def gets
s = @io.gets
s.chomp if s
end
end
def self.read_ldif io
ds = Dataset.new
io = IOFilter.new(io)
line = io.gets
dn = nil
while line
io.gets and chomp
new_line = io.gets
if new_line =~ /^[\s]+/
line << " " << $'
else
@ -75,7 +76,7 @@ module Net
line = nextline
end
end
ds
end