da_funk 1.10.0 → 1.11.0
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 +4 -4
- data/Gemfile.lock +9 -9
- data/RELEASE_NOTES.md +6 -0
- data/lib/da_funk/helper.rb +1 -1
- data/lib/da_funk/version.rb +1 -1
- data/lib/ext/string.rb +1 -1
- data/lib/iso8583/bitmap.rb +22 -2
- data/out/da_funk.mrb +0 -0
- data/test/unit/ext/string_test.rb +4 -0
- 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: f02750035385ab13f575b3238e23e0d6c52c36ea
|
4
|
+
data.tar.gz: 7004539dee0f72e9f42b7d5fb961362287c400ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 639c17f6027557cfc9a9b28a843437dc02da6f27eacb748c3704ed0295d77878712993e79234f888abb11782f49e8b8c4cde7ad8315f1095f98082777a4b19e3
|
7
|
+
data.tar.gz: a0a95c27abefbea7f1a22145e83e0ef8eb72ac7243b416511ee18ee95b3f025ac9060b9677e88065e2a3d734c35e2992753053d1412967fad1b8eb71cfa7dd7f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
da_funk (1.
|
4
|
+
da_funk (1.11.0)
|
5
5
|
archive-zip (~> 0.5)
|
6
6
|
bundler
|
7
7
|
cloudwalk_handshake
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
archive-zip (0.11.0)
|
16
16
|
io-like (~> 0.3.0)
|
17
17
|
ast (2.4.0)
|
18
|
-
cloudwalk (1.
|
18
|
+
cloudwalk (1.9.1)
|
19
19
|
bundler
|
20
20
|
rake
|
21
21
|
cloudwalk_handshake (0.12.0)
|
@@ -25,22 +25,22 @@ GEM
|
|
25
25
|
funky-tlv (0.2.3)
|
26
26
|
io-like (0.3.0)
|
27
27
|
parallel (1.12.1)
|
28
|
-
parser (2.
|
29
|
-
ast (~> 2.
|
30
|
-
posxml_parser (2.3.
|
28
|
+
parser (2.5.1.0)
|
29
|
+
ast (~> 2.4.0)
|
30
|
+
posxml_parser (2.3.3)
|
31
31
|
funky-emv (~> 0.3)
|
32
32
|
powerpack (0.1.1)
|
33
33
|
rainbow (3.0.0)
|
34
|
-
rake (12.3.
|
35
|
-
rubocop (0.
|
34
|
+
rake (12.3.1)
|
35
|
+
rubocop (0.56.0)
|
36
36
|
parallel (~> 1.10)
|
37
|
-
parser (>= 2.
|
37
|
+
parser (>= 2.5)
|
38
38
|
powerpack (~> 0.1)
|
39
39
|
rainbow (>= 2.2.2, < 4.0)
|
40
40
|
ruby-progressbar (~> 1.7)
|
41
41
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
42
42
|
ruby-progressbar (1.9.0)
|
43
|
-
unicode-display_width (1.3.
|
43
|
+
unicode-display_width (1.3.2)
|
44
44
|
yard (0.9.12)
|
45
45
|
|
46
46
|
PLATFORMS
|
data/RELEASE_NOTES.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# DaFunk
|
2
2
|
|
3
|
+
### 1.11.0 - 2018-05-18
|
4
|
+
|
5
|
+
- Bug fix String.integer? when string starts with “0”.
|
6
|
+
- Increase getc timeout to 10 seconds when communication error.
|
7
|
+
- ISO8583 convert bitmap from binary to hex and hex to binary.
|
8
|
+
|
3
9
|
### 1.10.0 - 2018-03-22
|
4
10
|
|
5
11
|
- Change Notification format removing repeated values.
|
data/lib/da_funk/helper.rb
CHANGED
@@ -35,7 +35,7 @@ module DaFunk
|
|
35
35
|
else
|
36
36
|
Device::Setting.network_configured = 0 if DaFunk::ParamsDat.file["connection_management"] == "0"
|
37
37
|
print_attach(:attach_fail, options.merge(:args => [Device::Network.code.to_s]))
|
38
|
-
getc(
|
38
|
+
getc(10000)
|
39
39
|
return false
|
40
40
|
end
|
41
41
|
else
|
data/lib/da_funk/version.rb
CHANGED
data/lib/ext/string.rb
CHANGED
@@ -13,7 +13,7 @@ class String
|
|
13
13
|
def integer?
|
14
14
|
!! Integer(self)
|
15
15
|
rescue ArgumentError => e
|
16
|
-
if e.message[-19..-1] == "too big for integer"
|
16
|
+
if e.message[-19..-1] == "too big for integer" || (self[0] == "0" && !self.match(/[a-zA-Z]/))
|
17
17
|
begin
|
18
18
|
self.to_f
|
19
19
|
return true
|
data/lib/iso8583/bitmap.rb
CHANGED
@@ -59,7 +59,21 @@ module ISO8583
|
|
59
59
|
|
60
60
|
# Generate the bytes representing this bitmap.
|
61
61
|
def to_bytes
|
62
|
-
|
62
|
+
# Convert binary to hex, by slicing the binary in 4 bytes chuncks
|
63
|
+
bitmap_hex = ""
|
64
|
+
str = ""
|
65
|
+
self.to_s.chars.reverse.each_with_index do |ch, i|
|
66
|
+
str << ch
|
67
|
+
next if i == 0
|
68
|
+
if (i+1) % 4 == 0
|
69
|
+
bitmap_hex << str.reverse.to_i(2).to_s(16)
|
70
|
+
str = ""
|
71
|
+
end
|
72
|
+
end
|
73
|
+
unless str.empty?
|
74
|
+
bitmap_hex << str.reverse.to_i(2).to_s(16)
|
75
|
+
end
|
76
|
+
bitmap_hex.reverse.upcase
|
63
77
|
end
|
64
78
|
alias_method :to_b, :to_bytes
|
65
79
|
|
@@ -85,9 +99,15 @@ module ISO8583
|
|
85
99
|
|
86
100
|
private
|
87
101
|
|
102
|
+
def convert_hex_to_binary(str)
|
103
|
+
str.chars.reverse.inject("") do |string, ch|
|
104
|
+
string + ch.to_i(16).to_s(2).rjust(4, "0").reverse
|
105
|
+
end.reverse
|
106
|
+
end
|
107
|
+
|
88
108
|
def initialize_from_message(message)
|
89
109
|
bmp = if hex_bitmap?
|
90
|
-
rjust(message[0..15]
|
110
|
+
rjust(convert_hex_to_binary(message[0..15]), 64, '0')
|
91
111
|
else
|
92
112
|
message.unpack("B64")[0]
|
93
113
|
end
|
data/out/da_funk.mrb
CHANGED
Binary file
|
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: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thiago Scalone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|