In Files

  • bin/restclient
  • spec/request_spec.rb

Parent

Included Modules

Object

Public Instance Methods

method_missing(s, *args, &b) click to toggle source
 
               # File bin/restclient, line 63
def method_missing(s, *args, &b)
        super unless r.respond_to?(s)
        begin
                r.send(s, *args, &b)
        rescue RestClient::RequestFailed => e
                print STDERR, e.response.body
                raise e
        end
end
            
r() click to toggle source
 
               # File bin/restclient, line 35
def r
        @r ||= RestClient::Resource.new(@url, @username, @password)
end
            
usage(why = nil) click to toggle source
 
               # File bin/restclient, line 8
def usage(why = nil)
        puts "failed for reason: #{why}" if why
        puts "usage: restclient [get|put|post|delete] url|name [username] [password]"
        puts "  The verb is optional, if you leave it off you'll get an interactive shell."
        puts "  put and post both take the input body on stdin."
        exit(1)
end