da_funk 0.9.2 → 0.10.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: 3ffa40cacb07a44394edc805f71b8be32438bfc9
4
- data.tar.gz: b2f646de25afc556455cf85aea448804f1d95af1
3
+ metadata.gz: cac9eaa1c8293c824dc91c04166369d5193c6a49
4
+ data.tar.gz: 6f9e674d7df2ba845dad9dd5986eed8fed909b44
5
5
  SHA512:
6
- metadata.gz: d158b9803baae2030ee1baeedaa0e41e178bfbd4b6b7550937d22d0755ba729da963def38dec968470d46b5b0259b401cd880561650bf7b0103f22751abd4a4e
7
- data.tar.gz: 7886ea442d36228ad0299f99069177c9583f3be60ebe20c78a70e45d2aa7f57f4f7e68a098e1f036cec6b0c85509303d2479ca52ba08ac9c655863313e46f4ba
6
+ metadata.gz: 170792355ecfa1e8c69aee38f97876825fc8949333eeb0af2bbfff03ad083e5764c6d6c16b06804b944f3be9adaac09d34d661432ab0865aa01dc63fa75af5e1
7
+ data.tar.gz: b835ea2af97763b0be5bb393addc979bdc9efda93b83f018f91ce25afdc19e2fbb02a32f1ab61d77b271936c35a26471745d99e794b28daffb872df346085ea2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (0.9.2)
4
+ da_funk (0.10.0)
5
5
  bundler (~> 1.7)
6
6
  cloudwalk_handshake (~> 0.6)
7
7
  funky-emv (~> 0.3)
@@ -11,12 +11,12 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- cloudwalk_handshake (0.8.0)
15
- funky-emv (0.6.0)
14
+ cloudwalk_handshake (0.9.0)
15
+ funky-emv (0.7.0)
16
16
  funky-tlv (~> 0.2)
17
17
  funky-simplehttp (0.4.4)
18
18
  funky-tlv (0.2.3)
19
- posxml_parser (0.15.2)
19
+ posxml_parser (0.16.0)
20
20
  funky-emv (~> 0.3)
21
21
  rake (10.5.0)
22
22
  yard (0.9.9)
data/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # DaFunk
2
2
 
3
+ ### 0.10.0 - 2017-08-08
4
+
5
+ - Define pt-br as default locale.
6
+ - Implement Kernel#print_last.
7
+ - Adopt print_last for Herlper#attach.
8
+ - Implement Device::Network.shutdown, what call disconnect and power(0).
9
+ - Update cloudwalk_handshake (0.9.0), funky-emv (0.9.0) and posxml_parser(0.16.0).
10
+
3
11
  ### 0.9.2 - 2017-07-25
4
12
 
5
13
  - Refactoring Network.configured? fixing the return which must be a bool.
@@ -15,25 +15,24 @@ module DaFunk
15
15
  end
16
16
 
17
17
  def attach
18
- Device::Display.clear
19
18
  if Device::Network.configured?
20
- I18n.pt(:attach_connecting)
19
+ print_last(I18n.t(:attach_connecting))
21
20
  unless Device::Network.connected?
22
21
  if Device::Network.attach == Device::Network::SUCCESS
23
22
  Device::Setting.network_configured = 1
24
- I18n.pt(:attach_connected)
23
+ print_last(I18n.t(:attach_connected))
25
24
  else
26
- Device::Setting.network_configured = 0
27
- I18n.pt(:attach_fail, :args => [Device::Network.code.to_s])
25
+ Device::Setting.network_configured = 0 if Device::ParamsDat.file["connection_managment"] != "1"
26
+ print_last(I18n.t(:attach_fail, :args => [Device::Network.code.to_s]))
28
27
  getc(4000)
29
28
  return false
30
29
  end
31
30
  else
32
- I18n.pt(:attach_already_connected)
31
+ print_last(I18n.t(:attach_already_connected))
33
32
  end
34
33
  true
35
34
  else
36
- I18n.pt(:attach_device_not_configured)
35
+ print_last(I18n.t(:attach_device_not_configured))
37
36
  getc(2000)
38
37
  false
39
38
  end
data/lib/da_funk/i18n.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  class I18n
2
2
  include DaFunk::Helper
3
3
 
4
- DEFAULT_LOCALE = "en"
4
+ DEFAULT_LOCALE = "pt-br"
5
5
  DEFAULT_APPLICATION = "main"
6
6
 
7
7
  class << self
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="0.9.2"
2
+ VERSION="0.10.0"
3
3
  end
4
4
 
@@ -171,6 +171,13 @@ class Device
171
171
  self.code
172
172
  end
173
173
 
174
+ def self.shutdown
175
+ if self.adapter.started?
176
+ Device::Network.disconnect
177
+ Device::Network.power(0)
178
+ end
179
+ end
180
+
174
181
  def self.config
175
182
  # TODO raise some error if media was not set
176
183
  [Device::Setting.media, self.config_media]
@@ -50,7 +50,7 @@ class Device
50
50
  "iso8583_send_tries" => "0", #COMM
51
51
  "crypto_dukpt_slot" => "", #SYS
52
52
  "ctls" => "", #SYS
53
- "locale" => "en", #SYS
53
+ "locale" => "pt-br", #SYS
54
54
  "heartbeat" => "", #SYS
55
55
  "boot" => "1", #SYS
56
56
  "company_name" => "" #SYS
data/lib/ext/kernel.rb CHANGED
@@ -6,4 +6,8 @@ module Kernel
6
6
  def print_line(buf, row = 0, column = 0)
7
7
  Device::Display.print_line(buf, row, column)
8
8
  end
9
+
10
+ def print_last(buf)
11
+ Device::Display.print_line(buf, STDOUT.max_y - 1, 0)
12
+ end
9
13
  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: 0.9.2
4
+ version: 0.10.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: 2017-07-25 00:00:00.000000000 Z
11
+ date: 2017-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake