public
Description: GET, POST, PUT, DELETE, with something around (ruby)
Homepage: http://rufus.rubyforge.org/rufus-verbs
Clone URL: git://github.com/jmettraux/rufus-verbs.git
Search Repo:
making sure that the return of fopen() has a read() method (like a File 
instance would)
jmettraux (author)
Wed Apr 09 17:26:45 -0700 2008
commit  1607d9e0a07a9948131aaf00268ffce71acae4c3
tree    a31dfa46974d5351e0c15b2ba45232b06be0e344
parent  b74b5651fd839631e670f68a9c98cfb3a1a45b6a
...
4
5
6
 
 
7
8
9
...
4
5
6
7
8
9
10
11
0
@@ -4,6 +4,8 @@
0
 
0
 == rufus-verbs - 0.9 released 2008/04/xx
0
 
0
+- bug #19408 : fopen now returns a instance that has a read() method.
0
+ problem pointed at by Scott Sproule.
0
 - bug #19234 : cookie path checking broken - Fixed.
0
 - todo #19202 : EndPoint.cookies now readable
0
 - bug #19201 : :params not respected when specified in request
...
3
4
5
 
6
...
3
4
5
6
7
0
@@ -3,5 +3,6 @@
0
 
0
 == Feedback
0
 
0
+Scott Sproule : fopen() result didn't have a read() method
0
 Maik Schmidt : missing 'rufus-lru'
...
163
164
165
 
 
166
167
168
...
163
164
165
166
167
168
169
170
0
@@ -163,6 +163,8 @@
0
 
0
 But it follows redirections (has all the rufus-verbs features). It's provided for when targets are local files or URIs.
0
 
0
+This fopen() method makes sure to return an object that has a read() method (like a File instance has).
0
+
0
 
0
 The tests may provide good intel as on 'rufus-verbs' usage as well : http://rufus.rubyforge.org/svn/trunk/verbs/test/
0
 
...
113
114
115
116
117
118
 
 
 
 
 
 
 
 
119
120
121
...
113
114
115
 
 
116
117
118
119
120
121
122
123
124
125
126
127
0
@@ -113,9 +113,15 @@
0
             if block
0
                 block.call r
0
                 return
0
- else
0
- return r
0
             end
0
+
0
+ class << r
0
+ def read
0
+ self.body
0
+ end
0
+ end unless r.respond_to?(:read)
0
+
0
+ return r
0
         end
0
 
0
         raise "can't handle scheme '#{u.scheme}' for #{u.to_s}"
...
50
51
52
 
 
 
 
 
 
 
53
...
50
51
52
53
54
55
56
57
58
59
60
0
@@ -50,5 +50,12 @@
0
             assert_equal "{}", res.body.strip
0
         end
0
     end
0
+
0
+ def test_1
0
+
0
+ assert_kind_of String, fopen("CHANGELOG.txt").read
0
+ assert_kind_of String, fopen("file:CHANGELOG.txt").read
0
+ assert_kind_of String, fopen("http://localhost:7777/items").read
0
+ end
0
 end

Comments

    No one has commented yet.