Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: da7bac8bb7
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (31 sloc) 0.952 kB
require "ray/search"
module Ray
class GitHub
include Search
attr_reader :query, :results, :uri
def initialize query
@query = query
@uri = "#{Ray::GITHUB_V2_API}/repos/search/radiant+#{@query}"
@results = search
end
def normalize response
response = MultiJson.decode response
results = {}
response["repositories"].each do |extension|
results[extension["name"].to_extension_name] = {
:author => real_name(extension["owner"]),
:description => extension["description"],
:homepage => extension["url"],
:name => extension["name"].to_extension_name,
:uri => extension["url"],
:version => "master"
}
end
return results
end
def real_name owner
response = open("#{GITHUB_V3_API}/users/#{owner}").read
MultiJson.decode(response)["name"]
end
end
end
Jump to Line
Something went wrong with that request. Please try again.