summaryrefslogtreecommitdiff
blob: 164479738a2093f09adff50843a5d64511197e93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'rexml/document'

class DevelopersController < ApplicationController
  include REXML

  PLANET_INI_URL = 'http://sources.gentoo.org/viewcvs.py/*checkout*/planet/configs/planet.ini'
  
  USERINFO = '/home/nichoj/checkouts/gentoo/xml/htdocs/proj/en/devrel/roll-call/userinfo.xml'

  def index
    list
    render :action => 'list'
  end

  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
  verify :method => :post, :only => [ :destroy, :create, :update ],
         :redirect_to => { :action => :list }

  def list
    @developer_pages, @developers = paginate :developers, :per_page => 10
  end

  def show
    if params[:id] =~ /^\d+$/
      @developer = Developer.find(params[:id])
    else
      @developer = Developer.find_by_nickname(params[:id])
    end
  end

  def load_from_planet
    Developer.load_planet_settings
    redirect_to :action => 'list'
  end

  def load_from_userinfo
    Developer.load_from_userinfo
    redirect_to :action => 'list'
  end
end