Katello/katello — pull request #528 by iNecas (2012-08-28 09:25:44+00:00)
Title: cdn-var-substitutor - isolate the logic to separate class

It's possible now to use the CdnVarSubstitutor without the rest of the
Rails code, e.g.:

require 'lib/util/cdn_var_substitutor.rb'
class CDN
def get(path)
{"/server/listing" => "6.1\n6.2",
"/server/6.1/listing" => "x86_64\ni386",
"/server/6.2/listing" => "x86_64"}[path]
end
end
substitutor = Util::CdnVarSubstitutor.new(CDN.new)
substitutor.substitute_vars("/server/$releasever/$basearch/os")

All it requires is an object with a method get, taking path inside a
CDN and returning the body for the path.