rpi 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -3
  3. data.tar.gz.sig +0 -0
  4. data/lib/rpi.rb +10 -3
  5. metadata +13 -6
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 810da7fe2d30d332508006187104d1b47299f97f
4
- data.tar.gz: 1281644e7dbe535dcb348051f36859b3c2764d2c
3
+ metadata.gz: f00ccbd72c5f650be889cd47a5e8b8de5bb68854
4
+ data.tar.gz: 5241c76f19966169d94253117770e42dca7233f7
5
5
  SHA512:
6
- metadata.gz: 0b07c3ed6b91ad1b0e9c723a77cc42d3fef70502fc1d844561f145cb8b1cbf86b08d3129161f2d093d07d22d76aa6dcc08a395724007118afad77abe0b43f63f
7
- data.tar.gz: 98bde72aed86132658c3db957299d00b98720684395ca6fce79ff35d941f00325136164982e4475979d739b7ecdb1da7e8b8ae2450a2e4d134a082987c8caeb7
6
+ metadata.gz: cc64a7eb4d80f0a6127741b256bfa35b263ec08434461e0f8987f664bbb67d07fa00f6d20eda4a91680e2f40fb8dd5d9742f2c47e98a42d38001520a33827af9
7
+ data.tar.gz: 758608c536f9fe26d79e2b6f015fe336ca0b4ed987ed06de801116193ca8f84574b4f5b04019bbc4a0348f4ca30b7d01f707d1e6af89f0d27c46d2404422e1b4
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- n�>x���j��(o0��8
2
- �*�bт�I9;Rj` I0"�TaK%o�M��GW�Ӆ�j�Bt����&�aE�L�$D��# X�/��c~:��vw��r�����nkG���`vϥ��!��agR��sJ`#s��F���4`
3
- X^E
1
+ W4o�ԙݑ/E,��P�
2
+ �k��yg��p���&���-�Q�B���g�/R�1p���ψ��dY���%���>p ,�0=w?Ɋ��U4���ڥ�d�#T2���Ly6��hH $��Uݲ8y���xjv�&�������iZ2��|�lT�-� (��{����t8�Ɗ�k��Qն��OYL9�/�T��a�/|��������%����@�h'�!
data.tar.gz.sig CHANGED
Binary file
data/lib/rpi.rb CHANGED
@@ -19,7 +19,11 @@ class RPi
19
19
  @state = self.value
20
20
  end
21
21
 
22
- def on() super(); @state = :on end
22
+ def on(duration=nil)
23
+ super();
24
+ @state = :on
25
+ (sleep duration; self.off) if duration
26
+ end
23
27
 
24
28
  def off()
25
29
 
@@ -28,14 +32,17 @@ class RPi
28
32
  @state = :off
29
33
  end
30
34
 
31
- def blink(seconds=0.5)
35
+ def blink(seconds=0.5, duration: nil)
32
36
 
33
37
  @state = :blink
38
+ t2 = Time.now + duration if duration
34
39
 
35
40
  Thread.new do
36
41
  while @state == :blink do
37
42
  (set_pin HIGH; sleep seconds; set_pin LOW; sleep seconds)
43
+ self.off if duration and Time.now >= t2
38
44
  end
45
+
39
46
  end
40
47
  end
41
48
 
@@ -66,4 +73,4 @@ if __FILE__ == $0 then
66
73
  # example
67
74
  my_rpi = RPi.new %w(17 22 18 4 23 25 27) # <-- each pin connects to an LED
68
75
  my_rpi.led[ARGV.first.to_i].method(ARGV.last.to_sym).call
69
- end
76
+ 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.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,22 +31,28 @@ cert_chain:
31
31
  lQvI6/bR+gvrxxIYGY/VLrsSxXasTQAOxICwewAx186W0aVXdfHtujoUBYHbuutl
32
32
  2yqX2uRxfgCriQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2013-11-24 00:00:00.000000000 Z
34
+ date: 2014-07-09 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: pi_piper
38
38
  requirement: !ruby/object:Gem::Requirement
39
39
  requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.3'
40
43
  - - ">="
41
44
  - !ruby/object:Gem::Version
42
- version: '0'
45
+ version: 1.3.2
43
46
  type: :runtime
44
47
  prerelease: false
45
48
  version_requirements: !ruby/object:Gem::Requirement
46
49
  requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '1.3'
47
53
  - - ">="
48
54
  - !ruby/object:Gem::Version
49
- version: '0'
55
+ version: 1.3.2
50
56
  description:
51
57
  email: james@r0bertson.co.uk
52
58
  executables: []
@@ -66,7 +72,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
66
72
  requirements:
67
73
  - - ">="
68
74
  - !ruby/object:Gem::Version
69
- version: '0'
75
+ version: 2.1.2
70
76
  required_rubygems_version: !ruby/object:Gem::Requirement
71
77
  requirements:
72
78
  - - ">="
@@ -74,8 +80,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
80
  version: '0'
75
81
  requirements: []
76
82
  rubyforge_project:
77
- rubygems_version: 2.0.0.rc.2
83
+ rubygems_version: 2.2.2
78
84
  signing_key:
79
85
  specification_version: 4
80
86
  summary: The RPi gem makes it easy to set blinking LEDs on the Raspberry Pi
81
87
  test_files: []
88
+ has_rdoc:
metadata.gz.sig CHANGED
Binary file