Skip to content

Commit

Permalink
Revert "first pass to fix issue #13 -- pass through IO-type objects t…
Browse files Browse the repository at this point in the history
…hat can't be IO#read properly (because they are too large?)"

This reverts commit cff91ce -- turns
out rest-client suffers from the same ruby feature, so this trickery
doesn't actually buy us anything after all?
  • Loading branch information
Chris Beer committed Mar 21, 2012
1 parent cff91ce commit 89259a0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
5 changes: 1 addition & 4 deletions lib/rubydora/datastream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ def content
rescue RestClient::ResourceNotFound
end

if @content.kind_of? IO
content = @content.read and @content.rewind rescue nil
end

content = @content.read and @content.rewind if @content.kind_of? IO
content ||= @content
end
alias_method :read, :content
Expand Down
10 changes: 0 additions & 10 deletions spec/lib/datastream_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,6 @@

end

it "should pass-through IO-type content if reading the content fails" do
@mock_io = File.open('rubydora.gemspec')
@mock_io.should_receive(:read).and_raise('Rubydora #13-style read-error.')

@datastream.content = @mock_io

@datastream.content.should == @mock_io

end


end

Expand Down

0 comments on commit 89259a0

Please sign in to comment.