yaesu 1.1.2.beta → 1.1.3.beta
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 +4 -4
- data/lib/yaesu.rb +14 -8
- data/lib/yaesu/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: a8bde741c8fd84f88284ad174f1d5422409d5a139ab5d7f897330982099b1c79
|
|
4
|
+
data.tar.gz: 2d25bc775b3ffe0d12e46f06e086ad4f0792a31b3c43a9ffcc90c3fb0e9d544c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c19c3be0dfb72888263bb7f7ed32308213b6fa999376fe124de6a50a24e099f2a1afb5532b7474be52ca010fb334236ea685b719a3eddd02ad72f7c0aa2f240
|
|
7
|
+
data.tar.gz: 9b8f92acf81c694b65cf3a5bd1552c53ee8c813c69ef57963e5c96278a633d558ccb2675f98ef14f3132e6d74c5ff76619586a9a37bb0f9c0a54a4423354dd3e
|
data/lib/yaesu.rb
CHANGED
|
@@ -13,14 +13,20 @@ require 'fileutils'
|
|
|
13
13
|
require_relative "yaesu/version"
|
|
14
14
|
|
|
15
15
|
module Yaesu
|
|
16
|
+
REDIS_HOST = ENV.fetch("REDIS_HOST","127.0.0.1")
|
|
17
|
+
REDIS_PORT = ENV.fetch("REDIS_PORT","6379")
|
|
18
|
+
REDIS_URL = ENV.fetch("REDIS_URL","redis://#{REDIS_HOST}:#{REDIS_PORT}")
|
|
19
|
+
REDIS_TIMEOUT = ENV.fetch("REDIS_TIMEOUT")
|
|
20
|
+
|
|
21
|
+
Ost.redis = Redic.new(REDIS_URL, REDIS_TIMEOUT)
|
|
16
22
|
|
|
17
23
|
def self.configuration
|
|
18
24
|
@configuration ||= OpenStruct.new(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
{
|
|
26
|
+
channel: "yaesu.local",
|
|
27
|
+
name: "base",
|
|
28
|
+
data_dir: "./.data",
|
|
29
|
+
}
|
|
24
30
|
)
|
|
25
31
|
end
|
|
26
32
|
|
|
@@ -32,7 +38,7 @@ module Yaesu
|
|
|
32
38
|
def self.transmit on: Yaesu.configuration.channel, event:, data:
|
|
33
39
|
Ost[on] << {uid: UUID.new.generate,event:event, data: data}.to_msgpack
|
|
34
40
|
end
|
|
35
|
-
|
|
41
|
+
|
|
36
42
|
def self.listen!
|
|
37
43
|
self.listen name:Yaesu.configuration.name, on: Yaesu.configuration.channel do |msg|
|
|
38
44
|
yield msg if block_given?
|
|
@@ -40,9 +46,9 @@ module Yaesu
|
|
|
40
46
|
end
|
|
41
47
|
|
|
42
48
|
def self.listen name:, on:
|
|
43
|
-
|
|
49
|
+
|
|
44
50
|
FileUtils.mkdir_p("#{Yaesu.configuration.data_dir}/#{name}") unless Dir.exists? ".data"
|
|
45
|
-
|
|
51
|
+
|
|
46
52
|
puts "#{name} is listening on #{on} -> Ok!"
|
|
47
53
|
|
|
48
54
|
begin
|
data/lib/yaesu/version.rb
CHANGED
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: 1.1.
|
|
4
|
+
version: 1.1.3.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-
|
|
11
|
+
date: 2021-03-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ohm
|