rservicebus2 0.2.22 → 0.2.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rservicebus2/appresource/awsdynamodb.rb +13 -2
- data/lib/rservicebus2/appresource/awss3.rb +16 -2
- data/lib/rservicebus2/helper_functions.rb +2 -0
- data/lib/rservicebus2/host.rb +1 -0
- data/lib/rservicebus2/monitor/awss3.rb +14 -2
- data/lib/rservicebus2/yaml_safe_loader.rb +2 -8
- 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: 8590b64121dc0528e931b8bad65291c44b80e92d9cf1702ab33aad06ba0d246d
|
4
|
+
data.tar.gz: b737f18b0ab817bdcf0256a67e01a7d1fc19c9564af74b7242d7050fc3655ff3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0967729a2066a27fb42723246ff6833e885b9fd8224a71f55086bcff6208b54b606465c3b84301b0ae93c1e99a3ab3d8301173724c49a3186adf09a041bae51
|
7
|
+
data.tar.gz: 827131189ff39fe240a5077c3ff5ced08253718b966a2ff13200b29b3d144543ddd648ad8fb65f7441853a5f0c13423113f4223f87007a2ddaf5857bc55c415d
|
@@ -6,9 +6,20 @@ module RServiceBus2
|
|
6
6
|
# AppResourceAWSDynamoDb
|
7
7
|
class AppResourceAWSDynamoDb < AppResource
|
8
8
|
def connect(uri)
|
9
|
-
|
9
|
+
host_name = uri.host
|
10
|
+
url_port = uri.port.nil? ? '' : ":#{uri.port}"
|
10
11
|
|
11
|
-
|
12
|
+
region = nil
|
13
|
+
unless uri.query.nil?
|
14
|
+
parts = CGI.parse(uri.query)
|
15
|
+
region = parts['region'][0] unless parts['region'].nil?
|
16
|
+
end
|
17
|
+
|
18
|
+
if region.nil?
|
19
|
+
Aws::DynamoDB::Client.new(endpoint: "http://#{host_name}#{url_port}")
|
20
|
+
else
|
21
|
+
Aws::DynamoDB::Client.new(endpoint: "http://#{host_name}#{url_port}", region: region)
|
22
|
+
end
|
12
23
|
end
|
13
24
|
|
14
25
|
def finished
|
@@ -6,9 +6,23 @@ module RServiceBus2
|
|
6
6
|
# AppResourceAWSDynamoDb
|
7
7
|
class AppResourceAWSS3 < AppResource
|
8
8
|
def connect(uri)
|
9
|
-
|
9
|
+
host_name = uri.host
|
10
|
+
url_port = uri.port.nil? ? '' : ":#{uri.port}"
|
10
11
|
|
11
|
-
|
12
|
+
region = nil
|
13
|
+
unless uri.query.nil?
|
14
|
+
parts = CGI.parse(uri.query)
|
15
|
+
region = parts['region'][0] unless parts['region'].nil?
|
16
|
+
end
|
17
|
+
|
18
|
+
if region.nil?
|
19
|
+
Aws::S3::Client.new(endpoint: "http://#{host_name}#{url_port}")
|
20
|
+
else
|
21
|
+
puts "region: #{region}"
|
22
|
+
Aws::S3::Client.new(endpoint: "http://#{host_name}#{url_port}", region: region)
|
23
|
+
end
|
24
|
+
|
25
|
+
#Aws::S3::Client.new(region: region)
|
12
26
|
end
|
13
27
|
|
14
28
|
def finished
|
@@ -39,6 +39,8 @@ module RServiceBus2
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.create_anonymous_class(name_for_class)
|
42
|
+
Module.const_get(name_for_class)
|
43
|
+
rescue NameError
|
42
44
|
new_anonymous_class = Class.new(Object)
|
43
45
|
Object.const_set(name_for_class, new_anonymous_class)
|
44
46
|
Object.const_get(name_for_class).new
|
data/lib/rservicebus2/host.rb
CHANGED
@@ -9,9 +9,21 @@ module RServiceBus2
|
|
9
9
|
@bucket_name = uri.path
|
10
10
|
@bucket_name[0] = ''
|
11
11
|
|
12
|
-
|
12
|
+
host_name = uri.host
|
13
|
+
url_port = uri.port.nil? ? '' : ":#{uri.port}"
|
14
|
+
|
15
|
+
region = nil
|
16
|
+
unless uri.query.nil?
|
17
|
+
parts = CGI.parse(uri.query)
|
18
|
+
region = parts['region'][0] unless parts['region'].nil?
|
19
|
+
end
|
20
|
+
|
21
|
+
if region.nil?
|
22
|
+
@s3_client = Aws::S3::Client.new(endpoint: "http://#{host_name}#{url_port}")
|
23
|
+
else
|
24
|
+
@s3_client = Aws::S3::Client.new(endpoint: "http://#{host_name}#{url_port}", region: region)
|
25
|
+
end
|
13
26
|
|
14
|
-
@s3_client = Aws::S3::Client.new(region: @region)
|
15
27
|
@input_filter = []
|
16
28
|
end
|
17
29
|
|
@@ -7,27 +7,21 @@ require 'singleton'
|
|
7
7
|
class YamlSafeLoader
|
8
8
|
include Singleton
|
9
9
|
|
10
|
-
DEFAULT_PERMITTED_CLASSES = 'RServiceBus2::Message,Time,UUIDTools::UUID,YamlSafeLoader,' \
|
10
|
+
DEFAULT_PERMITTED_CLASSES = 'RServiceBus2::Message,RServiceBus2::ErrorMessage,Time,UUIDTools::UUID,YamlSafeLoader,' \
|
11
11
|
'URI::Generic,URI::RFC3986_Parser,Symbol,Regexp'
|
12
12
|
|
13
|
-
def
|
14
|
-
return unless @permitted_classes.nil?
|
15
|
-
|
13
|
+
def initialize
|
16
14
|
string = "#{RServiceBus2.get_value('PERMITTED_CLASSES_BASE', DEFAULT_PERMITTED_CLASSES)}," \
|
17
15
|
"#{RServiceBus2.get_value('PERMITTED_CLASSES', '')}"
|
18
16
|
@permitted_classes = CSV.parse(string)[0].reject { |c| c.to_s.rstrip.empty? }
|
19
17
|
end
|
20
18
|
|
21
19
|
def add_permitted_class(string)
|
22
|
-
init
|
23
|
-
|
24
20
|
@permitted_classes << string
|
25
21
|
@permitted_classes.uniq!
|
26
22
|
end
|
27
23
|
|
28
24
|
def load(body)
|
29
|
-
init
|
30
|
-
|
31
25
|
YAML.safe_load(body, permitted_classes: @permitted_classes)
|
32
26
|
end
|
33
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rservicebus2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guy Irvine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: beanstalk-client
|