usb-ruby
usb-ruby is a Ruby FFI binding for libusb 1.0. It exposes the libusb API through the top-level USB module and does not require native extension compilation.
Installation
Add the gem to your Gemfile:
bundle add usb-rubyOr install it directly:
gem install usb-rubyUsage
require "usb"
USB::Context.open do |context|
context.devices.each do |device|
descriptor = device.device_descriptor
puts format("%03d/%03d %04x:%04x",
device.bus_number,
device.device_address,
descriptor.vendor_id,
descriptor.product_id)
end
endDevelopment
Run:
bundle install
bundle exec rspec
bundle exec rake installContributing
Bug reports and pull requests are welcome at https://github.com/ydah/usb.
License
The gem is available as open source under the terms of the MIT License.