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`.
42 email: sylvain.dufier@orange-ftgroup.com
44 membership_fee_paid_on: 2013-05-29
45 Il vient de `whois orange.fr`.
50 15, rue de la Nuee Bleue
52 email: domaines@sdv.fr
54 membership_fee_paid_on: 2011-01-11
55 Il vient de `whois numericable.fr`.
56 Et il n'est pas à jour de cotisation.
59 EXTRA_MEMBER = YAML.load(<<END_OF_YAML)
62 SOCIETE FRANCAISE DU RADIOTELEPHONE - SFR
63 42, avenue de Friedland
65 email: domains@sfr.com
67 membership_fee_paid_on: 2013-04-04
69 Il vient de `whois sfr.fr`.
72 MEMBER_FILE_TEMPLATE = <<'END_OF_TEMPLATE'
76 <%= address.gsub(/^/, ' ').rstrip %>
78 joined_on: <%= joined_on %>
79 membership_fee_paid_on: <%= membership_fee_paid_on %>
81 [[!ftemplate id="membre"]]
86 def member_filename_for_id(id)
87 expand_path("Membres/%06d.mdwn" % id)
90 def render_member_file(locals)
91 ERB.new(MEMBER_FILE_TEMPLATE).result(OpenStruct.new(locals).instance_eval { binding })
95 max_id = Dir.glob("#{expand_path('Membres')}/*.mdwn").
96 collect { |f| File.basename(f).gsub(/\.mdwn$/, '').to_i }.max || 0