ruby_rabbitmq_janus 2.6.0.pre.238 → 2.6.0.pre.239
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/config/default.md +1 -0
- data/config/default.yml +2 -0
- data/lib/rrj/errors/tools/gem/config.rb +6 -0
- data/lib/rrj/init.rb +0 -3
- data/lib/rrj/rabbit/connect.rb +7 -4
- data/lib/rrj/rspec.rb +0 -5
- data/lib/rrj/tools/bin/init.rb +2 -0
- data/lib/rrj/tools/gem/config.rb +8 -0
- 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: d9a36af6916660c564b4874d7aaf410df1a4a0885a68ad644acc562c76affe99
|
4
|
+
data.tar.gz: 3d70e4fb0ad83d810d49e11a2a8454d3b9710fa84ac7c749b6b07c8b0246ccf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74264999b596be0f8a5dc2488c74835bb2fd55eba263d004c046825de443d637881399a46b310c612f496c5839beb834dafdbce2a9955de854f1bd653aac498e
|
7
|
+
data.tar.gz: 9b5a311f94382e03730075d9624768d7fc03ae9b3c35118afe92076e595715cf7b2c4740629bea22964411bdba978b78728cbbefbf31d6b94bf4a6a90093ea0f
|
data/config/default.md
CHANGED
data/config/default.yml
CHANGED
@@ -56,6 +56,12 @@ module RubyRabbitmqJanus
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
+
class RabbitTester < RubyRabbitmqJanus::Errors::Tools::BaseConfig
|
60
|
+
def initialize
|
61
|
+
super '[RabbitTester] Error for reading option rabbitmq tester', :warn
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
59
65
|
class TimeToLive < RubyRabbitmqJanus::Errors::Tools::BaseConfig
|
60
66
|
def initialize
|
61
67
|
super '[TimeToLive] Keepalive TTL option is not reading in config file', :warn
|
data/lib/rrj/init.rb
CHANGED
data/lib/rrj/rabbit/connect.rb
CHANGED
@@ -10,9 +10,12 @@ module RubyRabbitmqJanus
|
|
10
10
|
class Connect
|
11
11
|
# Initialize connection to server RabbitMQ
|
12
12
|
def initialize
|
13
|
-
@rabbit = if
|
13
|
+
@rabbit = if Tools::Config.instance.tester?
|
14
|
+
require 'bunny-mock'
|
15
|
+
p 'Connect to fake rabbitmq'
|
14
16
|
BunnyMock.new.start
|
15
17
|
else
|
18
|
+
p 'Connect to rabbitmq'
|
16
19
|
Bunny.new(read_options_server.merge!(option_log_rabbit))
|
17
20
|
end
|
18
21
|
rescue => exception
|
@@ -21,7 +24,7 @@ module RubyRabbitmqJanus
|
|
21
24
|
|
22
25
|
# Create an transaction with rabbitmq and close after response is received
|
23
26
|
def transaction_short
|
24
|
-
response = if
|
27
|
+
response = if Tools::Config.instance.tester?
|
25
28
|
fake_transaction
|
26
29
|
else
|
27
30
|
transaction_long { yield }
|
@@ -35,7 +38,7 @@ module RubyRabbitmqJanus
|
|
35
38
|
# Create an transaction with rabbitmq and not close
|
36
39
|
def transaction_long
|
37
40
|
start
|
38
|
-
if
|
41
|
+
if Tools::Config.instance.tester?
|
39
42
|
@rabbit.channel.queue.pop[:message]
|
40
43
|
else
|
41
44
|
yield
|
@@ -60,7 +63,7 @@ module RubyRabbitmqJanus
|
|
60
63
|
|
61
64
|
# Create an channel
|
62
65
|
def channel
|
63
|
-
if
|
66
|
+
if Tools::Config.instance.tester?
|
64
67
|
@rabbit.channel
|
65
68
|
else
|
66
69
|
@rabbit.create_channel
|
data/lib/rrj/rspec.rb
CHANGED
data/lib/rrj/tools/bin/init.rb
CHANGED
@@ -6,12 +6,14 @@
|
|
6
6
|
require 'rrj/info'
|
7
7
|
require 'ruby_rabbitmq_janus'
|
8
8
|
|
9
|
+
# rubocop:disable Naming/ConstantName
|
9
10
|
::Log = if @logger_default
|
10
11
|
RubyRabbitmqJanus::Tools::Log.instance
|
11
12
|
else
|
12
13
|
require_relative @logger_path
|
13
14
|
@logger_class.constantize.instance
|
14
15
|
end
|
16
|
+
# rubocop:enable Naming/ConstantName
|
15
17
|
|
16
18
|
Log.info "RRJ Version : #{RubyRabbitmqJanus::VERSION}"
|
17
19
|
Log.info RubyRabbitmqJanus::BANNER
|
data/lib/rrj/tools/gem/config.rb
CHANGED
@@ -92,12 +92,20 @@ module RubyRabbitmqJanus
|
|
92
92
|
raise Errors::Tools::Config::LogLevel
|
93
93
|
end
|
94
94
|
|
95
|
+
# @return [Symbol] read configuration for bunny log level
|
95
96
|
def log_level_rabbit
|
96
97
|
@options['rabbit']['level'].upcase.to_sym || :INFO
|
97
98
|
rescue
|
98
99
|
raise Errors::Tools::Config::LogLevelRabbit
|
99
100
|
end
|
100
101
|
|
102
|
+
# @return [Boolean] read configuration for bunny execution
|
103
|
+
def tester?
|
104
|
+
@options['rabbit']['test'].to_s.match?('true') ? true : false
|
105
|
+
rescue
|
106
|
+
raise Errors::Tools::Config::RabbitTester
|
107
|
+
end
|
108
|
+
|
101
109
|
# @return [Integer]
|
102
110
|
# read configuration for janus time to live for keepalive messages
|
103
111
|
def time_to_live
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_rabbitmq_janus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.0.pre.
|
4
|
+
version: 2.6.0.pre.239
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VAILLANT Jeremy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|