usbutils 0.0.3 → 0.0.4

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: 681938447947a87f3510d70f1843ced9e3a6bf03
4
- data.tar.gz: bd5429e951be37350d1b96c884b15547e0bc421d
3
+ metadata.gz: bef3ecad3d4514598116281ee3acfb99ebf18ce8
4
+ data.tar.gz: 6b385328a53a00b95d134813c35695196ac66e3c
5
5
  SHA512:
6
- metadata.gz: dc1f8ecf28cb2ecee1a9505d49f807dd50473217f7df1e9d4bfa096c7c0ffd181542493df7abf0ed5664b2d8a322a3bf8d0c7cabcbc7456f5074227aca1ae5bc
7
- data.tar.gz: 61e586ed8b37d1c668a3ca7fdb7244912ea60fcd47f2b5ab7fd3082ef6e7dff7f225872793c640fc09dc2249869fc636fa0ce53a22432c9164828d7a3b1b110e
6
+ metadata.gz: 522236ed06435b80d1b84cfe538e3f7e3608fe2eba84c62b9c323ed6eb4050f8ee770eede581ebf9a03414d959e89456ebced84b062e316f54b6f696913c3246
7
+ data.tar.gz: 47af4de69c78a90282956594605c6bd8509ce9ad7539616c22f0e5c4d9d3ce9504d49671046c8bc71ca3ed6b4d2d89af1e4f893517f3d9b96720d8f909f255ce
data/README.md CHANGED
@@ -18,13 +18,13 @@ show command list
18
18
 
19
19
  show usb devices
20
20
 
21
- $ usbutils devices
21
+ $ sudo usbutils devices
22
22
  serial=0000:00:06.0 product=OHCI Host Controller manufacturer=Linux 3.2.0-23-generic ohci_hcd
23
23
  serial=01498A4D15005015 product=Galaxy Nexus manufacturer=samsung
24
24
 
25
25
  reset(reconnect) usb device
26
26
 
27
- $ usbutils reset 01498A4D15005015
27
+ $ sudo usbutils reset 01498A4D15005015
28
28
 
29
29
  ## Contributing
30
30
 
@@ -20,9 +20,7 @@ module USBUtils
20
20
  end
21
21
  usb = LIBUSB::Context.new
22
22
  usb.devices.each do |usbdev|
23
- idvendor = format("%04x", usbdev.idVendor)
24
- idproduct = format("%04x", usbdev.idProduct)
25
- device = devices.select {|item| item[:idvendor] == idvendor && item[:idproduct] == idproduct}.first
23
+ device = devices.select {|item| item[:serial] == usbdev.serial_number}.first
26
24
  device[:usbdev] = usbdev if device
27
25
  end
28
26
  devices
@@ -12,7 +12,7 @@ module USBUtils
12
12
  if options[:detail]
13
13
  pp device
14
14
  else
15
- print "serial=#{device[:serial]}\tproduct=#{device[:product]}\tmanufacturer=#{device[:manufacturer]}\n"
15
+ print "serial=#{device[:serial]}\tproduct=#{device[:product]}\tmanufacturer=#{device[:manufacturer]}\tusbdev=#{device[:usbdev]}\n"
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module USBUtils
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usbutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - k-yamada