onlyoffice_digitalocean_wrapper 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/exceptions_retryer.rb +1 -1
- data/lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/getters.rb +25 -1
- data/lib/onlyoffice_digitalocean_wrapper/digitalocean_wrapper/token_methods.rb +1 -1
- data/lib/onlyoffice_digitalocean_wrapper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 722a209dd7c530acc9eca5dc95af3482ce07b031f1d60458f0fd4f60d68d97f1
|
4
|
+
data.tar.gz: 2176a7c8518150703d75437360e757e2be7e6ed770affb877fb02dfc362f2124
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efec409153d5b1d2c94d8ef541ed957f708869b5096c42371224d389adab3d7282d0eccb0e56bb40a30dc6e5a43989eae1c2aeb73830346138f9f20511424e31
|
7
|
+
data.tar.gz: 5680e5bc73b4fd25f402fa18de9b788008710ef00fac98dff796e958e1e3e45c682563eeeb169a5b2871af8898a7247e975c81b5f1bf91fe793cb5448714bf6e
|
@@ -16,7 +16,7 @@ module OnlyofficeDigitaloceanWrapper
|
|
16
16
|
rescue exception => e
|
17
17
|
try += 1
|
18
18
|
logger.error("Error '#{exception}, #{e}' happened during "\
|
19
|
-
|
19
|
+
"operation. Retrying #{try} of #{retries}")
|
20
20
|
sleep timeout # Time to cooldown error
|
21
21
|
try <= retries ? retry : raise
|
22
22
|
end
|
@@ -22,9 +22,33 @@ module OnlyofficeDigitaloceanWrapper
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
# Get project by name
|
26
|
+
# @param [String] project_name
|
27
|
+
# @return [DropletKit::Project] object representing a project
|
28
|
+
def project_by_name(project_name)
|
29
|
+
retry_exception do
|
30
|
+
projects = @client.projects.all
|
31
|
+
projects.find { |x| x.name == project_name }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Get project id by name
|
36
|
+
# @param [String] project_name
|
37
|
+
# @return [nil, String] id of current project or nil is no project found
|
38
|
+
def get_project_id_by_name(project_name)
|
39
|
+
project = project_by_name(project_name)
|
40
|
+
if project.nil?
|
41
|
+
logger.info("get_project_id_by_name(#{project_name}): not found any projects")
|
42
|
+
nil
|
43
|
+
else
|
44
|
+
logger.info("get_project_id_by_name(#{project_name}): #{project.id}")
|
45
|
+
project.id
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
25
49
|
# Return droplet id by it's name
|
26
50
|
# @param droplet_name [String] name of droplet
|
27
|
-
# @return [Integer] id of droplet
|
51
|
+
# @return [nil, Integer] id of droplet or nil is no one droplet found
|
28
52
|
def get_droplet_id_by_name(droplet_name)
|
29
53
|
droplet = droplet_by_name(droplet_name)
|
30
54
|
if droplet.nil?
|
@@ -25,7 +25,7 @@ module OnlyofficeDigitaloceanWrapper
|
|
25
25
|
File.read(token_file_path).delete("\n")
|
26
26
|
rescue Errno::ENOENT
|
27
27
|
raise Errno::ENOENT, "No access token found in #{token_file_path}. " \
|
28
|
-
|
28
|
+
"Please create file #{token_file_path} with token"
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_digitalocean_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-07-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: droplet_kit
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
|
-
rubygems_version: 3.2.
|
196
|
+
rubygems_version: 3.2.22
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: Wrapper gem for DigitalOcean
|