rpi 0.3.0 → 0.4.0

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: 3625eff76af461b31c643c0c8260e49eef6bc1b2
4
- data.tar.gz: ba63d08d58f6e4e7e99e44e531120e581de739ea
3
+ metadata.gz: e507a5b6ed7cf1e8944666d7f461be765e145fad
4
+ data.tar.gz: 6eccc0669846eb43d45efc0f60238a63e87d4f18
5
5
  SHA512:
6
- metadata.gz: 1b4e0b0aa4947b2dd96d394de6064cbe337d4fa37c5529a75aeda6df042142931286664d073afca0c029234686a2507fd0a78f7dd4fbeebeac9549e3dad4deaa
7
- data.tar.gz: 7fdf9fe5b55beb5d63af6dd6559fa69ada3bba33d1165ec076c88c6eee3c594a410a8858c987a56b6f903e09045feecd8caec3add1d54e3338511b3143659ad6
6
+ metadata.gz: 432e9f41f6610f7eee5cd691fbb8402c095d8ff33106c2573133dd60762c4aa97d47a58b82dc6a5cda1a34c1485fcd7bb2cea381318ae011e540fce03ae84bc4
7
+ data.tar.gz: 32d832215f1899394913fb5ebe0922e3340a5dd65a79fe563a267e8d24f2597d432394fe56b83d4412e3669159158d5c24d29942fd19fe91bce28f9deda2e7e2
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rpi.rb CHANGED
@@ -10,7 +10,7 @@ class RPi
10
10
 
11
11
  @leds = []
12
12
 
13
- class Led < Pin
13
+ class PinX < Pin
14
14
 
15
15
  HIGH = 1
16
16
  LOW = 0
@@ -78,12 +78,12 @@ class RPi
78
78
 
79
79
  unexport_all a
80
80
 
81
- @leds = a.map {|pin| Led.new pin }
81
+ @pins = a.map {|pin| PinX.new pin }
82
82
 
83
- def @leds.[](i)
83
+ def @pins.[](i)
84
84
 
85
85
  if i.to_i >= self.length then
86
- puts "RPi warning: Led instance #{i.inspect} not found"
86
+ puts "RPi warning: PinX instance #{i.inspect} not found"
87
87
  Void.new
88
88
  else
89
89
  self.at(i)
@@ -99,7 +99,7 @@ class RPi
99
99
  end
100
100
  end
101
101
 
102
- def led() @leds end
102
+ def pins() @pins end
103
103
 
104
104
  def unexport_all(pins)
105
105
 
@@ -115,7 +115,7 @@ class RPi
115
115
  end
116
116
 
117
117
  def on_exit
118
- unexport_all @leds
118
+ unexport_all @pins
119
119
  end
120
120
 
121
121
  def self.unexport(a)
@@ -133,5 +133,5 @@ end
133
133
  if __FILE__ == $0 then
134
134
  # example
135
135
  my_rpi = RPi.new %w(17 22 18 4 23 25 27) # <-- each pin connects to an LED
136
- my_rpi.led[ARGV.first.to_i].method(ARGV.last.to_sym).call
137
- end
136
+ my_rpi.pins[ARGV.first.to_i].method(ARGV.last.to_sym).call
137
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  Wx7qSZTfBXcuGk2ymZ2BpCgaIse2YK04JVIWsaTEFsbO44uMfK+sRtGmTmyf/12f
32
32
  KzQM/zlgQa5pBA==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-08-06 00:00:00.000000000 Z
34
+ date: 2015-09-26 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: pi_piper
metadata.gz.sig CHANGED
Binary file