Sha256: 1629902259d1077d4ad62f54f3c9bbc6870e0ce23d42be8ff280769774d9081d
Contents?: true
Size: 460 Bytes
Versions: 14
Compression:
Stored size: 460 Bytes
Contents
require "open-uri" require "yajl/json_gem" module Kurchatov module Mixin module Http # /path/to/file, https://ya.ru, http://a:a@yandex.ru def rest_get(url) uri = URI(url) if uri.userinfo open("#{uri.scheme}://#{uri.hostname}:#{uri.port}#{uri.request_uri}", :http_basic_authentication => [uri.user, uri.password]).read else open(url).read end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems