3 # Système de gestion des adhésions de Nos oignons
4 # Copyright © 2013-2014 Nos oignons <contact@nos-oignons.net>
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as
8 # published by the Free Software Foundation, either version 3 of the
9 # License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 BASE_MEMBERS = YAML.load(<<END_OF_YAML)
25 name: Matthieu Simon-Blavier
28 17, square Edouard VII
31 email: registry@domainnetwork.fr
33 membership_fee_paid_on: 2013-02-21
35 Il vient de `whois cogent.fr`.
38 email: sylvain.dufier@orange-ftgroup.com
40 membership_fee_paid_on: 2013-05-29
41 Il vient de `whois orange.fr`.
46 15, rue de la Nuee Bleue
48 email: domaines@sdv.fr
50 membership_fee_paid_on: 2011-01-11
51 Il vient de `whois numericable.fr`.
52 Et il n'est pas à jour de cotisation.
55 EXTRA_MEMBER = YAML.load(<<END_OF_YAML)
58 SOCIETE FRANCAISE DU RADIOTELEPHONE - SFR
59 42, avenue de Friedland
61 email: domains@sfr.com
63 membership_fee_paid_on: 2013-04-04
65 Il vient de `whois sfr.fr`.
68 MEMBER_FILE_TEMPLATE = <<'END_OF_TEMPLATE'
71 <% unless address.nil? -%>
73 <%= address.gsub(/^/, ' ').rstrip %>
76 joined_on: <%= joined_on %>
77 membership_fee_paid_on: <%= membership_fee_paid_on %>
79 [[!ftemplate id="membre"]]
84 def member_filename_for_id(id)
85 expand_path("Membres/%06d.mdwn" % id)
88 def render_member_file(locals)
89 ERB.new(MEMBER_FILE_TEMPLATE, nil, '-').result(OpenStruct.new(locals).instance_eval { binding })
93 max_id = Dir.glob("#{expand_path('Membres')}/*.mdwn").
94 collect { |f| File.basename(f).gsub(/\.mdwn$/, '').to_i }.max || 0