sct 0.1.12 → 0.1.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa4a9c05109327130b6c1b08f44e0658be4db63e1c8402118ee9b7c7a14463cf
4
- data.tar.gz: 88e20c8c3e6ff0fac970955b03ae2d95010544cd158c733507cba312b5507499
3
+ metadata.gz: 8bd1ac3662dc8475d5837a4736765063bdbbc5ed1b3471a6c26ab8d007be85b6
4
+ data.tar.gz: 3ed935254cd71bbe3b505046ef2243c1a3a4df4b23826a7fcfbe2d64c28da0fe
5
5
  SHA512:
6
- metadata.gz: b153495574021b51ee936580da13b4a177a22e0e8c5ad8e74be877e21cbb65be0570bfa24945941599807f1658786ffbe7d8d68002cb7759e8ce07f6cb3628b7
7
- data.tar.gz: 3b2dba1bd88a72519a8043fae447568b9d8927e6c5e26ce40ba45c35275927ea18949371e88011f195af2dae2986df83d0110c2aa39a43dcadc45e6395bbbbef
6
+ metadata.gz: 4111e359e86ebcf1a8df22534acc55f0ad6ebed32540c1068f4b094718156e49a1b2083fd9c1391e04eca44763c2dfa0f847fee4f48d4ffe6eb052f1a6640364
7
+ data.tar.gz: 0ab52f35394748422cad25e3745daf770846a82add1a0601cbbf9b8641b04694db78651d075ef10c1ebaa396167998650d41b1728e80cb98f320827114fb9294
@@ -36,17 +36,32 @@ module Sct
36
36
  end
37
37
 
38
38
  hosts_paths.each do |hosts_path|
39
- hosts = Hosts::File.read(hosts_path)
40
-
41
- if ([ingressAddress].any? { |ip| hosts.to_s =~ /#{ip}/ })
42
- puts "Skipped patching #{hosts_path} (already up to date)".green
43
- else
44
- validate_if_exist(hosts)
45
- add_entry(ingressAddress, hosts)
46
- hosts.write
47
- puts "Patched #{hosts_path} with #{ingressAddress}".green
39
+
40
+ begin
41
+ hosts = Hosts::File.read(hosts_path)
42
+
43
+ if ([ingressAddress].any? { |ip| hosts.to_s =~ /#{ip}/ })
44
+ puts "Skipped patching #{hosts_path} (already up to date)".green
45
+ else
46
+ validate_if_exist(hosts)
47
+ add_entry(ingressAddress, hosts)
48
+ hosts.write
49
+ puts "Patched #{hosts_path} with #{ingressAddress}".green
50
+ end
51
+ rescue ArgumentError
52
+ puts "🔥 Can't read your hostfile".red
53
+ puts " Please update your hostsfile manually at #{hosts_path} with the following entries"
54
+ puts " "
55
+ puts " #{ingressAddress} spend.cloud.local".yellow
56
+ puts " #{ingressAddress} mail.spend.cloud.local".yellow
57
+ puts " #{ingressAddress} config.spend.cloud.local".yellow
58
+ puts " #{ingressAddress} spend-cloud.spend.cloud.local".yellow
59
+ puts " #{ingressAddress} docs.spend.cloud.local".yellow
60
+ puts " "
48
61
  end
62
+
49
63
  end
64
+
50
65
  end
51
66
 
52
67
  def add_entry(url, hosts)
@@ -1,3 +1,3 @@
1
1
  module Sct
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reshad Farid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-06 00:00:00.000000000 Z
11
+ date: 2020-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: class_interface