Sha256: 53f89ece1c23872ab2227367ba4ab6ccfb9bf855117c9a59fbfbea3422d401b4

Contents?: true

Size: 521 Bytes

Versions: 3

Compression:

Stored size: 521 Bytes

Contents

module Twurl
  class RequestController < AbstractCommandController
    NO_URI_MESSAGE = "No URI specified"
    def dispatch
      if client.needs_to_authorize?
        raise Exception, "You need to authorize first."
      end
      options.path ||= OAuthClient.rcfile.alias_from_options(options)
      perform_request
    end

    def perform_request
      response = client.perform_request_from_options(options)
      CLI.puts response.body
    rescue URI::InvalidURIError
      CLI.puts NO_URI_MESSAGE
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
mbbx6spp-twurl-0.6.1 lib/twurl/request_controller.rb
twurl-0.6.1 lib/twurl/request_controller.rb
twurl-0.6.0 lib/twurl/request_controller.rb