Class: RankMirror::RemotePackman

Inherits:
Object
  • Object
show all
Defined in:
lib/rankmirror/distro/remote/packman.rb

Instance Method Summary collapse

Constructor Details

#initializeRemotePackman

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

#fetchObject



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