X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/blobdiff_plain/6f0407b6532f52cb0726b2b7fe0070e1709dd5dc..dbc09190540223245b4e75fc3c7ea2d0690a1a5b:/features/support/fixtures.rb diff --git a/features/support/fixtures.rb b/features/support/fixtures.rb index 32142b2..3c74f4b 100644 --- a/features/support/fixtures.rb +++ b/features/support/fixtures.rb @@ -35,10 +35,6 @@ BASE_MEMBERS = YAML.load(< +<% unless address.nil? -%> address: | <%= address.gsub(/^/, ' ').rstrip %> +<% end -%> email: <%= email %> joined_on: <%= joined_on %> membership_fee_paid_on: <%= membership_fee_paid_on %> @@ -84,15 +82,15 @@ membership_fee_paid_on: <%= membership_fee_paid_on %> END_OF_TEMPLATE def member_filename_for_id(id) - "Membres/%06d.mdwn" % id + expand_path("Membres/%06d.mdwn" % id) end def render_member_file(locals) - ERB.new(MEMBER_FILE_TEMPLATE).result(OpenStruct.new(locals).instance_eval { binding }) + ERB.new(MEMBER_FILE_TEMPLATE, nil, '-').result(OpenStruct.new(locals).instance_eval { binding }) end def new_id - max_id = Dir.glob("#{current_dir}/Membres/*.mdwn"). + max_id = Dir.glob("#{expand_path('Membres')}/*.mdwn"). collect { |f| File.basename(f).gsub(/\.mdwn$/, '').to_i }.max || 0 max_id + 1 end