-
Notifications
You must be signed in to change notification settings - Fork 12
/
Rakefile
35 lines (29 loc) · 913 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require(File.join(File.dirname(__FILE__), 'lib', 'aq_banking'))
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/test*.rb']
t.verbose = true
end
namespace :aqbanking do
desc "Prepares the local system for aqbanking"
task :setup do
AqBanking::Account::ACCOUNTS.each do |k, v|
AqBanking.add_account(k)
end
end
desc "Cleans all users and account from the local system "
task :cleanup do
users_str = AqBanking::Commander.list_users
accounts_str = AqBanking::Commander.list_accounts
accounts_str.each_line do |line|
a = line[/Account Number: ([^ .]*)/, 1]
b = line[/Bank: ([^ .]*)/, 1]
system(AqBanking::Commander.delete_account_cmd(a, b))
end
users_str.each_line do |line|
user_id = line[/User Id: ([^ .]*)/, 1]
system(AqBanking::Commander.delete_user_cmd(user_id))
end
end
end