ruby_hid 0.0.3 → 0.0.4

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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NmVlZGRhOGEyZWFlYmNmZDlkMGYzZjgxYmViNTRhODFjZDcyNDQwMQ==
5
- data.tar.gz: !binary |-
6
- NjNiOGM5YjczZjc5ZTFlZTkyMjZjNWQ1OTYzNTViOTkzMTk2ZTc1MA==
2
+ SHA1:
3
+ metadata.gz: bb48d7689c6919f3355db1484a0c7deafade7611
4
+ data.tar.gz: 1e2f428c6dca84d4c3a06fe28d662cc0d8571465
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ODg2ZjZlMTBhNmZhOGQ5NjMzNzJhZTllZDk2YTZmNTNhN2IxMTcyYjdiMmM5
10
- Zjg2NTdiNWFiZGQ2NjY1N2ZiMDBiM2IxYWNmYTBhNmE5Njc5ZGJhMGE0NzBi
11
- MmNiNzQ5MjZmYTU3NTc1MDk2NDZjZDhhODc0MGU0NmEyYTlmZDE=
12
- data.tar.gz: !binary |-
13
- ODYwMDZmNDE0ZTJlMzYwMjBhMjczZTBlNDVhNTk0MDZkMGRiOGE2ZGI0YmM2
14
- ODEzZTc0NzVmMzFkMTdmYzY5ZTI0MjIyMWY4NDFmMWViYWJkN2MyMDM0ZjQ3
15
- YmVmZmVkNTk5NTkwMjMxOGMyZDcwOGY3YjUwNGJjMjdlODU0ZTk=
6
+ metadata.gz: 361efe844571e80c92a0ef1f8b9acac22b96f7d6a25cf53f56993fed8e1c018cac9f49121fffe6340c06004cf2c2f6202c44d4c7c2dd26c1ab397de0b9ab47a7
7
+ data.tar.gz: 552ad9ee49faa73ed015d70984a817cc6caf1050fe3190fd5eae915ca2b63ffa5ccdcdc1865ee102140a3556bdd948a828cc0261aeffe0f910ac80a6b57237c9
data/README.md CHANGED
@@ -7,9 +7,15 @@ A ruby library for observing HID game controllers. Currently supports
7
7
 
8
8
  Currently this only handles one controller at a time.
9
9
 
10
- *Warning:* ruby_hid has to change some rights down in the /sys and /dev
11
- folders of Linux in order to access the kernel. You will be asked for
12
- your password in order to use ruby_hid.
10
+ *Warning:* in the event of any rights issues, ruby_hid may have to
11
+ change some rights down in the /sys and /dev folders. If you have a
12
+ rights issue run:
13
+
14
+ ```ruby
15
+ RubyHid::Device.force_rights
16
+ ```
17
+
18
+ Then provide a sudo-able password.
13
19
 
14
20
  Example Scripts
15
21
  ===============
@@ -393,4 +399,4 @@ which was forked from
393
399
  https://github.com/prullmann/libdevinput
394
400
 
395
401
  Without that clone of libdev, written in ruby, I would not have been
396
- able to
402
+ able to
data/lib/ruby_hid.rb CHANGED
@@ -1,6 +1,3 @@
1
- `sudo chmod 777 /sys/class/leds/*/brightness`
2
- `sudo chmod 777 /dev/input/event*`
3
-
4
1
  require 'ostruct'
5
2
  require_relative './ruby_hid/device.rb'
6
3
  require_relative './ruby_hid/observer.rb'
@@ -34,6 +34,11 @@ module RubyHid
34
34
  AXIS_TYPE
35
35
  ]
36
36
 
37
+ def force_rights
38
+ `sudo chmod 777 /sys/class/leds/*/brightness`
39
+ `sudo chmod 777 /dev/input/event*`
40
+ end
41
+
37
42
  #
38
43
  # List possible devices from /dev/input/by-id/
39
44
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_hid
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
  - Andrew Faraday
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-04-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: HID device observer library for Ruby applications. Currently only ubuntu
14
14
  Linux distributions.
@@ -35,17 +35,17 @@ require_paths:
35
35
  - lib
36
36
  required_ruby_version: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.0.0
41
41
  required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  requirements:
43
- - - ! '>='
43
+ - - ">="
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  requirements: []
47
47
  rubyforge_project:
48
- rubygems_version: 2.4.3
48
+ rubygems_version: 2.5.1
49
49
  signing_key:
50
50
  specification_version: 4
51
51
  summary: HID game controller support for Ruby in Linux