da_funk 0.28.0 → 1.0.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: 9c887fe92fba65392534eb8a45739e53b1a7933e
4
- data.tar.gz: b2ef0569959b2c769527b43eedae47a939dc4da1
3
+ metadata.gz: 0ab3d59d322760738472c5869fb98b1871fcdddc
4
+ data.tar.gz: 69bd61eb6d8e6467081cc1b69f05c94ea65f3055
5
5
  SHA512:
6
- metadata.gz: b009cc3a5b57cd7f5268a40ea1f85839499fddf7ad7c3150a13c4e247666328d7dcd2613ffc802705eb0acf5b8341be11c7f3676eb5d66f43e6aa473ba5651b6
7
- data.tar.gz: 2dcd7f1a3b0047dc070e863cc77e36fc7336142d52dd7f3d3e673c52d20fe853fcb6bf6d93a8b4c482c7b9bd7fd4da8aa494005bbcd2d08c614161cfdedff236
6
+ metadata.gz: d6c6d7458d9f343bfec57b017e6f7fee57b876e1b9d49fdb90f61af4b1847794afb168104a52a74dd23895716993e2670c20a8d5b8f48fbfda6ca2dfa1de3f5a
7
+ data.tar.gz: 01ec1bd70cefda9331de4e2b5d2f582f56a9fdf770a3c747f6d6557530442a972eb588fb47aaadf5a513172ebe7716b90e8a9e9fdfe646224578db6060ac74a8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (0.28.0)
4
+ da_funk (1.0.0)
5
5
  archive-zip (~> 0.5)
6
6
  bundler (~> 1.7)
7
7
  cloudwalk_handshake (~> 0.6)
@@ -20,7 +20,7 @@ GEM
20
20
  funky-simplehttp (0.4.4)
21
21
  funky-tlv (0.2.3)
22
22
  io-like (0.3.0)
23
- posxml_parser (0.29.0)
23
+ posxml_parser (0.30.0)
24
24
  funky-emv (~> 0.3)
25
25
  rake (12.3.0)
26
26
  yard (0.9.12)
data/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # DaFunk
2
2
 
3
+
4
+ ### 1.0.0 - 2018-01-04
5
+
6
+ - Remove serfs interface and implement notification
7
+ interface via web socket.
8
+ - Adopt ContextLog to store error on file download.
9
+ - Implement force parameter to application, params dat and file download.
10
+ - Unzip ruby application after download instead of execution call.
11
+ - Move Application, Notification*, ParamsDat and Transaction from Device to Dafunk scope.
12
+ - Remove transaction/emv.rb and refactor loads.
13
+ - Remove Device:Helper.
14
+ - Check if application file exists before return local crc.
15
+ - Adopt custom exception for Application download.
16
+ - Force unzip ruby application if file is the same.
17
+ - Do not cache local crc on DaFunk::Application.
18
+ - Adopt DaDunk::Application CRC check strategy in DaFunk::FileParameter
19
+
3
20
  ### 0.28.0 - 2017-12-07
4
21
 
5
22
  - Support to interrupt file download if KEY CANCEL pressed.
data/Rakefile CHANGED
@@ -9,15 +9,30 @@ DA_FUNK_ROOT = File.dirname(File.expand_path(__FILE__))
9
9
  FileUtils.cd DA_FUNK_ROOT
10
10
 
11
11
  FILES = FileList[
12
+ "lib/file_db.rb",
13
+ "lib/zip.rb",
14
+ "lib/da_funk/helper.rb",
15
+
12
16
  "lib/ext/kernel.rb",
13
17
  "lib/ext/nil.rb",
14
18
  "lib/ext/string.rb",
15
19
  "lib/ext/array.rb",
16
20
  "lib/ext/hash.rb",
17
21
  "lib/ext/float.rb",
22
+
23
+ "lib/iso8583/bitmap.rb",
24
+ "lib/iso8583/codec.rb",
25
+ "lib/iso8583/exception.rb",
26
+ "lib/iso8583/field.rb",
27
+ "lib/iso8583/fields.rb",
28
+ "lib/iso8583/message.rb",
29
+ "lib/iso8583/util.rb",
30
+ "lib/iso8583/version.rb",
31
+ "lib/iso8583/file_parser.rb",
32
+
18
33
  "lib/device/version.rb",
19
34
  "lib/da_funk/version.rb",
20
- "lib/da_funk/helper.rb",
35
+
21
36
  "lib/da_funk.rb",
22
37
  "lib/da_funk/test.rb",
23
38
  "lib/da_funk/screen.rb",
@@ -31,42 +46,26 @@ FILES = FileList[
31
46
  "lib/da_funk/event_handler.rb",
32
47
  "lib/da_funk/engine.rb",
33
48
  "lib/da_funk/struct.rb",
49
+
50
+ "lib/da_funk/params_dat.rb",
51
+ "lib/da_funk/application.rb",
52
+ "lib/da_funk/transaction/iso.rb",
53
+ "lib/da_funk/transaction/download.rb",
54
+ "lib/da_funk/notification_event.rb",
55
+ "lib/da_funk/notification_callback.rb",
56
+ "lib/da_funk/notification.rb",
57
+
34
58
  "lib/device.rb",
35
59
  "lib/device/audio.rb",
36
60
  "lib/device/crypto.rb",
37
61
  "lib/device/display.rb",
38
- "lib/device/helper.rb",
39
62
  "lib/device/io.rb",
40
63
  "lib/device/network.rb",
41
- "lib/device/params_dat.rb",
42
64
  "lib/device/printer.rb",
43
65
  "lib/device/runtime.rb",
44
66
  "lib/device/setting.rb",
45
67
  "lib/device/support.rb",
46
68
  "lib/device/system.rb",
47
- "lib/device/transaction/download.rb",
48
- "lib/device/transaction/emv.rb",
49
- "lib/file_db.rb",
50
- "lib/iso8583/bitmap.rb",
51
- "lib/iso8583/codec.rb",
52
- "lib/iso8583/exception.rb",
53
- "lib/iso8583/field.rb",
54
- "lib/iso8583/fields.rb",
55
- "lib/iso8583/message.rb",
56
- "lib/iso8583/util.rb",
57
- "lib/iso8583/version.rb",
58
- "lib/iso8583/file_parser.rb",
59
- "lib/device/transaction/iso.rb",
60
- "lib/serfx.rb",
61
- "lib/serfx/commands.rb",
62
- "lib/serfx/connection.rb",
63
- "lib/serfx/response.rb",
64
- "lib/serfx/exceptions.rb",
65
- "lib/device/notification_event.rb",
66
- "lib/device/notification_callback.rb",
67
- "lib/device/notification.rb",
68
- "lib/device/application.rb",
69
- "lib/zip.rb",
70
69
  "lib/device/magnetic.rb"
71
70
  ]
72
71
 
@@ -6,10 +6,13 @@
6
6
  # - No crc update
7
7
  # - With crc update
8
8
 
9
- class Device
9
+ module DaFunk
10
10
  class Application
11
- attr_accessor :crc
12
- attr_reader :label, :file, :type, :order, :name, :remote, :original, :crc_local
11
+ class ApplicationError < StandardError; end
12
+ class FileNotFoundError < StandardError; end
13
+
14
+ attr_accessor :crc
15
+ attr_reader :label, :file, :type, :order, :name, :remote, :original
13
16
 
14
17
  def self.delete(collection)
15
18
  collection.each do |app|
@@ -29,25 +32,40 @@ class Device
29
32
  @remote = remote.sub("#{company}_", "")
30
33
  @name = remote.sub("#{company}_", "").split(".")[0]
31
34
  @file = check_path(@remote)
32
- @crc_local = @crc if File.exists?(@file)
35
+ end
36
+
37
+ def crc_local
38
+ self.exists? ? @crc_local : nil
33
39
  end
34
40
 
35
41
  def download(force = false)
36
42
  if force || self.outdated?
37
- ret = Device::Transaction::Download.request_file(remote, file, crc_local)
38
- else
39
- ret = Device::Transaction::Download::FILE_NOT_CHANGE
40
- end
41
- if ret == Device::Transaction::Download::SUCCESS
42
- @crc_local = calculate_crc
43
- if @crc_local != @crc
44
- return Device::Transaction::Download::COMMUNICATION_ERROR
43
+ ret = DaFunk::Transaction::Download.request_file(remote, file, self.crc_local)
44
+ if ret == DaFunk::Transaction::Download::SUCCESS
45
+ if ((@crc_local = calculate_crc) == @crc)
46
+ unzip
47
+ else
48
+ ret = DaFunk::Transaction::Download::COMMUNICATION_ERROR
49
+ end
50
+ elsif ret == DaFunk::Transaction::Download::FILE_NOT_CHANGE
51
+ unzip
45
52
  end
53
+ else
54
+ ret = DaFunk::Transaction::Download::FILE_NOT_CHANGE
46
55
  end
47
56
  ret
48
57
  rescue => e
49
- puts "ERROR #{e.message}"
50
- Device::Transaction::Download::IO_ERROR
58
+ ContextLog.exception(e, e.backtrace, "Error downloading #{self.name}")
59
+ DaFunk::Transaction::Download::IO_ERROR
60
+ end
61
+
62
+ def unzip
63
+ if self.ruby?
64
+ zip = self.file
65
+ message = "Problem to unzip #{zip}[#{name}]"
66
+ raise FileNotFoundError.new(message) unless self.exists?
67
+ raise ApplicationError.new(message) unless Zip.uncompress(zip)
68
+ end
51
69
  end
52
70
 
53
71
  def dir
@@ -55,7 +73,7 @@ class Device
55
73
  end
56
74
 
57
75
  def exists?
58
- File.exists? file
76
+ File.exists?(file)
59
77
  end
60
78
 
61
79
  def delete
@@ -65,10 +83,12 @@ class Device
65
83
  end
66
84
  end
67
85
 
68
- def outdated?
69
- return true unless File.exists?(file)
70
- @crc_local = calculate_crc unless @crc_local
71
- @crc_local != @crc
86
+ def outdated?(force = false)
87
+ return true unless self.exists?
88
+ if !self.crc_local || force
89
+ @crc_local = calculate_crc
90
+ end
91
+ self.crc_local != @crc
72
92
  rescue
73
93
  true
74
94
  end
@@ -2,7 +2,6 @@ module DaFunk
2
2
  class Engine
3
3
  def self.check
4
4
  DaFunk::EventListener.check
5
- Device::Notification.check
6
5
  DaFunk::Helper::StatusBar.check
7
6
  end
8
7
 
@@ -2,7 +2,7 @@ module DaFunk
2
2
  class FileParameter
3
3
  FILEPATH = "./shared"
4
4
  attr_accessor :crc
5
- attr_reader :name, :file, :crc_local, :original, :remote
5
+ attr_reader :name, :file, :original, :remote
6
6
 
7
7
  def self.delete(collection)
8
8
  collection.each do |file_|
@@ -20,7 +20,10 @@ module DaFunk
20
20
  @remote = @original.sub("#{company}_", "")
21
21
  @name = @original.sub("#{company}_", "").split(".").first
22
22
  @file = "#{FILEPATH}/#{@remote}"
23
- @crc_local = @crc if File.exists?(@file)
23
+ end
24
+
25
+ def crc_local
26
+ self.exists? ? @crc_local : nil
24
27
  end
25
28
 
26
29
  def zip?
@@ -38,31 +41,46 @@ module DaFunk
38
41
  end
39
42
 
40
43
  def download(force = false)
41
- if force || outdated?
42
- ret = Device::Transaction::Download.request_file(remote, file, crc_local)
44
+ if force || self.outdated?
45
+ ret = DaFunk::Transaction::Download.request_file(remote, file, self.crc_local)
46
+ if ret == DaFunk::Transaction::Download::SUCCESS
47
+ unless ((@crc_local = calculate_crc) == @crc)
48
+ ret = DaFunk::Transaction::Download::COMMUNICATION_ERROR
49
+ end
50
+ end
43
51
  else
44
- ret = Device::Transaction::Download::FILE_NOT_CHANGE
52
+ ret = DaFunk::Transaction::Download::FILE_NOT_CHANGE
45
53
  end
46
- @crc_local = @crc if ret == Device::Transaction::Download::SUCCESS
47
54
  ret
55
+ rescue => e
56
+ ContextLog.exception(e, e.backtrace, "Error downloading #{self.name}")
57
+ DaFunk::Transaction::Download::IO_ERROR
48
58
  end
49
59
 
50
60
  def delete
51
61
  File.delete(self.file) if exists?
52
62
  end
53
63
 
54
- def outdated?
55
- return true unless exists?
56
- unless @crc_local
64
+ def outdated?(force = false)
65
+ return true unless self.exists?
66
+ if !self.crc_local || force
67
+ @crc_local = calculate_crc
68
+ end
69
+ self.crc_local != @crc
70
+ rescue
71
+ true
72
+ end
73
+
74
+ private
75
+ def calculate_crc
76
+ if exists?
57
77
  handle = File.open(file)
58
- @crc_local = Device::Crypto.crc16_hex(handle.read)
78
+ Device::Crypto.crc16_hex(handle.read)
59
79
  end
60
- @crc_local != @crc
61
80
  ensure
62
81
  handle.close if handle
63
82
  end
64
83
 
65
- private
66
84
  def check_company(name)
67
85
  name.split("_", 2)[0]
68
86
  end
@@ -33,7 +33,7 @@ module DaFunk
33
33
  Device::Setting.network_configured = 1
34
34
  print_attach(:attach_connected, options)
35
35
  else
36
- Device::Setting.network_configured = 0 if Device::ParamsDat.file["connection_management"] == "0"
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
38
  getc(4000)
39
39
  return false
@@ -52,23 +52,23 @@ module DaFunk
52
52
  def check_download_error(ret)
53
53
  value = true
54
54
  case ret
55
- when Device::Transaction::Download::SERIAL_NUMBER_NOT_FOUND
55
+ when DaFunk::Transaction::Download::SERIAL_NUMBER_NOT_FOUND
56
56
  I18n.pt(:download_serial_number_not_found, :args => [ret])
57
57
  value = false
58
- when Device::Transaction::Download::FILE_NOT_FOUND
58
+ when DaFunk::Transaction::Download::FILE_NOT_FOUND
59
59
  I18n.pt(:download_file_not_found, :args => [ret])
60
60
  value = false
61
- when Device::Transaction::Download::FILE_NOT_CHANGE
61
+ when DaFunk::Transaction::Download::FILE_NOT_CHANGE
62
62
  I18n.pt(:download_file_is_the_same, :args => [ret])
63
- when Device::Transaction::Download::SUCCESS
63
+ when DaFunk::Transaction::Download::SUCCESS
64
64
  I18n.pt(:download_success, :args => [ret])
65
- when Device::Transaction::Download::COMMUNICATION_ERROR
65
+ when DaFunk::Transaction::Download::COMMUNICATION_ERROR
66
66
  I18n.pt(:download_communication_failure, :args => [ret])
67
67
  value = false
68
- when Device::Transaction::Download::MAPREDUCE_RESPONSE_ERROR
68
+ when DaFunk::Transaction::Download::MAPREDUCE_RESPONSE_ERROR
69
69
  I18n.pt(:download_encoding_error, :args => [ret])
70
70
  value = false
71
- when Device::Transaction::Download::IO_ERROR
71
+ when DaFunk::Transaction::Download::IO_ERROR
72
72
  I18n.pt(:download_io_error, :args => [ret])
73
73
  value = false
74
74
  else
@@ -0,0 +1,38 @@
1
+
2
+ module DaFunk
3
+ class Notification
4
+ class << self
5
+ attr_accessor :callbacks
6
+ end
7
+
8
+ self.callbacks = Hash.new
9
+
10
+ def self.check(msg)
11
+ if msg.is_a?(String) && msg.include?("\"event\"") && msg.include?("\"id\"")
12
+ [:notification, self.parse(JSON.parse(msg))]
13
+ end
14
+ rescue ArgumentError => e
15
+ raise unless e.message == "invalid json"
16
+ end
17
+
18
+ def self.parse(hash)
19
+ NotificationEvent.new(hash["id"], hash["event"], hash["acronym"], hash["logical_number"])
20
+ end
21
+
22
+ def self.execute(event)
23
+ calls = self.callbacks[event.callback]
24
+ return unless calls
25
+ [:before, :on, :after].each do |moment|
26
+ calls.each do |callback|
27
+ callback.call(event, moment)
28
+ end
29
+ end
30
+ end
31
+
32
+ def self.schedule(callback)
33
+ self.callbacks[callback.description] ||= []
34
+ self.callbacks[callback.description] << callback
35
+ end
36
+ end
37
+ end
38
+
@@ -1,4 +1,4 @@
1
- class Device
1
+ module DaFunk
2
2
  class NotificationCallback
3
3
  attr_reader :on, :before, :after, :description
4
4
  attr_accessor :results
@@ -0,0 +1,27 @@
1
+ module DaFunk
2
+ class NotificationEvent
3
+ attr_reader :id, :event, :acronym, :logical_number, :parameters, :callback
4
+
5
+ def perform
6
+ Notification.execute(self)
7
+ end
8
+
9
+ def initialize(id, event, acronym, logical_number)
10
+ @id = id
11
+ @acronym = acronym
12
+ @logical_number = logical_number
13
+ parse(event)
14
+ end
15
+
16
+ private
17
+
18
+ #{"id":3,"event":"3|SHOW_MESSAGE|TEST1|12-20-2017 18:23","acronym":"pc1","logical_number":"5A179615"}
19
+ #"3|SHOW_MESSAGE|TEST1|12-20-2017 18:23"
20
+ def parse(event)
21
+ values = event.to_s.split("|")
22
+ values.shift # id
23
+ @callback, *@parameters = values
24
+ end
25
+ end
26
+ end
27
+
@@ -1,8 +1,8 @@
1
- class Device
1
+ module DaFunk
2
2
  class ParamsDat
3
3
  FILE_NAME = "./main/params.dat"
4
4
 
5
- include Device::Helper
5
+ include DaFunk::Helper
6
6
 
7
7
  class << self
8
8
  attr_accessor :file, :apps, :valid, :files
@@ -34,12 +34,12 @@ class Device
34
34
  true
35
35
  end
36
36
 
37
- def self.outdated_apps
38
- self.apps.select{|app| app.outdated? }
37
+ def self.outdated_apps(force_crc = false, force = false)
38
+ self.apps.select{|app| app.outdated?(force_crc) || force }
39
39
  end
40
40
 
41
- def self.outdated_files
42
- self.files.select{|f| f.outdated? }
41
+ def self.outdated_files(force_crc = false, force = false)
42
+ self.files.select{|f| f.outdated?(force_crc) || force }
43
43
  end
44
44
 
45
45
  def self.parse_apps
@@ -49,11 +49,11 @@ class Device
49
49
  if application = get_app(name)
50
50
  application.crc = crc
51
51
  else
52
- application = Device::Application.new(label, name, type, crc)
52
+ application = DaFunk::Application.new(label, name, type, crc)
53
53
  end
54
54
  new_apps << application
55
55
  end
56
- Device::Application.delete(@apps - new_apps)
56
+ DaFunk::Application.delete(@apps - new_apps)
57
57
  @apps = new_apps
58
58
  end
59
59
 
@@ -68,7 +68,7 @@ class Device
68
68
  end
69
69
  new_files << file_
70
70
  end
71
- Device::Application.delete(@files - new_files)
71
+ DaFunk::Application.delete(@files - new_files)
72
72
  @files = new_files
73
73
  end
74
74
 
@@ -108,7 +108,7 @@ class Device
108
108
  ret = try(3) do |attempt|
109
109
  Device::Display.clear
110
110
  I18n.pt(:downloading_content, :args => ["PARAMS", 1, 1])
111
- ret = Device::Transaction::Download.request_param_file(FILE_NAME)
111
+ ret = DaFunk::Transaction::Download.request_param_file(FILE_NAME)
112
112
  unless check_download_error(ret)
113
113
  sleep(2)
114
114
  false
@@ -121,25 +121,25 @@ class Device
121
121
  end
122
122
  end
123
123
 
124
- def self.update_apps(force = false)
125
- self.download if force || ! self.valid
124
+ def self.update_apps(force_params = false, force_crc = false, force = false)
125
+ self.download if force_params || ! self.valid
126
126
  if self.valid
127
- apps_to_update = self.outdated_apps
127
+ apps_to_update = self.outdated_apps(force_crc, force)
128
128
  size_apps = apps_to_update.size
129
129
  apps_to_update.each_with_index do |app, index|
130
- self.update_app(app, index+1, size_apps)
130
+ self.update_app(app, index+1, size_apps, force_crc || force)
131
131
  end
132
132
 
133
- files_to_update = self.outdated_files
133
+ files_to_update = self.outdated_files(force_crc, force)
134
134
  size_files = files_to_update.size
135
135
  files_to_update.each_with_index do |file_, index|
136
- self.update_file(file_, index+1, size_files)
136
+ self.update_file(file_, index+1, size_files, force_crc || force)
137
137
  end
138
138
  end
139
139
  end
140
140
 
141
141
  def self.format!(keep_config_files = false, keep_files = [])
142
- Device::Application.delete(self.apps)
142
+ DaFunk::Application.delete(self.apps)
143
143
  DaFunk::FileParameter.delete(self.files)
144
144
  File.delete(FILE_NAME) if exists?
145
145
  @apps, @files = [], []
@@ -1,5 +1,5 @@
1
1
 
2
- class Device
2
+ module DaFunk
3
3
  class Transaction
4
4
  class Download
5
5
  ERL_VERSION_MAGIC = 131
@@ -36,7 +36,7 @@ class Device
36
36
  end
37
37
 
38
38
  def self.request_file(remote_path, local_path, crc = nil)
39
- download = Device::Transaction::Download.new(Device::System.serial, "", DaFunk::VERSION)
39
+ download = DaFunk::Transaction::Download.new(Device::System.serial, "", DaFunk::VERSION)
40
40
  download.perform(Device::Network.socket,
41
41
  Device::Setting.company_name,
42
42
  remote_path, local_path, Device::System.app,
@@ -1,5 +1,5 @@
1
1
 
2
- class Device
2
+ module DaFunk
3
3
  class Transaction
4
4
  # Object responsible to create ISO8583 message
5
5
  #
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="0.28.0"
2
+ VERSION="1.0.0"
3
3
  end
4
4
 
data/lib/da_funk.rb CHANGED
@@ -1,35 +1,50 @@
1
1
  unless Object.const_defined?(:MTest)
2
2
  file_path = File.dirname(File.realpath(__FILE__))
3
- require file_path + "/da_funk/version.rb"
3
+ require file_path + "/file_db.rb"
4
4
  require file_path + "/da_funk/helper.rb"
5
- require file_path + "/da_funk/iso8583.rb"
6
5
  require file_path + "/da_funk/rake_task.rb"
6
+ require file_path + "/iso8583/bitmap.rb"
7
+ require file_path + "/iso8583/codec.rb"
8
+ require file_path + "/iso8583/exception.rb"
9
+ require file_path + "/iso8583/field.rb"
10
+ require file_path + "/iso8583/fields.rb"
11
+ require file_path + "/iso8583/message.rb"
12
+ require file_path + "/iso8583/util.rb"
13
+ require file_path + "/iso8583/version.rb"
14
+ require file_path + "/iso8583/file_parser.rb"
15
+ require file_path + "/device/version.rb"
16
+ require file_path + "/da_funk/version.rb"
7
17
  require file_path + "/da_funk/test.rb"
8
18
  require file_path + "/da_funk/screen.rb"
9
- require file_path + "/device/support.rb"
10
- require file_path + "/device/helper.rb"
19
+ require file_path + "/da_funk/callback_flow.rb"
20
+ require file_path + "/da_funk/screen_flow.rb"
21
+ require file_path + "/da_funk/i18n_error.rb"
22
+ require file_path + "/da_funk/i18n.rb"
23
+ require file_path + "/da_funk/file_parameter.rb"
24
+ require file_path + "/da_funk/helper/status_bar.rb"
25
+ require file_path + "/da_funk/event_listener.rb"
26
+ require file_path + "/da_funk/event_handler.rb"
27
+ require file_path + "/da_funk/engine.rb"
28
+ require file_path + "/da_funk/struct.rb"
29
+ require file_path + "/da_funk/application.rb"
30
+ require file_path + "/da_funk/transaction/iso.rb"
31
+ require file_path + "/da_funk/transaction/download.rb"
32
+ require file_path + "/da_funk/notification_event.rb"
33
+ require file_path + "/da_funk/notification_callback.rb"
34
+ require file_path + "/da_funk/notification.rb"
35
+ require file_path + "/da_funk/params_dat.rb"
36
+ require file_path + "/device.rb"
37
+ require file_path + "/device/audio.rb"
11
38
  require file_path + "/device/crypto.rb"
12
39
  require file_path + "/device/display.rb"
13
40
  require file_path + "/device/io.rb"
14
41
  require file_path + "/device/network.rb"
15
42
  require file_path + "/device/printer.rb"
43
+ require file_path + "/device/runtime.rb"
16
44
  require file_path + "/device/setting.rb"
45
+ require file_path + "/device/support.rb"
17
46
  require file_path + "/device/system.rb"
18
- require file_path + "/device/version.rb"
19
- require file_path + "/device/params_dat.rb"
20
- require file_path + "/device.rb"
21
- require file_path + "/file_db.rb"
22
- require file_path + "/iso8583/bitmap.rb"
23
- require file_path + "/iso8583/codec.rb"
24
- require file_path + "/iso8583/exception.rb"
25
- require file_path + "/iso8583/field.rb"
26
- require file_path + "/iso8583/fields.rb"
27
- require file_path + "/iso8583/message.rb"
28
- require file_path + "/iso8583/util.rb"
29
- require file_path + "/iso8583/version.rb"
30
- require file_path + "/device/transaction/download.rb"
31
- require file_path + "/device/transaction/emv.rb"
32
- require file_path + "/device/transaction/iso.rb"
47
+ require file_path + "/device/magnetic.rb"
33
48
  end
34
49
 
35
50
  module DaFunk
data/lib/device/io.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  class Device
2
2
  class IO < ::IO
3
- include Device::Helper
3
+ include DaFunk::Helper
4
4
 
5
5
  F1 = "\001"
6
6
  F2 = "\002"
@@ -12,12 +12,6 @@ class Device
12
12
  # @param json [String] Parameters to confifure new aplication.
13
13
  # @return [Object] From the new runtime instance.
14
14
  def self.execute(app, json = nil)
15
- unless app.include?(".")
16
- zip = "./#{app}.zip"
17
- Device::Display.clear
18
- raise File::FileError, zip unless File.exists?(zip)
19
- raise "Problem to unzip #{zip}" unless Zip.uncompress(zip, app)
20
- end
21
15
  execution_ret = mrb_eval("Context.start('#{app}', '#{Device.adapter}', '#{json}')")
22
16
  self.system_reaload
23
17
  return execution_ret
@@ -27,7 +21,7 @@ class Device
27
21
  # @return [NilClass] From the new runtime instance.
28
22
  def self.system_reaload
29
23
  Device::Setting.setup
30
- Device::ParamsDat.setup
24
+ DaFunk::ParamsDat.setup
31
25
  Device::Network.setup
32
26
  nil
33
27
  end