da_funk 3.8.3 → 3.9.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
2
  SHA1:
3
- metadata.gz: '017963ffdd6d81e37fa359cb6fb4733c11143e36'
4
- data.tar.gz: 1e796162f351d4f88b71e8a391c6fa957e9a315c
3
+ metadata.gz: 6c320eb9211f0fc06dcb381ba75d7fcdaba89d7e
4
+ data.tar.gz: ff34f839f0afc322b862906febd45e129794eaee
5
5
  SHA512:
6
- metadata.gz: 874bb8bd1b0c3c263ba12b03929750d5c0082f9161c6d59fbf11485bc72e49aaf1dd3b12440d24d759bf91641bdc381098d7c8879ec060b3ca71533b7048f6d7
7
- data.tar.gz: ff935fcacbb0de1595c84f1fc368b4d7b15b33f7beaf06e4c76089fa232575d770490a21bcb37fab06707018efb1482c33f3f923959d5b62d078f369ce9441cf
6
+ metadata.gz: 6b1bc034f2987486057a0f8b0d6bcabe7c9edc19037b38d6cd8a62c120be151a971d1fed1539845c91258455b30a270b6f94e00920913a9569094c40b6390478
7
+ data.tar.gz: 537f48540589a3dd0f3a8d86a2af52def6fc603e6974a794e6403b4e4446f14d41abd9981e910c6b48313f268224ad3f35b4649edbd51b800a788b1655fd161f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (3.8.3)
4
+ da_funk (3.9.0)
5
5
  archive-zip (~> 0.5)
6
6
  bundler
7
7
  cloudwalk_handshake
@@ -20,7 +20,7 @@ GEM
20
20
  rake
21
21
  cloudwalk_handshake (1.4.2)
22
22
  funky-simplehttp (~> 0.6)
23
- funky-emv (1.0.0)
23
+ funky-emv (1.1.0)
24
24
  funky-tlv (~> 0.2)
25
25
  funky-simplehttp (0.6.0)
26
26
  funky-tlv (0.2.3)
data/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # DaFunk
2
2
 
3
+ ### 3.9.0 - 2019-06-18
4
+
5
+ - Support to uncompress main application and reboot after it.
6
+
3
7
  ### 3.8.3 - 2019-06-18
4
8
 
5
9
  - Added emv_input_amount_idle parameter on config.dat.
@@ -1,11 +1,3 @@
1
- # Scenario
2
- # 1. Load from scratch
3
- # - No file downloaded
4
- # - with file downloaded
5
- # 2. Second load
6
- # - No crc update
7
- # - With crc update
8
-
9
1
  module DaFunk
10
2
  class Application
11
3
  class ApplicationError < StandardError; end
@@ -66,7 +58,11 @@ module DaFunk
66
58
  zip = self.file
67
59
  message = "Problem to unzip #{zip}[#{name}]"
68
60
  raise FileNotFoundError.new(message) unless self.exists?
69
- raise ApplicationError.new(message) unless Zip.uncompress(zip)
61
+ if main_application?
62
+ raise ApplicationError.new(message) unless Zip.uncompress(zip, './main', true, false)
63
+ else
64
+ raise ApplicationError.new(message) unless Zip.uncompress(zip)
65
+ end
70
66
  end
71
67
  end
72
68
 
@@ -95,6 +91,10 @@ module DaFunk
95
91
  true
96
92
  end
97
93
 
94
+ def main_application?
95
+ main == 'main'
96
+ end
97
+
98
98
  def execute(json = "")
99
99
  if posxml?
100
100
  PosxmlInterpreter.new(remote, nil, false).start
@@ -126,11 +126,13 @@ module DaFunk
126
126
 
127
127
  def self.update_apps(force_params = false, force_crc = false, force = false)
128
128
  self.download if force_params || ! self.valid
129
+ main_updated = nil
129
130
  if self.valid
130
131
  apps_to_update = self.outdated_apps(force_crc, force)
131
132
  size_apps = apps_to_update.size
132
133
  apps_to_update.each_with_index do |app, index|
133
- self.update_app(app, index+1, size_apps, force_crc || force)
134
+ ret = self.update_app(app, index+1, size_apps, force_crc || force)
135
+ main_updated ||= (ret && app.main_application?)
134
136
  end
135
137
 
136
138
  files_to_update = self.outdated_files(force_crc, force)
@@ -139,6 +141,18 @@ module DaFunk
139
141
  self.update_file(file_, index+1, size_files, force_crc || force)
140
142
  end
141
143
  end
144
+ ensure
145
+ self.restart if main_updated
146
+ end
147
+
148
+ def self.restart
149
+ Device::Display.clear
150
+ I18n.pt(:admin_main_update_message)
151
+ 3.times do |i|
152
+ Device::Display.print("REBOOTING IN #{3 - i}",3,3)
153
+ sleep(1)
154
+ end
155
+ Device::System.restart
142
156
  end
143
157
 
144
158
  def self.format!(keep_config_files = false, keep_files = [])
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="3.8.3"
2
+ VERSION="3.9.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.8.3
4
+ version: 3.9.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: 2019-06-18 00:00:00.000000000 Z
11
+ date: 2019-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake