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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 644352f16bb5cb4bc0b324213fc0539a44ba17af466dc0d0cd056f5459196c89
4
- data.tar.gz: 2aa27d9c33141c5023aa188464d817ba505a065924eb7770c83ad677ae1f3db8
3
+ metadata.gz: 88fae926e75b2a9b416f0c094bb90ea1ddf1bf7420df48cbcdccb5c4827346b5
4
+ data.tar.gz: 760d0ebc840be57fdd60ef7b9f838512b575d69a9a8b64dae1e00d83060803bb
5
5
  SHA512:
6
- metadata.gz: b4c3efb0f01bf8dccdb12e4fe2364e87e80e479a24c7ac747259106bb4029a9c220f637879a04c7b7225b893dcd6faae268caef6d38b11910b00472462c6a137
7
- data.tar.gz: e7858601e5712b37237474b1541e62fc01f4cc048e5b9896ea45c61036bfc81946eda19bcf598f7a3b044f70e2b11df8d540cdcdc32a51c576b8f41039bcaad1
6
+ metadata.gz: 2941c465784ac13a43a2096560a38e3f3a712ffa228872b13bc0b520c2bcb92d67aa04f3b924abdce7e6360dd6aabb95e5a3f17283655c059692dd46fafac19a
7
+ data.tar.gz: 4ee4cd934585921cff5d23bbe7fba21c93eb8a559f03c580685c83bdfe1eb4252301ff3a2082464633ce3f8b5b85db6e7f4b6ed96a97c177e4c86ce14eb1a69d
@@ -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/GpsdbaudRate.log", progname: "GpsdBaudRate", time_format: "'%Y-%m-%d %T.%N %z %Z'", level: Logger::DEBUG
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]
@@ -1,3 +1,3 @@
1
1
  class GpsdBaudRate
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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.8
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-26 00:00:00.000000000 Z
11
+ date: 2020-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler