diff --git a/Project.toml b/Project.toml index 9d95fe3..59b860b 100644 --- a/Project.toml +++ b/Project.toml @@ -18,7 +18,7 @@ Crayons = "4" HTTP = "0.9" JSON = "0.21" OpenQASM = "2" -URIs = "1.0" +URIs = "1.1" julia = "1" [extras] diff --git a/src/IBMQClient.jl b/src/IBMQClient.jl index 786d157..29b1999 100644 --- a/src/IBMQClient.jl +++ b/src/IBMQClient.jl @@ -7,10 +7,6 @@ using URIs using REPL.TerminalMenus using Crayons.Box -include("patch.jl") - -using .Patch: make_uri - include("rest.jl") include("ibmq.jl") include("account.jl") diff --git a/src/patch.jl b/src/patch.jl deleted file mode 100644 index d349641..0000000 --- a/src/patch.jl +++ /dev/null @@ -1,38 +0,0 @@ -module Patch - -using URIs - -# URIs patch, delete this after #12 merged -if !hasmethod(joinpath, Tuple{URI, Vararg{String}}) - - """ - joinpath(uri, path) -> URI - Join the path component of URI and other parts. - """ - function Base.joinpath(uri::URI, parts::String...) - path = uri.path - for p in parts - if startswith(p, '/') - path = p - elseif isempty(path) || path[end] == '/' - path *= p - else - path *= "/" * p - end - end - - if isempty(uri.path) - path = "/" * path - end - return make_uri(uri; path=URIs.normpath(path)) - end - -end - -@static if hasmethod(merge, Tuple{URI}) - make_uri(x::URI; kw...) = merge(x; kw...) -else - make_uri(x::URI; kw...) = URI(x; kw...) -end - -end \ No newline at end of file diff --git a/src/rest.jl b/src/rest.jl index af42b15..fcca228 100644 --- a/src/rest.jl +++ b/src/rest.jl @@ -6,7 +6,6 @@ using HTTP using JSON using URIs using Serialization -using ..Patch: make_uri abstract type AbstractAPI end const mocking = Ref{Bool}(false) @@ -68,7 +67,7 @@ function api_uri(api::AbstractAPI, path::String, query=nothing) return joinpath(api.endpoint, path) else isempty(uri.query) || error("non empty query in API endpoint is not supported") - return make_uri(joinpath(api.endpoint, path); query=query) + return URI(joinpath(api.endpoint, path); query=query) end end