da_funk 3.34.0 → 3.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3a687d541cc683675f05e5ebcf8d28504a929c97a57606e9af3d5f238f04def
4
- data.tar.gz: f3a1c52920ca5d00f3b43a3d9e513dad9ae883b7167c4b8c37509089bc489af6
3
+ metadata.gz: ca17006779ad6c0d5b9bda06b03b39206539d23769be8e1eae50368dcc341195
4
+ data.tar.gz: 25df4cf6175cf3b04053b16a7a99f8f27e36864bef6afe380a3baf2e1bd9ba79
5
5
  SHA512:
6
- metadata.gz: 7c7d8b462ac97d930628a593a27bc5a7388d3543683f9950db9449d34d22159c68250dc6a8cd2aa24abbed62c5b0ddd09711d0ca0b040924e9337d4f85e1b1e0
7
- data.tar.gz: 40d72d5925bfaf49d65bc54ccbfb2c231d8d2f548fd13f784a8bc1bf1b4c863418251e4a1b773ef44836a01dc3fe53321f5f736e33ae9666fd7783546676eac2
6
+ metadata.gz: c19b050fec970e04fb6d681af3ae11d2eda01c42cde7ee8cc32cab784bda523f2967b4d175f6ceef84e35dc1376a26c7b063b2defac68c3a4711b41e02026331
7
+ data.tar.gz: 161f31d14b80fdaeeebe6120104471295ada25d06ae28940914169188ee01a64dde5b7d5c66c8cc91bcb3caa5332aaab8965056236faff1df28a17796eafd4c4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (3.34.0)
4
+ da_funk (3.34.1)
5
5
  archive-zip (~> 0.5)
6
6
  bundler
7
7
  cloudwalk_handshake
@@ -19,21 +19,21 @@ GEM
19
19
  cloudwalk (1.15.0)
20
20
  bundler
21
21
  rake
22
- cloudwalk_handshake (1.21.3)
22
+ cloudwalk_handshake (2.0.0)
23
23
  funky-simplehttp (~> 0.6)
24
24
  docile (1.3.5)
25
- funky-emv (1.4.1)
26
- funky-tlv (~> 0.2)
25
+ funky-emv (2.0.1)
26
+ funky-tlv (~> 1.0)
27
27
  funky-mock (0.1.0)
28
28
  funky-simplehttp (0.6.0)
29
- funky-tlv (0.2.3)
29
+ funky-tlv (1.0.1)
30
30
  io-like (0.3.1)
31
31
  minitest (5.14.4)
32
32
  parallel (1.19.2)
33
33
  parser (2.7.2.0)
34
34
  ast (~> 2.4.1)
35
- posxml_parser (2.26.0)
36
- funky-emv (~> 1)
35
+ posxml_parser (3.0.1)
36
+ funky-emv (~> 2)
37
37
  rainbow (3.0.0)
38
38
  rake (13.0.1)
39
39
  regexp_parser (1.8.2)
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="3.34.0"
2
+ VERSION="3.34.1"
3
3
  end
4
4
 
data/lib/iso8583/field.rb CHANGED
@@ -39,7 +39,7 @@ module ISO8583
39
39
  begin
40
40
  real_value = codec.decode(raw_value)
41
41
  rescue => e
42
- ContextLog.exception e, e.backtrace if Object.defined?(:ContextLog)
42
+ ContextLog.exception e, e.backtrace if Object.const_defined?(:ContextLog)
43
43
  raise ISO8583ParseException.new(e.message+" (#{name})")
44
44
  end
45
45
 
@@ -90,7 +90,16 @@ module ISO8583
90
90
  # This corrects the length for BCD fields, as their encoded length is half (+ parity) of the
91
91
  # content length. E.g. 123 (length = 3) encodes to "\x01\x23" (length 2)
92
92
  def length
93
- @byte_length
93
+ if @length.respond_to?(:odd?)
94
+ @data_length = @length
95
+ if @data_length.odd?
96
+ @byte_length = (@data_length + 1) / 2
97
+ else
98
+ @byte_length = @data_length / 2
99
+ end
100
+ return @byte_length
101
+ end
102
+ @length
94
103
  end
95
104
 
96
105
  def encode(value)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_funk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.34.0
4
+ version: 3.34.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-28 00:00:00.000000000 Z
11
+ date: 2021-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake