da_funk 3.1.1 → 3.2.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: 834613e7d4ad7c55f0c83ee2cf316e29d931f411
4
- data.tar.gz: 52ec5afb74d88719e669e393d85e34914492a212
3
+ metadata.gz: 03471ebb21256854e18323132924129cbaa4e934
4
+ data.tar.gz: 631d211bfead33ff374846d2c0f13a1ccef96978
5
5
  SHA512:
6
- metadata.gz: 2861468ccdcaece406d166ffb87b0e5ce7ee535478d6d87273f488f3f71fb5baa7734202eb67f0216bc9f907744d6c22741a4796cdf4476ca75ce3426ab6601d
7
- data.tar.gz: f0132ee913e4e745facb147bd41d2bdb43d491ea53b2ec728fdb0de4a7234d4a54a22000506ccbb7eb1ba9cd65150a56120522b0e0b945e511ed2c326f9373aa
6
+ metadata.gz: 398b8b52adbb9ff45fa57ceaa7136615147770df89b6b63ebf44fabefdf3566919f9fa51a7e8e00ed2b6a6410ab272633355c52365af7f7aeb37b2e882710ff4
7
+ data.tar.gz: bf4a3c9a5dde48b39978facf54822cb69c5424cf039e3812d9fe49a4f15e1bbb982dc2ff3769de06fcabda2e4494f5601c997971deee46cac7cb22436f269180
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (3.1.1)
4
+ da_funk (3.2.0)
5
5
  archive-zip (~> 0.5)
6
6
  bundler
7
7
  cloudwalk_handshake
@@ -18,7 +18,7 @@ GEM
18
18
  cloudwalk (1.14.0)
19
19
  bundler
20
20
  rake
21
- cloudwalk_handshake (1.2.0)
21
+ cloudwalk_handshake (1.2.1)
22
22
  funky-emv (0.20.2)
23
23
  funky-tlv (~> 0.2)
24
24
  funky-simplehttp (0.5.0)
@@ -1,5 +1,9 @@
1
1
  # DaFunk
2
2
 
3
+ ### 3.2.0 - 2019-03-14
4
+
5
+ - Support menu_image helper that display image for menu.
6
+
3
7
  ### 3.1.1 - 2019-03-14
4
8
 
5
9
  - Bug fix attach helper loop image and decrease display time to 200ms;
@@ -129,6 +129,22 @@ module DaFunk
129
129
  processing
130
130
  end
131
131
 
132
+ def menu_image(path, selection, options = {})
133
+ return nil if selection.empty?
134
+
135
+ Device::Display.print_bitmap(path)
136
+
137
+ keys = ((1..(selection.size)).to_a.map(&:to_s) + [Device::IO::CANCEL])
138
+ key = try_key(keys, options[:timeout] || Device::IO.timeout)
139
+ selected = selection[key.to_i-1] if key.integer?
140
+
141
+ if key == Device::IO::ENTER || key == Device::IO::CANCEL
142
+ options[:default]
143
+ else
144
+ selected
145
+ end
146
+ end
147
+
132
148
  # Create a form menu.
133
149
  #
134
150
  # @param title [String] Text to display on line 0. If nil title won't be
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="3.1.1"
2
+ VERSION="3.2.0"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_funk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone