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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fdafa67936f926c7f71dd8c7ef8f301d4743024
4
- data.tar.gz: c045f57adc27935b6a12d0ce21d5c9a16daa7fab
3
+ metadata.gz: 14c18dc02ea5892da664c7359a56b972906d8d36
4
+ data.tar.gz: 7b797ae4ff23ace3ea98bf9fa0a1be6efba507a2
5
5
  SHA512:
6
- metadata.gz: ea6ec63c81dafc9c37d9da372c63d956abbf73504b611adc264f00ab31152d995f65c64e31c411cc1721bee65d7f03790e55a4cf441e50d4095912110800d74c
7
- data.tar.gz: 3630b9bcddf7ddfce9fc05e597fcfaf335355afd60745dce0495e826dfbd9fc6a7c7e79a3156f45c8457b78d0f03d7f1087ef6098be4f6fd66246e80f7e70238
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
- ## Installation
42
+ # Installation
45
43
 
46
- ### CLI
44
+ ## CLI
47
45
 
48
46
  gem install aq_banking
49
47
 
50
- ### Ruby
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
- ## Usage
60
+ # Usage
63
61
 
64
62
  aq_banking --help
65
63
  aq_banking request BLZ ACCCOUNT USER_ID PASSWORD --bank=diba
66
64
 
67
- ## Development
68
-
69
- # log into container
70
- docker-compose run dev
71
-
65
+ # Development
72
66
  # run tests
73
67
  rspec
74
-
75
- ### Release
76
-
77
- # publish gem
78
- rake release
79
-
80
- # publish docker container
81
- docker-compose build --no-cache release
82
- docker push rweng/aq_banking
83
-
84
-
85
- ## Contributing
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
- release:
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
- volumes_from:
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
 
@@ -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
@@ -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.info "run: #{cmd}"
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
 
@@ -1,3 +1,3 @@
1
1
  module AqBanking
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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-23 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor