Class: RankMirror::RemotePackman
- Inherits:
-
Object
- Object
- RankMirror::RemotePackman
- Defined in:
- lib/rankmirror/distro/remote/packman.rb
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize ⇒ RemotePackman
constructor
A new instance of RemotePackman.
Constructor Details
#initialize ⇒ RemotePackman
Returns a new instance of RemotePackman.
5 6 7 |
# File 'lib/rankmirror/distro/remote/packman.rb', line 5 def initialize @mirrors = [] end |
Instance Method Details
#fetch ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rankmirror/distro/remote/packman.rb', line 9 def fetch cache = RankMirror::Cache.new("http://packman.links2linux.de/mirrors").fetch doc = Nokogiri::HTML(open(cache)) doc.xpath('//td[@class="mirrortable mirror"]').each do |td| unless td.at_xpath("a").nil? # ignore rsync mirror v = td.at_xpath("a/@href").value v << "/" unless /^.*\/$/.match(v) v << "suse/" @mirrors << v unless v.index("ftp://") end end return @mirrors end |