Class: ASF::Site

Inherits:
Object
  • Object
show all
Defined in:
lib/whimsy/asf/site.rb

Constant Summary collapse

@@list =
{}

Class Method Summary collapse

Class Method Details

.list ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/whimsy/asf/site.rb', line 8

def self.list
  Committee.load_committee_info
  templates = ASF::SVN['asf/infrastructure/site/trunk/templates']
  file = "#{templates}/blocks/projects.mdtext"
  return @@list if not @@list.empty? and File.mtime(file) == @@mtime
  @@mtime = File.mtime(file)

  projects = File.read(file)
  projects.scan(/\[(.*?)\]\((http.*?) "(.*)"\)/).each do |name, link, text|
    @@list[Committee.find(name).name] = {link: link, text: text}
  end

  @@list
end