dht-sensor-ffi 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dht-sensor-ffi.gemspec +2 -2
- data/lib/dht-sensor/app.rb +9 -6
- 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: dbc1d4a95e39589649bf1341a5014d3f23d27a9d
|
4
|
+
data.tar.gz: 87f8a550c64a0f3705fda712d1da5eba9a5ad2a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a19f49961728414c9ac5e49fe59c6e91247d3469ff58e6cc1e91595232e7bb7b7caf64003252e958d3db1d89afde1dde10004f9758fbe972507aabfeb949f1
|
7
|
+
data.tar.gz: 0968a03243417aa5a13cd9269939b34dc18df49dcd420addd4b9eb2bab80e469e77717d1003034d2a85624977591729a87d63d46c7c4981e8ba5bed42b846e4a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/dht-sensor-ffi.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: dht-sensor-ffi 0.1.
|
5
|
+
# stub: dht-sensor-ffi 0.1.4 ruby lib
|
6
6
|
# stub: ext/extconf.rb
|
7
7
|
|
8
8
|
Gem::Specification.new do |s|
|
9
9
|
s.name = "dht-sensor-ffi"
|
10
|
-
s.version = "0.1.
|
10
|
+
s.version = "0.1.4"
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.require_paths = ["lib"]
|
data/lib/dht-sensor/app.rb
CHANGED
@@ -2,9 +2,17 @@
|
|
2
2
|
module DhtSensor
|
3
3
|
class App
|
4
4
|
|
5
|
+
DEFAULT_OPTIONS = {
|
6
|
+
:command => :read,
|
7
|
+
:pin => 4,
|
8
|
+
:type => 22,
|
9
|
+
:unit => :c
|
10
|
+
}
|
11
|
+
|
5
12
|
def run!
|
6
13
|
|
7
14
|
if ARGV.empty? then
|
15
|
+
@options = DEFAULT_OPTIONS.dup
|
8
16
|
do_read()
|
9
17
|
return
|
10
18
|
end
|
@@ -108,12 +116,7 @@ module DhtSensor
|
|
108
116
|
end
|
109
117
|
|
110
118
|
def parse_opts
|
111
|
-
options =
|
112
|
-
:command => :read,
|
113
|
-
:pin => 4,
|
114
|
-
:type => 22,
|
115
|
-
:unit => :c
|
116
|
-
}
|
119
|
+
options = DEFAULT_OPTIONS.dup
|
117
120
|
|
118
121
|
@opt_parser = OptionParser.new do |opts|
|
119
122
|
opts.banner = "Usage: dht_sensor [command]"
|