epics 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 063dc49eee1a69c5da9492fe57bfebad265b6b8c
4
- data.tar.gz: 2a4ee56062ace723a77db89e8d6d0f740e746a13
5
- SHA512:
6
- metadata.gz: d95094a67c27c63c46cbbc406bdb9951ed03a187b933a3feddb5378feaaeebeddac1c727344247af71cb8fe7495c18938ec0d7d288765d9a2e7a7cd7a7603f31
7
- data.tar.gz: 12d39c6a553e7e21ccae83680f93abd8fb4c5aed789f25c15c20acbbf1806c3d58407a97ef55392b8fe7e21f3703cbe64031de0a9ab1faa4ef79852c5e942dc8
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MmNhM2QwYzllMzkwNTQ2Y2FmYjdiZjJmOWFjZjBiNzE2YmMyMGY0Mg==
5
+ data.tar.gz: !binary |-
6
+ NmM3M2NmM2VmYzczZTczN2JhZWI1ZWQ5NmVmYjRiMDg4ZmIyNmFkMw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YTQwMWUwY2QwMGUwNGM1MmEyZGJiNWQyNTQxNjE0NjQ1NzJhZWI1N2ViODhk
10
+ NTQ3MTYxNzM5OTI0NWEyMTkxZjNiNTIxZTczMDY3MTg3NDg2MmI4NWNjNjQw
11
+ NDY3YTRjYjNlZWRiYzUxYmU4MzA3MTZlNzIwYTlkM2I5NGRkODk=
12
+ data.tar.gz: !binary |-
13
+ NDk5NmUxNTdhZmUxOGU2ZThlZmQ0OThmOTU4ZWRhODVmYTIxN2FkMzQxMWNk
14
+ YzMzYTMwNWU3MGRlYmJlY2UxZWI1YjQ4ZTUwOWI1YWE4ZGMwN2YwYTc2NjVh
15
+ YTg5MGNhODNkNTJkYmFlNmE1YWViYTQ1YzhmNDQ4ZTVhMjNkZjM=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 1.1.2
2
+
3
+ * [BUGFIX] missing require statements for `zlib`
4
+ * [BUGFIX] #16 `setup` tried to initialize wrong class
5
+
1
6
  ### 1.1.1
2
7
 
3
8
  * [BUGFIX] CCT order was submited as CD1
data/lib/epics.rb CHANGED
@@ -2,6 +2,7 @@ require 'openssl'
2
2
  require 'base64'
3
3
  require 'erb'
4
4
  require 'json'
5
+ require 'zlib'
5
6
  require 'nokogiri'
6
7
  require 'gyoku'
7
8
  require 'faraday'
data/lib/epics/client.rb CHANGED
@@ -19,8 +19,8 @@ class Epics::Client
19
19
  def inspect
20
20
  "#<#{self.class}:#{self.object_id}
21
21
  @keys=#{self.keys.keys},
22
- @user_id=#{self.user_id},
23
- @partner_id=#{self.partner_id}"
22
+ @user_id=\"#{self.user_id}\",
23
+ @partner_id=\"#{self.partner_id}\""
24
24
  end
25
25
 
26
26
  def e
@@ -56,7 +56,7 @@ class Epics::Client
56
56
  end
57
57
 
58
58
  def self.setup(passphrase, url, host_id, user_id, partner_id, keysize = 2048)
59
- client = Client.new(nil, passphrase, url, host_id, user_id, partner_id)
59
+ client = new(nil, passphrase, url, host_id, user_id, partner_id)
60
60
  client.keys = %w(A006 X002 E002).each_with_object({}) do |type, memo|
61
61
  memo[type] = Epics::Key.new( OpenSSL::PKey::RSA.generate(keysize) )
62
62
  end
@@ -87,15 +87,11 @@ class Epics::Client
87
87
  end
88
88
 
89
89
  def HIA
90
- respnse = post(url, Epics::HIA.new(self).to_xml).body
91
-
92
- respnse.ok?
90
+ post(url, Epics::HIA.new(self).to_xml).body.ok?
93
91
  end
94
92
 
95
93
  def INI
96
- respnse = post(url, Epics::INI.new(self).to_xml).body
97
-
98
- respnse.ok?
94
+ post(url, Epics::INI.new(self).to_xml).body.ok?
99
95
  end
100
96
 
101
97
  def HPB
@@ -196,7 +192,7 @@ class Epics::Client
196
192
  end
197
193
 
198
194
  def connection
199
- @connection ||= Faraday.new do |faraday|
195
+ @connection ||= Faraday.new(headers: {user_agent: "EPICS v#{Epics::VERSION}"}) do |faraday|
200
196
  faraday.use Epics::XMLSIG, { client: self }
201
197
  faraday.use Epics::ParseEbics, { client: self}
202
198
  # faraday.response :logger # log requests to STDOUT
@@ -77,10 +77,10 @@ class Epics::GenericUploadRequest < Epics::GenericRequest
77
77
 
78
78
  def pad(d)
79
79
  len = cipher.block_size*((d.size / cipher.block_size)+1)
80
- padded = d.ljust(len, [0].pack("C*"))
81
- padded[-1] = [len - d.size].pack("C*")
82
80
 
83
- padded
81
+ d.ljust(len, [0].pack("C*")).tap do |padded|
82
+ padded[-1] = [len - d.size].pack("C*")
83
+ end
84
84
  end
85
85
 
86
86
  end
data/lib/epics/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Epics
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -25,8 +25,8 @@ RSpec.describe Epics::Client do
25
25
  describe '#inspect' do
26
26
  it 'will not print the complete object' do
27
27
  expect(subject.inspect).to include("@keys=#{subject.keys.keys}")
28
- expect(subject.inspect).to include("@user_id=#{subject.user_id}")
29
- expect(subject.inspect).to include("@partner_id=#{subject.partner_id}")
28
+ expect(subject.inspect).to include("@user_id=\"#{subject.user_id}\"")
29
+ expect(subject.inspect).to include("@partner_id=\"#{subject.partner_id}\"")
30
30
  end
31
31
  end
32
32
 
@@ -5,6 +5,7 @@ RSpec.describe Epics::ParseEbics do
5
5
  builder.adapter :test, Faraday::Adapter::Test::Stubs.new do |stub|
6
6
  stub.post('/business_nok') {[ 200, {}, File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'ebics_business_nok.xml') ) ]}
7
7
  stub.post('/technical_nok') {[ 200, {}, File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'ebics_technical_nok.xml') ) ]}
8
+ stub.post('/ok') {[ 200, {}, File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'hpb_response.xml') ) ]}
8
9
  end
9
10
  builder.use Epics::ParseEbics
10
11
  end
@@ -15,4 +16,8 @@ RSpec.describe Epics::ParseEbics do
15
16
  expect { subject.post("/technical_nok") }.to raise_error(Epics::Error::TechnicalError, "EBICS_AUTHENTICATION_FAILED - Authentication signature error")
16
17
  end
17
18
 
19
+ it "will parsed as Epics::Response" do
20
+ expect(subject.post("/ok").body).to be_kind_of(Epics::Response)
21
+ end
22
+
18
23
  end
metadata CHANGED
@@ -1,161 +1,155 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Brillert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-30 00:00:00.000000000 Z
11
+ date: 2014-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gyoku
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.6.2
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.6.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '10.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ! '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - ! '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - ! '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: equivalent-xml
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - ! '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - ! '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description: |2
140
- Epics is a ruby implementation of the EBIC standard (H004)
141
-
142
- It supports the complete initialization process comprising INI, HIA and HPB
143
- including the INI letter generation.
144
-
145
- Furthermore it offers support for the most common download types:
146
- STA HAA HTD HPD PKT HAC HKD C52 C53
147
-
148
- And the following upload orders:
149
- CD1 CDD CCT
139
+ description: ! " Epics is a ruby implementation of the EBIC standard (H004)\n\n
140
+ \ It supports the complete initialization process comprising INI, HIA and HPB\n
141
+ \ including the INI letter generation.\n\n Furthermore it offers support for
142
+ the most common download types:\n STA HAA HTD HPD PKT HAC HKD C52 C53\n\n And
143
+ the following upload orders:\n CD1 CDD CCT\n"
150
144
  email:
151
145
  - lars@railslove.com
152
146
  executables: []
153
147
  extensions: []
154
148
  extra_rdoc_files: []
155
149
  files:
156
- - ".gitignore"
157
- - ".rspec"
158
- - ".travis.yml"
150
+ - .gitignore
151
+ - .rspec
152
+ - .travis.yml
159
153
  - CHANGELOG.md
160
154
  - CONTRIBUTING.md
161
155
  - Gemfile
@@ -252,7 +246,7 @@ homepage: https://github.com/railslove/epics
252
246
  licenses:
253
247
  - LGPL-3.0
254
248
  metadata: {}
255
- post_install_message: "\n\e[32m************************************************************\n\e[0mThanks
249
+ post_install_message: ! "\n\e[32m************************************************************\n\e[0mThanks
256
250
  for using Epics - your epic EBICS client!\nEpics provides a full production-tested
257
251
  implementation of the Electronic Banking Internet Communication Standard.\nRailslove
258
252
  as the maintainer is commited to provide extensive developer tools to make integrating
@@ -264,17 +258,17 @@ require_paths:
264
258
  - lib
265
259
  required_ruby_version: !ruby/object:Gem::Requirement
266
260
  requirements:
267
- - - ">="
261
+ - - ! '>='
268
262
  - !ruby/object:Gem::Version
269
263
  version: '0'
270
264
  required_rubygems_version: !ruby/object:Gem::Requirement
271
265
  requirements:
272
- - - ">="
266
+ - - ! '>='
273
267
  - !ruby/object:Gem::Version
274
268
  version: '0'
275
269
  requirements: []
276
270
  rubyforge_project:
277
- rubygems_version: 2.2.2
271
+ rubygems_version: 2.0.5
278
272
  signing_key:
279
273
  specification_version: 4
280
274
  summary: a ruby implementation of the EBICS protocol