Sha256: b4b5b09f86c86f7237f1758baf374f7e491c1886f1e557efdd16d617641c3017

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

=eat

Problems with the standard <tt>open-uri</tt> library

* sometimes it returns <tt>String</tt> and sometimes <tt>StringIO</tt> (check out <tt>OpenURI::Buffer::StringMax</tt>, usually 10,240 bytes)
* sometimes you have to call <tt>gets</tt> (for example <tt>open('http://yahoo.com').gets</tt>)
* it overrides <tt>#open</tt> everywhere, which may be confusing.

Try <tt>#eat</tt>, which ALWAYS returns a <tt>String</tt>:

    require 'eat'
    eat('http://yahoo.com')                 #=> String
    eat('/home/seamus/foo.txt')             #=> String
    eat('file:///home/seamus/foo.txt')      #=> String

==Options

    eat('http://yahoo.com', :timeout => 10)  # timeout after 10 seconds
    eat('http://yahoo.com', :limit => 1024)  # only read the first 1024 chars

==Warning: doesn't verify SSL certs

If you need to check SSL certificates, please don't use this gem. It always sets

    http.verify_mode = ::OpenSSL::SSL::VERIFY_NONE

==Supported schemas

* local filesystem
* http
* https (it won't check the SSL certificate... if you want security, don't use this!)

Copyright 2011 Seamus Abshere

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eat-0.1.0 README.rdoc