From 65790969dc54dfb6eb8d4ad2e03a01dbd382c170 Mon Sep 17 00:00:00 2001 From: Lunar Date: Sat, 1 Jun 2013 13:05:45 +0200 Subject: [PATCH 1/1] Finish implementing list-emails --- bin/list-emails | 2 +- features/step_definitions/subscriptions.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/list-emails b/bin/list-emails index 4c8a286..935bcd0 100755 --- a/bin/list-emails +++ b/bin/list-emails @@ -10,7 +10,7 @@ require 'nos_oignons/subscriptions' subscriptions = read_subscriptions now = Time.now last_year = Time.new(now.year - 1, now.month, now.day).to_date -subscriptions.each_pair do |subscription_id, data| +subscriptions.sort.each do |subscription_id, data| if data['membership_fee_paid_on'] && last_year < data['membership_fee_paid_on'] puts data['email'] end diff --git a/features/step_definitions/subscriptions.rb b/features/step_definitions/subscriptions.rb index 571a2c2..a4827f5 100644 --- a/features/step_definitions/subscriptions.rb +++ b/features/step_definitions/subscriptions.rb @@ -4,7 +4,7 @@ Given /une base de membres vide$/ do create_dir 'Membres' end -Given /^une base avec (\w+)(, à jour de cotisation| qui n'a pas payé sa cotisation cette année)$/ do |name, uptodate| +Given /^(?:une base )?avec (\w+)(, à jour de cotisation| qui n'a pas payé sa cotisation cette année)$/ do |name, uptodate| case uptodate when ', à jour de cotisation' # ± 1 month ago -- 2.39.5