device_input 0.1.1.1 → 0.2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/device_input.rb +5 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b6a65816d84145d35e91685e6c65ade829cc898
4
- data.tar.gz: d4bc6894c5763401e890e588a5bcd48757d71d01
3
+ metadata.gz: '08ab72f999ee7e54b899c8a3807efe7476834b63'
4
+ data.tar.gz: 74ae6b78101f3799ea8b838013bff0cc2394d485
5
5
  SHA512:
6
- metadata.gz: 566ffdd5388b0b92751f158b8fdc20ef6d0ab5ea96b77b5b430e5d1328fab8a718d5e577ed4d3f8960ba76f0f060884ec41b6a86bd30a70372804133e82657df
7
- data.tar.gz: 074f459314a86d675d7f9ca4612e7c108e3eb866d89fb067e333762ac94418300113a4c94a014fe826914f6600c9e3db9033cc87aa4167d437c9a406f9e21f8b
6
+ metadata.gz: 3a3347ac9a323f8e10743ac44127129e4d459c855a7fb7d388b76a7d749299df2528ddfd9ed4334cc847d764d48aa6ac42c72ecef6a1c0d32c82376b44253c11
7
+ data.tar.gz: 0405ce0ec71045eaae906b7ae9e9edd757362ac8d07b790ce5fc50907af2633ab5bb2115c4cc552dd28acef6291532c472caa064db916b7065e9965fbc08437a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1.1
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 hex
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: device_input
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.1
4
+ version: 0.2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Hull