This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/' do | |
dc = Dalli::Client.new('localhost:11211') | |
@info = dc.fetch("info-#{userid}-#{repoid}") do | |
HTTParty.get("#{base_uri}/repos/show/#{userid}/#{repoid}")) | |
end | |
@collaborators = dc.fetch("collaborators-#{userid}-#{repoid}") do | |
HTTParty.get("#{base_uri}/repos/show/#{userid}/#{repoid}/collaborators")) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There's got to be a faster way. This is with a production db dump from a few days ago. | |
% time rake gemcutter:migrate:downloads | |
> gemcutter (0.5.0) 131783 | |
>> 0.5.0 19314 | |
>> 15 | |
>> 0.5.0.pre.2 64 | |
>> 15 | |
>> 0.5.0.pre 45 | |
>> 14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml| | |
xml.feed( | |
:xmlns => 'http://www.w3.org/2005/Atom', | |
'xmlns:osa' => 'http://www.onespot.com/Atom/Extensions/1.0' | |
) do | |
xml.title 'feed title', :type => "html" |