pi_piper 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +5 -0
- data/README.md +0 -0
- data/Rakefile +14 -0
- data/lib/pi_piper.rb +20 -0
- data/pi_piper.gemspec +32 -0
- metadata +73 -0
data/Manifest
ADDED
data/README.md
ADDED
File without changes
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'echoe'
|
4
|
+
|
5
|
+
Echoe.new('pi_piper', '1.0') do |p|
|
6
|
+
p.description = "Event driven Raspberry Pi GPIO library"
|
7
|
+
p.url = "http://github.com/jwhitehorn/pi_piper"
|
8
|
+
p.author = "Jason Whitehorn"
|
9
|
+
p.email = "jason.whitehorn@gmail.com"
|
10
|
+
p.ignore_pattern = ["examples/*"]
|
11
|
+
p.development_dependencies = ['gpio']
|
12
|
+
end
|
13
|
+
|
14
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
data/lib/pi_piper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'gpio'
|
2
|
+
|
3
|
+
class PiPiper
|
4
|
+
|
5
|
+
def self.watch(options)
|
6
|
+
Thread.new do
|
7
|
+
loop do
|
8
|
+
sleep_time = options[:poll] || 0.1
|
9
|
+
pin = GPIO::InputPin.new(:pin => options[:pin])
|
10
|
+
until pin.changed? do sleep sleep_time end
|
11
|
+
yield pin
|
12
|
+
end
|
13
|
+
end.abort_on_exception = true
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.wait
|
17
|
+
loop do sleep 1 end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/pi_piper.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "pi_piper"
|
5
|
+
s.version = "1.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Jason Whitehorn"]
|
9
|
+
s.date = "2013-01-10"
|
10
|
+
s.description = "Event driven Raspberry Pi GPIO library"
|
11
|
+
s.email = "jason.whitehorn@gmail.com"
|
12
|
+
s.extra_rdoc_files = ["README.md", "lib/pi_piper.rb"]
|
13
|
+
s.files = ["Manifest", "README.md", "Rakefile", "lib/pi_piper.rb", "pi_piper.gemspec"]
|
14
|
+
s.homepage = "http://github.com/jwhitehorn/pi_piper"
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Pi_piper", "--main", "README.md"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = "pi_piper"
|
18
|
+
s.rubygems_version = "1.8.23"
|
19
|
+
s.summary = "Event driven Raspberry Pi GPIO library"
|
20
|
+
|
21
|
+
if s.respond_to? :specification_version then
|
22
|
+
s.specification_version = 3
|
23
|
+
|
24
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
25
|
+
s.add_development_dependency(%q<gpio>, [">= 0"])
|
26
|
+
else
|
27
|
+
s.add_dependency(%q<gpio>, [">= 0"])
|
28
|
+
end
|
29
|
+
else
|
30
|
+
s.add_dependency(%q<gpio>, [">= 0"])
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pi_piper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jason Whitehorn
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: gpio
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: Event driven Raspberry Pi GPIO library
|
31
|
+
email: jason.whitehorn@gmail.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files:
|
35
|
+
- README.md
|
36
|
+
- lib/pi_piper.rb
|
37
|
+
files:
|
38
|
+
- Manifest
|
39
|
+
- README.md
|
40
|
+
- Rakefile
|
41
|
+
- lib/pi_piper.rb
|
42
|
+
- pi_piper.gemspec
|
43
|
+
homepage: http://github.com/jwhitehorn/pi_piper
|
44
|
+
licenses: []
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options:
|
47
|
+
- --line-numbers
|
48
|
+
- --inline-source
|
49
|
+
- --title
|
50
|
+
- Pi_piper
|
51
|
+
- --main
|
52
|
+
- README.md
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '1.2'
|
67
|
+
requirements: []
|
68
|
+
rubyforge_project: pi_piper
|
69
|
+
rubygems_version: 1.8.23
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Event driven Raspberry Pi GPIO library
|
73
|
+
test_files: []
|