device_input 0.1.1.1 → 0.2.0.1
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 +4 -4
- data/VERSION +1 -1
- data/lib/device_input.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08ab72f999ee7e54b899c8a3807efe7476834b63'
|
4
|
+
data.tar.gz: 74ae6b78101f3799ea8b838013bff0cc2394d485
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a3347ac9a323f8e10743ac44127129e4d459c855a7fb7d388b76a7d749299df2528ddfd9ed4334cc847d764d48aa6ac42c72ecef6a1c0d32c82376b44253c11
|
7
|
+
data.tar.gz: 0405ce0ec71045eaae906b7ae9e9edd757362ac8d07b790ce5fc50907af2633ab5bb2115c4cc552dd28acef6291532c472caa064db916b7065e9965fbc08437a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0.1
|
data/lib/device_input.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'device_input/labels'
|
2
|
+
require 'device_input/compat'
|
2
3
|
|
3
4
|
module DeviceInput
|
4
5
|
class Event
|
@@ -85,8 +86,8 @@ module DeviceInput
|
|
85
86
|
end
|
86
87
|
|
87
88
|
# display fields in hex
|
88
|
-
def
|
89
|
-
require 'rbconfig/sizeof'
|
89
|
+
def ruby23_hex
|
90
|
+
require 'rbconfig/sizeof' # new in ruby 2.3
|
90
91
|
DEFINITION.inject('') { |memo, (field, type)|
|
91
92
|
int = @data.send(field)
|
92
93
|
width = RbConfig::SIZEOF.fetch(type)
|
@@ -94,6 +95,8 @@ module DeviceInput
|
|
94
95
|
memo + ("%0.#{width * 2}x" % int) + " "
|
95
96
|
}
|
96
97
|
end
|
98
|
+
|
99
|
+
alias_method :hex, RUBY23 ? :ruby23_hex : :to_s
|
97
100
|
end
|
98
101
|
|
99
102
|
# never gonna give you up
|