cnvrg 1.5.8.2 → 1.5.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cnvrg/cli.rb +14 -11
- data/lib/cnvrg/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: 6e0e5929b113d8ed609a60d8d56decab7b58bea23bffd78464f8f89d866da75f
|
4
|
+
data.tar.gz: ddf90c2a11b51dd815de477b5fce045bcbcd9b82264d7ad58e2d0ebf156b9d87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ab58f71105f545890ac525a4d6b63b4c1f4e13ff98aaf84eece9fc78d7dc64171dc0dda09eae64f763653ec1131b7e15b259f3ac02aa6d630a0b23477dc090d
|
7
|
+
data.tar.gz: 83c31f8335275f8f15aa51eef33e08579234178e8daf31929d01cc3cf73a94c87d82eec1132b64f5a3004e917d48df9d5cee0258f762f9883eec79f0e6a3ddb9
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -243,7 +243,7 @@ module Cnvrg
|
|
243
243
|
map %w(-v --version) => :version
|
244
244
|
|
245
245
|
desc 'api CNVRG_APPLICATION_URL', 'Set api url, e.g cnvrg --api "https://cnvrg.io/api"'
|
246
|
-
method_option :verify_ssl, :type => :boolean, :aliases => ["-s", "--verify_ssl"], :default =>
|
246
|
+
method_option :verify_ssl, :type => :boolean, :aliases => ["-s", "--verify_ssl"], :default => false
|
247
247
|
|
248
248
|
def set_api_url(url)
|
249
249
|
log_handler()
|
@@ -255,7 +255,7 @@ module Cnvrg
|
|
255
255
|
if !url.end_with? "/api"
|
256
256
|
url = url + "/api"
|
257
257
|
end
|
258
|
-
verify_ssl = options["verify_ssl"]
|
258
|
+
verify_ssl = options["verify_ssl"] || false
|
259
259
|
begin
|
260
260
|
if !File.directory? home_dir + "/.cnvrg"
|
261
261
|
FileUtils.mkdir_p([home_dir + "/.cnvrg", home_dir + "/.cnvrg/tmp"])
|
@@ -271,6 +271,7 @@ module Cnvrg
|
|
271
271
|
end
|
272
272
|
|
273
273
|
|
274
|
+
|
274
275
|
rescue
|
275
276
|
config = {owner: "", username: "", version_last_check: get_start_day(), api: url, compression_path: compression_path ,verify_ssl: verify_ssl }
|
276
277
|
end
|
@@ -414,7 +415,7 @@ module Cnvrg
|
|
414
415
|
|
415
416
|
|
416
417
|
end
|
417
|
-
if set_owner(choose_owner, result["username"]
|
418
|
+
if set_owner(choose_owner, result["username"])
|
418
419
|
say "Setting default owner: #{choose_owner}", Thor::Shell::Color::GREEN
|
419
420
|
else
|
420
421
|
say "Setting default owenr has failed, try to run cnvrg --config-default-owner", Thor::Shell::Color::RED
|
@@ -536,17 +537,14 @@ module Cnvrg
|
|
536
537
|
log_message("Authenticated successfully as #{@email}", Thor::Shell::Color::GREEN)
|
537
538
|
|
538
539
|
owners = result["owners"]
|
539
|
-
urls = result["urls"]
|
540
540
|
choose_owner = result["username"]
|
541
|
-
ow_index = 0
|
542
541
|
if owners.empty?
|
543
542
|
choose_owner = result["username"]
|
544
543
|
else
|
545
544
|
choose_owner = owners[0]
|
546
545
|
end
|
547
546
|
|
548
|
-
|
549
|
-
if set_owner(choose_owner, result["username"], urls[ow_index])
|
547
|
+
if set_owner(choose_owner, result["username"])
|
550
548
|
log_message("Setting default owner: #{choose_owner}", Thor::Shell::Color::GREEN)
|
551
549
|
|
552
550
|
else
|
@@ -5378,7 +5376,7 @@ module Cnvrg
|
|
5378
5376
|
|
5379
5377
|
end
|
5380
5378
|
|
5381
|
-
def set_owner(owner, username, url)
|
5379
|
+
def set_owner(owner, username, url=nil)
|
5382
5380
|
home_dir = File.expand_path('~')
|
5383
5381
|
begin
|
5384
5382
|
if !File.directory? home_dir + "/.cnvrg"
|
@@ -5387,10 +5385,15 @@ module Cnvrg
|
|
5387
5385
|
if !File.exist?(home_dir + "/.cnvrg/config.yml")
|
5388
5386
|
FileUtils.touch [home_dir + "/.cnvrg/config.yml"]
|
5389
5387
|
end
|
5390
|
-
if url.nil? or url.empty?
|
5391
|
-
url = "https://cnvrg.io/api"
|
5392
|
-
end
|
5393
5388
|
config = YAML.load_file(home_dir + "/.cnvrg/config.yml")
|
5389
|
+
if config.blank?
|
5390
|
+
config = {api: "https://app.cnvrg.io/api" }
|
5391
|
+
|
5392
|
+
end
|
5393
|
+
|
5394
|
+
if url.blank?
|
5395
|
+
url = config[:api]
|
5396
|
+
end
|
5394
5397
|
compression_path = "#{home_dir}/.cnvrg/tmp"
|
5395
5398
|
if config and !config.nil? and !config.empty? and !config.to_h[:compression_path].nil?
|
5396
5399
|
compression_path = config.to_h[:compression_path]
|
data/lib/cnvrg/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cnvrg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.8.
|
4
|
+
version: 1.5.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yochay Ettun
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-10-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|