Rename path_to -> url_to since it returns a url
This commit is contained in:
parent
e93ec12b32
commit
acf46fce5f
@ -232,7 +232,7 @@ module GitHub
|
|||||||
end
|
end
|
||||||
|
|
||||||
def repository(user, repo)
|
def repository(user, repo)
|
||||||
open(path_to("repos", user, repo))
|
open(url_to("repos", user, repo))
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_code(**params)
|
def search_code(**params)
|
||||||
@ -273,7 +273,7 @@ module GitHub
|
|||||||
end
|
end
|
||||||
|
|
||||||
def private_repo?(full_name)
|
def private_repo?(full_name)
|
||||||
uri = path_to "repos", full_name
|
uri = url_to "repos", full_name
|
||||||
open(uri) { |json| json["private"] }
|
open(uri) { |json| json["private"] }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -295,12 +295,12 @@ module GitHub
|
|||||||
"#{key}:#{value}"
|
"#{key}:#{value}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def path_to(*subroutes)
|
def url_to(*subroutes)
|
||||||
URI.parse(File.join(API_URL, *subroutes))
|
URI.parse(File.join(API_URL, *subroutes))
|
||||||
end
|
end
|
||||||
|
|
||||||
def search(entity, *queries, **qualifiers)
|
def search(entity, *queries, **qualifiers)
|
||||||
uri = path_to "search", entity
|
uri = url_to "search", entity
|
||||||
uri.query = query_string(*queries, **qualifiers)
|
uri.query = query_string(*queries, **qualifiers)
|
||||||
open(uri) { |json| json["items"] }
|
open(uri) { |json| json["items"] }
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user