gpsd_baud_rate 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gpsd_baud_rate.rb +16 -2
- data/lib/gpsd_baud_rate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88fae926e75b2a9b416f0c094bb90ea1ddf1bf7420df48cbcdccb5c4827346b5
|
4
|
+
data.tar.gz: 760d0ebc840be57fdd60ef7b9f838512b575d69a9a8b64dae1e00d83060803bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2941c465784ac13a43a2096560a38e3f3a712ffa228872b13bc0b520c2bcb92d67aa04f3b924abdce7e6360dd6aabb95e5a3f17283655c059692dd46fafac19a
|
7
|
+
data.tar.gz: 4ee4cd934585921cff5d23bbe7fba21c93eb8a559f03c580685c83bdfe1eb4252301ff3a2082464633ce3f8b5b85db6e7f4b6ed96a97c177e4c86ce14eb1a69d
|
data/lib/gpsd_baud_rate.rb
CHANGED
@@ -17,11 +17,18 @@ class GpsdBaudRate
|
|
17
17
|
|
18
18
|
def initialize goal_rate = @@baud_rates[0]
|
19
19
|
|
20
|
-
@logger = new_logger path: "log/
|
20
|
+
@logger = new_logger path: "log/GpsdBaudRate.log", progname: "GpsdBaudRate", time_format: "'%Y-%m-%d %T.%N %z %Z'", level: Logger::DEBUG
|
21
21
|
@logger.info "GpsdBaudRate Gem - Version: #{@@version}"
|
22
|
+
|
23
|
+
if check_device?
|
24
|
+
@logger.info "Device: #{@@device} not found"
|
25
|
+
raise StandardError.new "Device #{@@device} not found"
|
26
|
+
else
|
27
|
+
@logger.info "Device: #{@@device} Okay"
|
28
|
+
end
|
22
29
|
# pid= %x|pgrep -f "ruby /home/deploy/bin/set_baud.rb"|
|
23
30
|
# @logger.debug "Pid: #{pid}, $$: #{$$}, $BASHPID: #{$BASHPID}"
|
24
|
-
|
31
|
+
=begin
|
25
32
|
@goal_rate = goal_rate.to_i
|
26
33
|
@logger.debug "Goal_rate: #{@goal_rate}"
|
27
34
|
|
@@ -50,10 +57,17 @@ class GpsdBaudRate
|
|
50
57
|
# Cleanup
|
51
58
|
gpsd_start
|
52
59
|
@logger.debug "Service Status: #{gpsd_active?}"
|
60
|
+
=end
|
53
61
|
end #initiallize
|
54
62
|
|
55
63
|
#~~~~~~~~~~~~~~~~~~~~~ gpsd_status ~~~~~~~~~~~~~~~~~
|
56
64
|
|
65
|
+
def self.check_device?
|
66
|
+
# Does the @@device exist and is it a character device
|
67
|
+
0 = %x| test -c "#{@@device}" ; echo $?|
|
68
|
+
|
69
|
+
end
|
70
|
+
|
57
71
|
def self.gpsd_active?
|
58
72
|
arry = %x|sudo systemctl status "#{@@socket}"|.split(/\n/)
|
59
73
|
s = arry.select!{ |e| e.include? "Active:"}[0].split(/\W+/)[2]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpsd_baud_rate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Finnegan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|