da_funk 3.18.1 → 3.20.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: ce9673172b8ee5806e0b9e798fc82ecb6c485f4d17ce42b9da09dd8819078376
4
- data.tar.gz: 8fe7ccbeaa715ac1e3753755c442a346e9f10dc99c43db72eb781691f88a595c
2
+ SHA1:
3
+ metadata.gz: a61984983d2f7c168e0a4e84d60ac44d3060f7be
4
+ data.tar.gz: 490ef400806c5e7329d28426ca95fa4284c3ea02
5
5
  SHA512:
6
- metadata.gz: 22e35877246d833aa5c459061a78cc31528342a3e3c508790d1b5143d722b84dc5f516a600a449196ad931a8e561d0376cd852b0a75a010f286e6d3e77b5fc8c
7
- data.tar.gz: 51f09c79c484aba8fd8d788763195a11c892f025b5857106c60707186e15f1277f6e302f05eca10a971fddd774dc8c25d731877747d9c809d27923a1bc5880df
6
+ metadata.gz: c0f22c650827eec86b2fb87251771d519c1132d6a8b488b76ad940fb2e66491810e7235033cfe1ac0f4191058520b39022546ba789fa1dedd279f0cebb52f7d3
7
+ data.tar.gz: 11da367af36fc688bce9ccc0f7979fc17491b5102d4cd056df675b0e69699e7ff79a817f7f25926aa8ab3e25d58ef7da7b3f63066aedde0de7780e09f0884579
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (3.18.1)
4
+ da_funk (3.20.0)
5
5
  archive-zip (~> 0.5)
6
6
  bundler
7
7
  cloudwalk_handshake
@@ -18,7 +18,7 @@ GEM
18
18
  cloudwalk (1.15.0)
19
19
  bundler
20
20
  rake
21
- cloudwalk_handshake (1.13.0)
21
+ cloudwalk_handshake (1.13.1)
22
22
  funky-simplehttp (~> 0.6)
23
23
  funky-emv (1.2.2)
24
24
  funky-tlv (~> 0.2)
@@ -1,5 +1,10 @@
1
1
  # DaFunk
2
2
 
3
+ ### 3.20.0 - 2020-05-28
4
+
5
+ - Rename PaymentChannel::client to ::current;
6
+ - Fix status bar change link to cache old value.
7
+
3
8
  ### 3.18.1 - 2020-05-20
4
9
 
5
10
  - Fix issue on DaFunk::Helper#menu_image_touchscreen_or_keyboard it was not checking for special keys
@@ -15,7 +15,7 @@ module DaFunk
15
15
  end
16
16
 
17
17
  def attach_options(enable_txt_ui = true)
18
- if DaFunk::PaymentChannel.client == Context::CommunicationChannel
18
+ if DaFunk::PaymentChannel.current == Context::CommunicationChannel
19
19
  {:print_last => true, :enable_txt_ui => enable_txt_ui}
20
20
  else
21
21
  {:print_last => false, :enable_txt_ui => enable_txt_ui}
@@ -58,14 +58,14 @@ module DaFunk
58
58
  end
59
59
 
60
60
  def self.change_link
61
- if Device::Network.connected?
62
- if DaFunk::PaymentChannel.alive?
61
+ info = (!! DaFunk::PaymentChannel.alive?)
62
+ if self.link.nil? || self.link != info
63
+ self.link = info
64
+ if info
63
65
  PAX::Display.print_status_bar(SLOT_LINK, "./shared/link.png")
64
66
  else
65
67
  PAX::Display.print_status_bar(SLOT_LINK, "./shared/unlink.png")
66
68
  end
67
- else
68
- PAX::Display.print_status_bar(SLOT_LINK, "./shared/unlink.png")
69
69
  end
70
70
  end
71
71
 
@@ -3,11 +3,29 @@ module DaFunk
3
3
  DEFAULT_HEARBEAT = "180"
4
4
 
5
5
  class << self
6
- attr_accessor :client, :app
6
+ attr_accessor :current, :app
7
7
  end
8
8
 
9
9
  attr_accessor :handshake_response, :handshake_request, :client, :host, :port
10
10
 
11
+ # Backward compatibility
12
+ def self.client
13
+ self.current
14
+ end
15
+
16
+ # Backward compatibility
17
+ def self.client=(obj)
18
+ self.current = obj
19
+ end
20
+
21
+ def self.current
22
+ @current
23
+ end
24
+
25
+ def self.current=(obj)
26
+ @current = obj
27
+ end
28
+
11
29
  def self.ready?
12
30
  Device::Network.connected? && self.configured?
13
31
  end
@@ -22,8 +40,8 @@ module DaFunk
22
40
  if @app != application
23
41
  @app = application
24
42
  # if Context::CommunicationChannel send application name thought threads
25
- if @client == Context::CommunicationChannel
26
- @client.app = application
43
+ if self.current == Context::CommunicationChannel
44
+ self.current.app = application
27
45
  else
28
46
  Device::System.klass = application
29
47
  end
@@ -48,11 +66,11 @@ module DaFunk
48
66
  self.print_info(I18n.t(:attach_attaching), display_message)
49
67
  create
50
68
  self.print_info(I18n.t(:attach_authenticate), display_message)
51
- @client.handshake
69
+ self.current.handshake
52
70
  else
53
71
  client_clear!
54
72
  end
55
- @client
73
+ self.current
56
74
  end
57
75
 
58
76
  def self.payment_channel_limit?
@@ -84,18 +102,16 @@ module DaFunk
84
102
  if self.dead?
85
103
  unless self.channel_limit_exceed?
86
104
  PaymentChannel.connect(display_message)
87
- if @client
105
+ if self.current
88
106
  self.print_info(I18n.t(:attach_waiting), display_message)
89
- if message = @client.check || @client.handshake?
107
+ if message = self.current.check || self.current.handshake?
90
108
  self.print_info(I18n.t(:attach_connected), display_message)
91
109
  message
92
110
  end
93
111
  end
94
112
  end
95
113
  else
96
- if @client
97
- @client.check
98
- end
114
+ self.current&.check
99
115
  end
100
116
  end
101
117
 
@@ -104,11 +120,11 @@ module DaFunk
104
120
  end
105
121
 
106
122
  def self.alive?
107
- Device::Network.connected? && @client && @client.connected?
123
+ Device::Network.connected? && self.current&.connected?
108
124
  end
109
125
 
110
126
  def self.close!
111
- @client && @client.close
127
+ self.current&.close
112
128
  ensure
113
129
  client_clear!
114
130
  end
@@ -133,16 +149,16 @@ module DaFunk
133
149
  end
134
150
 
135
151
  def self.create
136
- if @client != Context::CommunicationChannel
152
+ if self.current != Context::CommunicationChannel
137
153
  payment_channel_increment_attempts
138
- @client = PaymentChannel.new
154
+ self.current = PaymentChannel.new
139
155
  else
140
- @client.connect
156
+ self.current.connect
141
157
  end
142
158
  end
143
159
 
144
160
  def self.client_clear!
145
- @client = nil unless @client == Context::CommunicationChannel
161
+ self.current = nil unless self.current == Context::CommunicationChannel
146
162
  end
147
163
 
148
164
  def initialize(client = nil)
@@ -180,13 +196,13 @@ module DaFunk
180
196
  end
181
197
 
182
198
  def close
183
- @client.close if @client
199
+ @client&.close
184
200
  @client = nil
185
- PaymentChannel.client = nil
201
+ PaymentChannel.current = nil
186
202
  end
187
203
 
188
204
  def connected?
189
- self.client && self.client.connected?
205
+ self.client&.connected?
190
206
  end
191
207
 
192
208
  def handshake?
@@ -215,7 +231,7 @@ module DaFunk
215
231
  if Context.development?
216
232
  ContextLog.exception(exception, exception.backtrace, "PaymentChannel error")
217
233
  end
218
- PaymentChannel.client = nil
234
+ PaymentChannel.current = nil
219
235
  @client = nil
220
236
  end
221
237
 
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="3.18.1"
2
+ VERSION="3.20.0"
3
3
  end
4
4
 
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.18.1
4
+ version: 3.20.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: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -253,7 +253,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  - !ruby/object:Gem::Version
254
254
  version: '0'
255
255
  requirements: []
256
- rubygems_version: 3.0.6
256
+ rubyforge_project:
257
+ rubygems_version: 2.6.14
257
258
  signing_key:
258
259
  specification_version: 4
259
260
  summary: MRuby Embedded System Framework