ruboty-pi_gpio 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruboty/handlers/pi_gpio.rb +3 -3
- data/lib/ruboty/pi_gpio/version.rb +1 -1
- data/lib/ruboty/pi_gpio.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a68e20e290191e0a9e4878a368741085ee20b685
|
4
|
+
data.tar.gz: 53cef26f3e49f0fa467a6d60db2ab888b12eef3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ba01c18625e2e3b520530004cab16a89da83580a38693c2f213981b20b360e2fb683ad92742876fc71a40e10a2bc9505e6c64d7380c5aae6f041db68baa191d
|
7
|
+
data.tar.gz: 2ce1cf2162cd6298512a4a58e671af76c3beb6413fd9cd1b860ba3f22cdc8ff310703d096ae0e14596740dd1fe3c05d8f3ec6df80c78a7ca3348ef4562b024e5
|
@@ -10,15 +10,15 @@ module Ruboty
|
|
10
10
|
Ruboty::PiGpio::Actions::Mode.new(message).call
|
11
11
|
end
|
12
12
|
|
13
|
-
def write
|
13
|
+
def write(message)
|
14
14
|
Ruboty::PiGpio::Actions::Write.new(message).call
|
15
15
|
end
|
16
16
|
|
17
|
-
def read
|
17
|
+
def read(message)
|
18
18
|
Ruboty::PiGpio::Actions::Read.new(message).call
|
19
19
|
end
|
20
20
|
|
21
|
-
def unexport
|
21
|
+
def unexport(message)
|
22
22
|
Ruboty::PiGpio::Actions::Unexport.new(message).call
|
23
23
|
end
|
24
24
|
end
|
data/lib/ruboty/pi_gpio.rb
CHANGED
@@ -8,6 +8,8 @@ require "ruboty/pi_gpio/actions/unexport"
|
|
8
8
|
|
9
9
|
END {
|
10
10
|
Dir.glob('/sys/class/gpio/gpio*').each do |gpio|
|
11
|
-
|
11
|
+
if /gpio(?<pin>\d{,2})$/ =~ gpio
|
12
|
+
open('/sys/class/gpio/unexport', 'w') { |f| f.write(pin) }
|
13
|
+
end
|
12
14
|
end
|
13
15
|
}
|