README.txt in rufus-verbs-0.7 vs README.txt in rufus-verbs-0.8

- old
+ new

@@ -24,17 +24,17 @@ * conditional GET (via ConditionalEndPoint class) * request body built via a block (post and put) * cookie-aware (if :cookies option is explicitely set to true) * http digest authentication (rfc 2617) (auth ok, auth-int not tested) * query parameters are automatically escaped (disable with :no_escape => true) +* fopen(uri) method (feels like open-uri's open method, but provides all the previously mentioned features) maybe later : * retry on failure * cache awareness * greediness (automatic parsing for content like JSON or YAML) -* head, options * persistent cookie jar == getting it @@ -146,9 +146,24 @@ res = get "http://server/doc0", :hba => [ "toto", "secretpass" ] res = get( "http://server/doc1", :digest_authentication => [ "toto", "secretpass" ]) + +The Rufus::Verbs module provides as well a <tt>fopen</tt> method, which mostly feels like the <tt>open</tt> method of open-uri. + + res = fopen "CHANGELOG.txt" + + Rufus::Verbs.fopen "mydir/mypath.txt" do |f| + puts f.readlines + end + + res = Rufus::Verbs.fopen "http://whatever.nada.ks" + + res = Rufus::Verbs.fopen "http://whatever.nada.ks", :noredir => true + +But it follows redirections (has all the rufus-verbs features). It's provided for when targets are local files or URIs. + The tests may provide good intel as on 'rufus-verbs' usage as well : http://rufus.rubyforge.org/svn/trunk/verbs/test/ == the options