BASE_SUBSCRIPTIONS = YAML.load(<<END_OF_YAML)
000001:
name: Matthieu Simon-Blavier
- address:
+ address: |
Domain Network Sas
17, square Edouard VII
75009 Paris
Il vient de `whois cogent.fr`.
000002:
name: Sylvain Dufier
- address:
+ address: |
ORANGE FRANCE
13, rue de Javel
75015 Paris
Il vient de `whois orange.fr`.
000003:
name: Salim Gasmi
+ address: |
SDV PLURIMEDIA
15, rue de la Nuee Bleue
67000 Strasbourg
EXTRA_SUBSCRIPTION = YAML.load(<<END_OF_YAML)
name: Franck Rohard
-address:
+address: |
SOCIETE FRANCAISE DU RADIOTELEPHONE - SFR
42, avenue de Friedland
75008 Paris
SUBSCRIPTION_FILE_TEMPLATE = <<'END_OF_TEMPLATE'
---
name: <%= name %>
-address:
- <%= address %>
+address: |
+<%= address.gsub(/^/, ' ').rstrip %>
email: <%= email %>
mumbership_fee_paid_on: <%= membership_fee_paid_on %>
---
def render_subscription_file(locals)
ERB.new(SUBSCRIPTION_FILE_TEMPLATE).result(OpenStruct.new(locals).instance_eval { binding })
end
+
+def new_id
+ new_id = Dir.glob("#{current_dir}/Membres/*.mdwn").
+ collect { |f| File.basename(f).gsub(/\.mdwn$/, '').to_i }.max + 1
+end