It seems that the gem client.search does not match the github client.search... and the spec is based on the github client.search. And to be honest I cannot figure out how to get it to work with the Gem search. They do not include a spec for search in the Gem example provided in the api_spec.rb (no search_spec) gives a 404: client.search(:first_name => "Javan", :fields => ["num_results", "total"])
My suggestion would to be build the gem from the github source and use the selectors.
Gem:
def search(options={})
path = "/people-search"
options = { :keywords => options } if options.is_a?(String)
if fields = options.delete(:fields)
path +=":(#{fields.map{ |f| f.to_s.gsub("_","-") }.join(',')})"
end
options = format_options_for_query(options)
result_json = get(to_uri(path, options))
Mash.from_json(result_json)
end
GitHub:
def search(options={})
path = "/people-search"
if options.is_a?(Hash)
fields = options.delete(:fields)
path += field_selector(fields) if fields
puts path
end
options = { :keywords => options } if options.is_a?(String)
options = format_options_for_query(options)
result_json = get(to_uri(path, options))
Mash.from_json(result_json)
end