da_funk 2.0.4 → 2.1.0

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: f2ceffabe33ecdf275fec70ec8f2f273ce17e261
4
- data.tar.gz: 0bfc156fd6b942bfa5a738fb7633ceecbcac175e
3
+ metadata.gz: 1513318e49d6bd65c13723ac662a46ef5aa77425
4
+ data.tar.gz: 529f9daf2a680215999853d40a4651889b2b69e7
5
5
  SHA512:
6
- metadata.gz: 5b237c4bcac1faac87599a43307f0a312d73e6307f2133045ba2645474d85c8d5cc31f5837413b9fe447754cb0440ee88293246e466c5f61386e1efcc8ff9bda
7
- data.tar.gz: 7471562468f8bbc64201a98a123976132e960273cc9aa62a3f38a97e7b05f70a813f386bbd4312e45345ff93d241d81ac419ae7349fe984622a26a8499a4392a
6
+ metadata.gz: 2094ae70b7af31ca02cd140264cd01ba0f5358328d6d13de936c088f1703f3cfd206082ff88e2715cd0b248731d175f6add180e55f11abf4ca3491e47b464c22
7
+ data.tar.gz: c48de75552ee064bc58fb2a3549b2d5a736166109405c7307fdb2b108ec93467ad51fece55141ef5f5b62f108789ee74d79afc22da372c152683e827c38211fe
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (2.0.4)
4
+ da_funk (2.1.0)
5
5
  archive-zip (~> 0.5)
6
6
  bundler
7
7
  cloudwalk_handshake
@@ -26,21 +26,21 @@ GEM
26
26
  io-like (0.3.0)
27
27
  jaro_winkler (1.5.1)
28
28
  parallel (1.12.1)
29
- parser (2.5.1.2)
29
+ parser (2.5.3.0)
30
30
  ast (~> 2.4.0)
31
- posxml_parser (2.8.5)
31
+ posxml_parser (2.8.6)
32
32
  funky-emv (~> 0.3)
33
33
  powerpack (0.1.2)
34
34
  rainbow (3.0.0)
35
35
  rake (12.3.1)
36
- rubocop (0.59.2)
36
+ rubocop (0.60.0)
37
37
  jaro_winkler (~> 1.5.1)
38
38
  parallel (~> 1.10)
39
39
  parser (>= 2.5, != 2.5.1.1)
40
40
  powerpack (~> 0.1)
41
41
  rainbow (>= 2.2.2, < 4.0)
42
42
  ruby-progressbar (~> 1.7)
43
- unicode-display_width (~> 1.0, >= 1.0.1)
43
+ unicode-display_width (~> 1.4.0)
44
44
  ruby-progressbar (1.10.0)
45
45
  unicode-display_width (1.4.0)
46
46
  yard (0.9.16)
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2018 CloudWalk
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -48,28 +48,8 @@ Please follow the instructions:
48
48
 
49
49
  ## License
50
50
 
51
- ```
52
- The MIT License (MIT)
53
-
54
- Copyright (c) 2016 CloudWalk, Inc.
55
-
56
- Permission is hereby granted, free of charge, to any person obtaining a copy
57
- of this software and associated documentation files (the "Software"), to deal
58
- in the Software without restriction, including without limitation the rights
59
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60
- copies of the Software, and to permit persons to whom the Software is
61
- furnished to do so, subject to the following conditions:
62
- ###
63
- The above copyright notice and this permission notice shall be included in all
64
- copies or substantial portions of the Software.
65
-
66
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72
- SOFTWARE.
73
- ```
51
+ This project is released under the [MIT License](https://opensource.org/licenses/MIT).
52
+
53
+ ---
74
54
 
75
55
  ![DaFunk](https://raw.githubusercontent.com/cloudwalkio/da_funk/master/imgs/daft-punk-da-funk.jpg)
data/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # DaFunk
2
2
 
3
+ ### 2.1.0 - 2018-11-28
4
+
5
+ - Support to thread pausing during Network.attach;
6
+ - Ensure clear on PaymentChannel::close!.
7
+
3
8
  ### 2.0.4 - 2018-10-11
4
9
 
5
10
  - Do not print last if not in communication thread;
@@ -82,7 +82,9 @@ module DaFunk
82
82
  end
83
83
 
84
84
  def self.close!
85
- @client && @client.close && client_clear!
85
+ @client && @client.close
86
+ ensure
87
+ client_clear!
86
88
  end
87
89
 
88
90
  def self.print_info(message, display = true)
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="2.0.4"
2
+ VERSION="2.1.0"
3
3
  end
4
4
 
@@ -159,24 +159,26 @@ class Device
159
159
  def self.attach(options = nil)
160
160
  Device::Network.connected?
161
161
  if self.code != SUCCESS
162
- self.code = Device::Network.init(*self.config)
163
- self.code = Device::Network.connect
164
- Device::Network.connected? if self.code != SUCCESS
165
-
166
- hash = try_user(self.attach_timeout, options) do |process|
167
- Device::Network.connected?
168
- process[:ret] = self.code
169
- # TODO develop an interface to keep waiting communication module dial
170
- # based on platform returns
171
- process[:ret] == PROCESSING || process[:ret] == 2 || process[:ret] == -3307 # if true keep trying
172
- end
173
- self.code = hash[:ret]
174
-
175
- if self.code == SUCCESS
176
- self.code = Device::Network.dhcp_client(20000) if (wifi? || ethernet?)
177
- else
178
- self.code = ERR_USER_CANCEL if hash[:key] == Device::IO::CANCEL
179
- Device::Network.shutdown
162
+ ThreadScheduler.pausing_communication do
163
+ self.code = Device::Network.init(*self.config)
164
+ self.code = Device::Network.connect
165
+ Device::Network.connected? if self.code != SUCCESS
166
+
167
+ hash = try_user(self.attach_timeout, options) do |process|
168
+ Device::Network.connected?
169
+ process[:ret] = self.code
170
+ # TODO develop an interface to keep waiting communication module dial
171
+ # based on platform returns
172
+ process[:ret] == PROCESSING || process[:ret] == 2 || process[:ret] == -3307 # if true keep trying
173
+ end
174
+ self.code = hash[:ret]
175
+
176
+ if self.code == SUCCESS
177
+ self.code = Device::Network.dhcp_client(20000) if (wifi? || ethernet?)
178
+ else
179
+ self.code = ERR_USER_CANCEL if hash[:key] == Device::IO::CANCEL
180
+ Device::Network.shutdown
181
+ end
180
182
  end
181
183
  end
182
184
  self.code
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: 2.0.4
4
+ version: 2.1.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-10-11 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -135,6 +135,7 @@ files:
135
135
  - ".yardopts"
136
136
  - Gemfile
137
137
  - Gemfile.lock
138
+ - MIT-LICENSE
138
139
  - README.md
139
140
  - README_GUIDE.md
140
141
  - RELEASE_NOTES.md