rfbeam 0.4.6 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79ad9d091d29c9ad6216dae66a545d5d03ffb137490484f1b9640c8f2aa78d8e
4
- data.tar.gz: 4636f3a60eb0b0be5d40f1e2f58026b0decd64ca45de62357a172992dc6d951d
3
+ metadata.gz: a0b3dc099fbf26e535ffa58dad9e643a2556168528d206d8f0fb7d73507cba3e
4
+ data.tar.gz: f75cfd53fe0bc32e982dd75e53af8a9e7c976f64abc3eca43ea1a31549ba6bd8
5
5
  SHA512:
6
- metadata.gz: f604132b6bf5c5ab3d11b2a896e380ed53d6468be068099f038400f79acbd16cc2fa1dd68f4a22ab0c6ea3f20692907de7e8fe2f584ef8dd662e62cc9aa18afe
7
- data.tar.gz: 9a2a3da9b797c427a7a17f2929932c38fbe204f1d81e799e54d143b93c0cc1bc395ace165fe6b965b0d1d2faa9fa07fa84c13b5c85dfdc17c9c9e80b0ed622df
6
+ metadata.gz: 6f00551148744f9d8f214ebef729fa5f26e84c8403f88ce1cd6534c407a577fc439f284c20899d08d861252f269c007126a06501a4175d0c802c0581c0030861
7
+ data.tar.gz: cf59d75f0b12ea6bfa7b6d0dd519da5f8ef5c700c5cdf66d177e8e6bcea59911550aa7c7215049deebc7e13c0c9430ae8b6d6c5ba44c57ad9db6a1155e2c7f86
data/Gemfile CHANGED
@@ -9,9 +9,12 @@ gem 'minitest', '~> 5.0'
9
9
  gem 'rake', '~> 13.0'
10
10
  gem 'tty-logger', '~> 0.6.0'
11
11
  gem 'tty-screen', '~> 0.8.1'
12
- gem 'tty-spinner', '~> 0.9.3'
13
12
  gem 'tty-table', '~> 0.12.0'
14
13
  gem 'unicode_plot', '~> 0.0.5'
15
14
 
16
- gem "syntax_tree", "~> 6.1", :groups => [:development, :test]
17
- gem "rubocop", "~> 1.39", :groups => [:development, :test]
15
+ git 'https://github.com/piotrmurach/tty-spinner.git', branch: 'master' do
16
+ gem 'tty-spinner', '~> 0.9.3'
17
+ end
18
+
19
+ gem 'rubocop', '~> 1.39', groups: %i[development test]
20
+ gem 'syntax_tree', '~> 6.1', groups: %i[development test]
data/Gemfile.lock CHANGED
@@ -1,7 +1,15 @@
1
+ GIT
2
+ remote: https://github.com/piotrmurach/tty-spinner.git
3
+ revision: a57d37a2617d4d58e33dca912061fe7e6754bea0
4
+ branch: master
5
+ specs:
6
+ tty-spinner (0.9.3)
7
+ tty-cursor (~> 0.7)
8
+
1
9
  PATH
2
10
  remote: .
3
11
  specs:
4
- rfbeam (0.4.6)
12
+ rfbeam (0.4.8)
5
13
  activesupport (~> 6.1.0)
6
14
  rubyserial (~> 0.6.0)
7
15
  thor (~> 1.2.1)
@@ -66,8 +74,6 @@ GEM
66
74
  tty-logger (0.6.0)
67
75
  pastel (~> 0.8)
68
76
  tty-screen (0.8.1)
69
- tty-spinner (0.9.3)
70
- tty-cursor (~> 0.7)
71
77
  tty-table (0.12.0)
72
78
  pastel (~> 0.8)
73
79
  strings (~> 0.2.0)
@@ -92,7 +98,7 @@ DEPENDENCIES
92
98
  syntax_tree (~> 6.1)
93
99
  tty-logger (~> 0.6.0)
94
100
  tty-screen (~> 0.8.1)
95
- tty-spinner (~> 0.9.3)
101
+ tty-spinner (~> 0.9.3)!
96
102
  tty-table (~> 0.12.0)
97
103
  unicode_plot (~> 0.0.5)
98
104
 
data/lib/rfbeam/cli.rb CHANGED
@@ -16,7 +16,7 @@ module RfBeam
16
16
  def list
17
17
  logger = TTY::Logger.new
18
18
  devices = RfBeam.connected
19
- logger.warning 'No Radar modules found.' unless devices.count.positive?
19
+ return logger.warn 'No Radar modules found.' if devices.empty?
20
20
 
21
21
  table = TTY::Table.new(header: %w[id Path Version])
22
22
 
@@ -21,7 +21,7 @@ module RfBeam
21
21
  end
22
22
 
23
23
  def display(type, stream: false)
24
- send("display_#{type}", stream)
24
+ stream ? send("stream_#{type}") : send("display_#{type}")
25
25
  end
26
26
 
27
27
  def plot(type, stream: false)
@@ -79,30 +79,30 @@ module RfBeam
79
79
  }
80
80
  end
81
81
 
82
- def display_ddat(stream)
83
- data = @radar.ddat
84
- if stream
85
- @streaming = true
86
- Thread.new { monitor_keypress }
87
- spinner = TTY::Spinner.new('[:spinner] :title ', format: :bouncing_ball)
88
- logger = TTY::Logger.new
82
+ def display_ddat
83
+ puts RfBeam::Kld7::CliFormatter.new.ddat(@radar.ddat)
84
+ end
85
+
86
+ def stream_ddat
87
+ @streaming = true
88
+ Thread.new { monitor_keypress }
89
+ spinner = TTY::Spinner.new('[:spinner] :title ', format: :bouncing_ball)
90
+ spinner.run('Done!') do |sp|
89
91
  loop do
90
92
  break unless @streaming
91
93
 
92
- spinner.spin
93
- spinner.update title: "Detection: #{DETECTION_FLAGS[data[2]]}"
94
- logger.success @radar.tdat.to_s unless data[2].zero?
94
+ data = @radar.ddat
95
+ sp.update title: "Detection: #{DETECTION_FLAGS[:detection][data[2]]}"
95
96
  end
96
- else
97
- puts RfBeam::Kld7::CliFormatter.new.ddat(data)
97
+ spinner.update title: ''
98
98
  end
99
99
  end
100
100
 
101
- def display_tdat(stream)
101
+ def display_tdat
102
102
  puts RfBeam::Kld7::CliFormatter.new.tdat(@radar.tdat)
103
103
  end
104
104
 
105
- def display_pdat(stream)
105
+ def display_pdat
106
106
  table = RfBeam::Kld7::CliFormatter.new.pdat_table(@radar.pdat)
107
107
  puts "\n Detected Raw Targets"
108
108
  puts table.render(:unicode, alignment: :center)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RfBeam
4
- VERSION = '0.4.6'
4
+ VERSION = '0.4.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfbeam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Carruthers