yaesu 0.0.3.alpha → 1.0.2.beta

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: c4c5f1308c086b97a5a83dcfb379a28fcf18c19d32b0dde85dc76d4fa3682569
4
- data.tar.gz: 2fa4568600549cf5b4795e12a56a6a01fd771dbc34e7623dd893772bc8cce686
3
+ metadata.gz: ce0649625d3ab0cfa7eda5a740067be65bb2de4a8ec04cfb7298e437942d6af8
4
+ data.tar.gz: eacd193288e25da3325c25f213cdaf13b8c49f88d974d52e322845066828f3c7
5
5
  SHA512:
6
- metadata.gz: 29e8d1db910c519983c50e0205689a651527debefc6c5192ded8942e0aebb9c5dcfae965e4192813f1260fb387922b4d6b83d085b5bae0379e10001e0943fe73
7
- data.tar.gz: 531cf11cd06e4cf65ac5fb7ea8860b048a8b79eaadc1c9080a86e66853dc35f88a76d73ede598a9ff93d7e5707e13f7042d29f748416ff7ef686278f58b85385
6
+ metadata.gz: 8f9475c9f2eda96a666a756502589f28e22b343e0c1b52c2523574644c02a97a13c20ce164862d53adc82373b093241c5c253ea9f25538a1aa6cfad2710cbf4d
7
+ data.tar.gz: 99173c31d60765e442dde7c0ece34aeb5158bb297a22bfeb9a6695aede114a567b3c01a454a575e7ea27203fca4024852f87427168a9de24998ca64a2c50d5fe
data/Gemfile.lock CHANGED
@@ -1,11 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yaesu (0.0.1.alpha)
4
+ yaesu (1.0.1.beta)
5
5
  msgpack
6
6
  ohm
7
7
  ost
8
8
  sdbm
9
+ terminal-table
10
+ thor
9
11
  uuid
10
12
 
11
13
  GEM
@@ -32,6 +34,10 @@ GEM
32
34
  stal (0.3.0)
33
35
  redic (~> 1.5)
34
36
  systemu (2.6.5)
37
+ terminal-table (3.0.0)
38
+ unicode-display_width (~> 1.1, >= 1.1.1)
39
+ thor (1.1.0)
40
+ unicode-display_width (1.7.0)
35
41
  uuid (2.3.9)
36
42
  macaddr (~> 1.0)
37
43
 
data/exe/yaesu ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'thor'
4
+ require 'yaesu'
5
+ require 'msgpack'
6
+ require 'terminal-table'
7
+
8
+
9
+ module Yaesu
10
+ class Cli < Thor
11
+ desc "log", "Last 10 transmissions"
12
+ def log(on)
13
+ items = Ost[on].items.first(10)
14
+ if items.count > 0
15
+ puts ""
16
+ puts "#{Ost[on].size} transmissions on #{on}\n"
17
+ puts ""
18
+ rows = []
19
+ columns = ['UID','Event','Data']
20
+ items.reverse.each do |item|
21
+ datum = OpenStruct.new(MessagePack.unpack(item))
22
+ rows << [datum.uid.split("-").first,datum.event,datum.data]
23
+ end
24
+ table = Terminal::Table.new :headings => columns, :rows => rows
25
+ puts table
26
+ puts ""
27
+ end
28
+ end
29
+ desc "transmit ON EVENT DATA", "Transmit ON EVENT DATA"
30
+ def transmit(on,event,data)
31
+ Yaesu.transmit on: on, event: event, data: data
32
+ end
33
+ desc "reset CHANNEL", "reset CHANNEL"
34
+ def reset(channel)
35
+ Ost[channel].redis.call("DEL",Ost[channel].key)
36
+ end
37
+ end
38
+ end
39
+
40
+ Yaesu::Cli.start(ARGV)
data/lib/yaesu.rb CHANGED
@@ -4,16 +4,18 @@ require 'bundler/inline'
4
4
  require 'ost'
5
5
  require 'sdbm'
6
6
  require 'uuid'
7
+ require 'thor'
7
8
  require 'ostruct'
8
9
  require 'msgpack'
9
10
  require 'fileutils'
10
11
 
12
+
11
13
  require_relative "yaesu/version"
12
14
 
13
15
  module Yaesu
14
16
  class Error < StandardError; end
15
- def self.transmit on:, data:
16
- Ost[on] << {uid: UUID.new.generate, payload: data}.to_msgpack
17
+ def self.transmit on:, event:, data:
18
+ Ost[on] << {uid: UUID.new.generate,event:event, data: data}.to_msgpack
17
19
  end
18
20
  def self.listen name:, on:
19
21
 
data/lib/yaesu/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yaesu
4
- VERSION = "0.0.3.alpha"
4
+ VERSION = "1.0.2.beta"
5
5
  end
File without changes
data/yaesu.gemspec CHANGED
@@ -26,6 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'msgpack'
27
27
  spec.add_dependency 'uuid'
28
28
  spec.add_dependency 'sdbm'
29
+ spec.add_dependency 'thor'
30
+ spec.add_dependency 'terminal-table'
29
31
 
30
32
  # For more information and examples about making a new gem, checkout our
31
33
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaesu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.alpha
4
+ version: 1.0.2.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coco Coder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-27 00:00:00.000000000 Z
11
+ date: 2021-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ohm
@@ -80,15 +80,42 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: thor
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: terminal-table
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: Yaesu message bus
84
112
  email:
85
113
  - shout@cococoder.com
86
- executables: []
114
+ executables:
115
+ - yaesu
87
116
  extensions: []
88
117
  extra_rdoc_files: []
89
118
  files:
90
- - ".data/Yaesu.dir"
91
- - ".data/Yaesu.pag"
92
119
  - ".gitignore"
93
120
  - ".ruby-version"
94
121
  - Gemfile
@@ -97,8 +124,10 @@ files:
97
124
  - Rakefile
98
125
  - bin/console
99
126
  - bin/setup
127
+ - exe/yaesu
100
128
  - lib/yaesu.rb
101
129
  - lib/yaesu/version.rb
130
+ - so.fa.dog
102
131
  - yaesu.gemspec
103
132
  homepage:
104
133
  licenses: []
data/.data/Yaesu.pag DELETED
Binary file