Skip to content

Instantly share code, notes, and snippets.

View keolo's full-sized avatar
🎵

keolo

🎵
View GitHub Profile
# There's got to be a better way to do this!!
class Object
def instance_values
self.instance_variables.map{|var| var_sym = var.to_s.gsub('@','').to_sym; {var_sym => self.send(var_sym)}}
end
end
# Add http basic authentication to rsolr v0.12.1
class RSolr::Connection::NetHttp
def get_request(url)
req = Net::HTTP::Get.new(url)
req.basic_auth(@uri.user, @uri.password) if @uri.user && @uri.password
self.connection.request(req)
end
def post_request(url, data, headers)
req = Net::HTTP::Post.new(url, headers)