aq_banking 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -23
- data/docker-compose.yml +3 -11
- data/lib/aq_banking/cli.rb +7 -1
- data/lib/aq_banking/commander.rb +8 -3
- data/lib/aq_banking/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14c18dc02ea5892da664c7359a56b972906d8d36
|
4
|
+
data.tar.gz: 7b797ae4ff23ace3ea98bf9fa0a1be6efba507a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8b0fddd90846924229c2c05208f81ff8e44cd416ed0e3d4e4a9ce6a97fc8a666dbb1e8744ee8607ec02323715ddb2ac72f47f4d65b27bce0d2a2dc86fef6d6d
|
7
|
+
data.tar.gz: 1e6a5b8786683f29c035c079de0bb56deb0fc0b1c0311e997c81b5dc9938fac891d6e74caf58c95044c121086b99f178c233305a80688cc94e39840bfff10515
|
data/README.md
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# AqBanking
|
2
|
-
|
3
1
|
[![Travis Status](https://travis-ci.org/rweng/aq_banking.svg)](https://travis-ci.org/rweng/aq_banking)
|
4
2
|
[![codecov.io](http://codecov.io/github/rweng/aq_banking/coverage.svg?branch=master)](http://codecov.io/github/rweng/aq_banking?branch=master)
|
5
3
|
|
@@ -41,13 +39,13 @@ To avoid errors with versions etc, I recommend using the docker image:
|
|
41
39
|
docker run -it --rm rweng/aq_banking --help
|
42
40
|
docker run -it --rm rweng/aq_banking request --bank=diba BLZ ACCCOUNT_NUMBER LOGIN_ID PASSWORD --from=2016-04-18
|
43
41
|
|
44
|
-
|
42
|
+
# Installation
|
45
43
|
|
46
|
-
|
44
|
+
## CLI
|
47
45
|
|
48
46
|
gem install aq_banking
|
49
47
|
|
50
|
-
|
48
|
+
## Ruby
|
51
49
|
|
52
50
|
Add this line to your application's Gemfile:
|
53
51
|
|
@@ -59,30 +57,26 @@ And then execute:
|
|
59
57
|
|
60
58
|
$ bundle
|
61
59
|
|
62
|
-
|
60
|
+
# Usage
|
63
61
|
|
64
62
|
aq_banking --help
|
65
63
|
aq_banking request BLZ ACCCOUNT USER_ID PASSWORD --bank=diba
|
66
64
|
|
67
|
-
|
68
|
-
|
69
|
-
# log into container
|
70
|
-
docker-compose run dev
|
71
|
-
|
65
|
+
# Development
|
72
66
|
# run tests
|
73
67
|
rspec
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
docker push rweng/aq_banking
|
83
|
-
|
84
|
-
|
85
|
-
|
68
|
+
|
69
|
+
# log into container for integration testing
|
70
|
+
docker-compose run gem
|
71
|
+
aq_banking help
|
72
|
+
|
73
|
+
## Release
|
74
|
+
|
75
|
+
# publish gem, build and push docker container
|
76
|
+
rake release && docker-compose build --no-cache gem && docker push rweng/aq_banking
|
77
|
+
|
78
|
+
|
79
|
+
# Contributing
|
86
80
|
|
87
81
|
Bug reports and pull requests are welcome on GitHub at https://github.com/rweng/aq_banking.
|
88
82
|
|
data/docker-compose.yml
CHANGED
@@ -1,26 +1,18 @@
|
|
1
1
|
version: '2'
|
2
2
|
|
3
3
|
services:
|
4
|
-
|
4
|
+
gem:
|
5
5
|
build: .
|
6
6
|
image: rweng/aq_banking
|
7
|
-
|
8
|
-
dev:
|
9
|
-
image: rweng/aq_banking
|
10
|
-
depends_on:
|
11
|
-
- release
|
12
7
|
volumes:
|
13
8
|
- .:/gem
|
14
|
-
|
15
|
-
- cache
|
9
|
+
- cache:/usr/local/bundle/cache
|
16
10
|
working_dir: /gem
|
17
11
|
entrypoint: []
|
18
12
|
command: "/bin/bash -c 'bundle install --binstubs bin; /bin/bash'"
|
19
13
|
environment:
|
20
14
|
PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./bin"
|
21
15
|
|
16
|
+
volumes:
|
22
17
|
cache:
|
23
|
-
image: busybox
|
24
|
-
volumes:
|
25
|
-
- /usr/local/bundle/cache
|
26
18
|
|
data/lib/aq_banking/cli.rb
CHANGED
@@ -2,6 +2,11 @@ require 'thor'
|
|
2
2
|
|
3
3
|
module AqBanking
|
4
4
|
class Cli < Thor
|
5
|
+
def initialize *args
|
6
|
+
super
|
7
|
+
AqBanking.logger.level = Logger::DEBUG if options[:verbose]
|
8
|
+
end
|
9
|
+
|
5
10
|
class_option :dry, :type => :boolean, default: false, aliases: '-d'
|
6
11
|
class_option :verbose, :type => :boolean, default: false, aliases: '-v'
|
7
12
|
|
@@ -24,6 +29,7 @@ module AqBanking
|
|
24
29
|
request_options[:from] = options[:from] if options[:from]
|
25
30
|
request_options[:to] = options[:to] if options[:to]
|
26
31
|
|
32
|
+
|
27
33
|
response = commander.send_request!(request_options)
|
28
34
|
account = parser.parse_account_list(response).first
|
29
35
|
|
@@ -63,4 +69,4 @@ module AqBanking
|
|
63
69
|
BANKS[options[:bank].to_sym] || raise(ArgumentError.new("bank \"#{options[:bank]}\" not found"))
|
64
70
|
end
|
65
71
|
end
|
66
|
-
end
|
72
|
+
end
|
data/lib/aq_banking/commander.rb
CHANGED
@@ -48,14 +48,19 @@ module AqBanking
|
|
48
48
|
raise ArgumentError.new("unknown hbci_version: \"#{hbci_version}\"") unless HBCI_VERSIONS.include? hbci_version
|
49
49
|
raise ArgumentError.new("server url must be present") unless server_url.present?
|
50
50
|
|
51
|
+
logger.debug 'calling Commander#with_pin with args %p %p %p' % [bank_code, user_id, password]
|
51
52
|
with_pin bank_code, user_id, password do |pin_file_path|
|
53
|
+
logger.debug 'pinfile: %p' % [pin_file_path]
|
52
54
|
unless account_exists? bank_code: bank_code, user_id: user_id
|
55
|
+
logger.debug 'account (%p) does not exist, adding it' % {bank_code: bank_code, user_id: user_id}
|
53
56
|
add_account(server_url: server_url, hbci_version: hbci_version,
|
54
57
|
bank_code: bank_code, user_id: user_id, user_name: user_name)
|
55
58
|
|
59
|
+
logger.debug 'calling getsysid with %p' % {pin_file: pin_file_path, user_id: user_id, bank_code: bank_code}
|
56
60
|
call_getsysid pin_file: pin_file_path, user_id: user_id, bank_code: bank_code
|
57
61
|
end
|
58
62
|
|
63
|
+
logger.debug 'sending request %p' % [bank_code, account_number, pin_file_path, from: from, to: to]
|
59
64
|
send_request(bank_code, account_number, pin_file_path, from: from, to: to)
|
60
65
|
end
|
61
66
|
end
|
@@ -97,15 +102,15 @@ module AqBanking
|
|
97
102
|
# @return [AqBanking::Commander::Result]
|
98
103
|
# @raise [Timeout::Error]
|
99
104
|
def run(cmd, timeout: DEFAULT_TIMEOUT)
|
100
|
-
logger.
|
105
|
+
logger.debug 'running cmd: %p' % cmd
|
106
|
+
|
101
107
|
result = nil
|
102
108
|
|
103
109
|
Timeout::timeout(timeout) do
|
104
110
|
result = Result.new( *Open3.capture3(cmd) )
|
105
111
|
end
|
106
112
|
|
107
|
-
logger.debug result.to_s
|
108
|
-
|
113
|
+
logger.debug "result: #{result.to_s}"
|
109
114
|
result
|
110
115
|
end
|
111
116
|
|
data/lib/aq_banking/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aq_banking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Wenglewski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|