Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
language: ruby
rvm:
- 2.1.5
before_install:
- sudo apt-get -y install libhidapi-dev libhidapi-hidraw0 libhidapi-libusb0
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ This gem is my first attempt at writing any FFI code, and my first attempt to us

The gem requires the hidapi library to be installed and available to Ruby. On Mac with homebrew installed, this can be done with the command:

### For macOS

$ brew install hidapi

### For Debian

$ sudo apt install libhidapi-dev libhidapi-hidraw0 libhidapi-libusb0

## Installation

Add this line to your application's Gemfile:
Expand Down
4 changes: 3 additions & 1 deletion lib/hid_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
module HidApi
class HidError < StandardError; end

HIDAPI_LIBS = %w(hidapi hidapi-libusb hidapi-hidraw).freeze

extend FFI::Library
ffi_lib "hidapi"
ffi_lib HIDAPI_LIBS

autoload :Deprecated, "hid_api/deprecated"
autoload :Device, "hid_api/device"
Expand Down
4 changes: 0 additions & 4 deletions spec/hid_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@
it "has a version number" do
expect(HidApi::VERSION).not_to be nil
end

it "does something useful" do
expect(false).to eq(true)
end
end