Classes and Modules
Module Rufus::Verbs::CookieMixinModule Rufus::Verbs::DigestAuthMixin
Module Rufus::Verbs::HostMixin
Module Rufus::Verbs::VerboseMixin
Class Rufus::Verbs::ConditionalEndPoint
Class Rufus::Verbs::Cookie
Class Rufus::Verbs::CookieJar
Class Rufus::Verbs::CookieKey
Class Rufus::Verbs::EndPoint
Constants
| USER_AGENT | = | "Ruby rufus-verbs #{VERSION}" | ||
| VERSION | = | '1.0.0' | The version of this rufus-verbs [gem] |
Public instance methods
delete
(*args)
DELETE
[show source]
# File lib/rufus/verbs.rb, line 60 60: def delete (*args) 61: 62: EndPoint.request :delete, args 63: end
fopen
(uri, *args, &block)
Opens a file or a URI (GETs it and return the reply). Will tolerate a HTTP[S] URI or a file path.
It is not named open() in order not to collide with File.open and open-uri’s open.
[show source]
# File lib/rufus/verbs.rb, line 88 88: def fopen (uri, *args, &block) 89: 90: # should I really care about blocks here ? ... 91: 92: u = URI.parse uri.to_s 93: 94: return File.open(uri.to_s, &block) \ 95: if u.scheme == nil 96: 97: return File.open(uri.to_s[5..-1], &block) \ 98: if u.scheme == 'file' 99: 100: if u.scheme == 'http' or u.scheme == 'https' 101: 102: r = EndPoint.request(:get, [ uri ] + args) \ 103: 104: if block 105: block.call r 106: return 107: end 108: 109: class << r 110: def read 111: self.body 112: end 113: end unless r.respond_to?(:read) 114: 115: return r 116: end 117: 118: raise "can't handle scheme '#{u.scheme}' for #{u.to_s}" 119: end
get
(*args)
GET
[show source]
# File lib/rufus/verbs.rb, line 36 36: def get (*args) 37: 38: EndPoint.request :get, args 39: end
head
(*args)
HEAD
[show source]
# File lib/rufus/verbs.rb, line 68 68: def head (*args) 69: 70: EndPoint.request :head, args 71: end
options
(*args)
OPTIONS
[show source]
# File lib/rufus/verbs.rb, line 76 76: def options (*args) 77: 78: EndPoint.request :options, args 79: end
post
(*args, &block)
POST
[show source]
# File lib/rufus/verbs.rb, line 44 44: def post (*args, &block) 45: 46: EndPoint.request :post, args, &block 47: end
put
(*args, &block)
PUT
[show source]
# File lib/rufus/verbs.rb, line 52 52: def put (*args, &block) 53: 54: EndPoint.request :put, args, &block 55: end