sct 0.1.0 → 0.1.1

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: 762ae0c4c6894b093725f8743e0ca0b639d28bd2d88a572a04817a704e1d1613
4
- data.tar.gz: ed0c32930792fcc5471c6e74e0a5cd79b9635fb2a4c0612217357f2e3ceabe6a
3
+ metadata.gz: 9bacd93ef13d52b6b218f43b7d5f6b522f4572806506af40d6baf7bd01829d96
4
+ data.tar.gz: feedea275908afa26178138c3433409878a7fc3580d12d8e720245781fa3a2b1
5
5
  SHA512:
6
- metadata.gz: 4dc5aff3e3eb2879a5921e5303f0bb9887ba11c7dc0a77d6d58ebc620d5aa478543a6f9a177a536ef4626e8011f5f670c062e6dfb06cdbb23d077c2b5f5e9bbe
7
- data.tar.gz: 5d1f86be5ded9b2171ecb52ff52d2a4390825cd5f1b746a73376a7f6c3af142edb5dc88cd11361ade50202b531a242418063427e909546b77920d56f1ebaeef4
6
+ metadata.gz: e5ee00860cd8f572bf22cd36145756284401be05f613f80776243989d3181ca236cda7a04f64e2b2002783009193b149b2770d3854c48df1536e4b9ee1dc3d10
7
+ data.tar.gz: 9e067e4768dd9885f2eb294c6be1f8243420b9bc7dea65f24c84129353944e1d9e532390d9647e778784735c2602bcc7be5ba44747a801ba0d11214de7e93c9d
data/.DS_Store CHANGED
Binary file
data/Gemfile.lock CHANGED
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sct (0.1.0)
5
- class_interface
4
+ sct (0.1.1)
5
+ class_interface (~> 0.1.1)
6
6
  colored (~> 1.2)
7
7
  commander (~> 4.4.7)
8
+ highline (>= 1.7.2)
8
9
  hosts (~> 0.1.1)
9
10
 
10
11
  GEM
data/bin/sct CHANGED
@@ -4,7 +4,7 @@ require 'commander/import'
4
4
  require 'sct'
5
5
 
6
6
  if RUBY_VERSION < '2.0.0'
7
- abort("Sct requires Ruby 2.0.0 or higher")
7
+ abort("sct requires Ruby 2.0.0 or higher")
8
8
  end
9
9
 
10
10
  def self.windows?
@@ -12,10 +12,10 @@ def self.windows?
12
12
  end
13
13
 
14
14
  if ARGV.include?('-v') || ARGV.include?('--version')
15
- # This will print out the Sct binary path right above the
15
+ # This will print out the sct binary path right above the
16
16
  # version number. Very often, users are not aware they have
17
- # e.g. bundled Sct installed
18
- puts("Sct installation at path:")
17
+ # e.g. bundled sct installed
18
+ puts("sct installation at path:")
19
19
  puts(File.expand_path(__FILE__))
20
20
  puts("-----------------------------")
21
21
  end
data/lib/.DS_Store CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- require 'Sct/command_interface'
1
+ require 'sct/command_interface'
2
2
 
3
3
  module Sct
4
4
 
@@ -1,6 +1,6 @@
1
1
  module Sct
2
2
  class SctFolder
3
- FOLDER_NAME = "Sct"
3
+ FOLDER_NAME = "sct"
4
4
 
5
5
  def self.path
6
6
  value ||= "./#{FOLDER_NAME}/" if File.directory?("./#{FOLDER_NAME}/")
@@ -1,4 +1,4 @@
1
- module Vcdm
1
+ module Sct
2
2
  class Helpers
3
3
 
4
4
  def self.ingressUrl
@@ -1,11 +1,13 @@
1
+ require 'highline'
2
+
1
3
  module Sct
2
4
  class Setup
3
5
 
4
- attr_accessor :Sctfile_content
6
+ attr_accessor :sctfile_content
5
7
 
6
8
  def self.start
7
9
 
8
- require "Sct/Sct_folder"
10
+ require "sct/sct_folder"
9
11
 
10
12
  if Sct::SctFolder.setup?
11
13
  puts "Already setup at path `#{Sct::SctFolder.path}`"
@@ -15,22 +17,41 @@ module Sct
15
17
  Sct::SctFolder.create_folder!
16
18
 
17
19
  setup = self.new
18
- setup.write_Sctfile
20
+ setup.write_sctfile
19
21
 
20
22
  end
21
23
 
22
- def write_Sctfile
24
+ def write_sctfile
25
+
26
+ sctfile_file_name = "Sctfile"
27
+
28
+ cli = HighLine.new
23
29
 
24
- Sctfile_file_name = "Sctfile"
30
+ email = cli.ask("What is your email address?") { |q|
31
+ q.validate = URI::MailTo::EMAIL_REGEXP
32
+ }
33
+
34
+ cloud_proxy = cli.ask("What is the path of your cloud proxy json credentials?") { |q|
35
+ q.default = "/.config/gcloud/application_default_credentials.json"
36
+ }
37
+
38
+ host_path = cli.choose do |menu|
39
+ menu.prompt = "What is the path of your hostfile?"
40
+ menu.choice(:unix) { "/etc/hosts" }
41
+ menu.choices(:windows) { "/mnt/c/Windows/System32/drivers/etc/hosts" }
42
+ menu.default = :unix
43
+ end
25
44
 
26
- self.Sctfile_content = ""
27
- self.Sctfile_content << "email=address@visma.com"
45
+ self.sctfile_content = ""
46
+ self.sctfile_content << "#{email} \n"
47
+ self.sctfile_content << "cloud-proxy-path=#{cloud_proxy} \n"
48
+ self.sctfile_content << "hostpath=#{host_path} \n"
28
49
 
29
- Sctfile_path = File.join(Sct::SctFolder.path, Sctfile_file_name)
50
+ sctfile_path = File.join(Sct::SctFolder.path, sctfile_file_name)
30
51
 
31
- File.write(Sctfile_path, self.Sctfile_content)
52
+ File.write(sctfile_path, self.sctfile_content)
32
53
 
33
- puts "Generated Sctfile at #{Sctfile_path}"
54
+ puts "Generated Sctfile at #{sctfile_path}"
34
55
 
35
56
  end
36
57
  end
data/lib/sct/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sct
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/sct.rb CHANGED
@@ -1,20 +1,27 @@
1
+ require 'sct'
2
+ require 'sct/command'
1
3
  require "sct/version"
2
- require "colored"
4
+ require "sct/sct_folder"
5
+ require 'colored'
6
+ require 'commander'
3
7
 
4
8
  module Sct
5
- class Error < StandardError; end
6
-
7
9
  class SctCore
8
10
 
9
- def self.take_off(cmds)
10
- program :name, 'Sct'
11
+ program :name, 'sct'
11
12
  program :version, Sct::VERSION
12
- program :summary, 'CLI helper tool for local Sct development'
13
- program :description, 'Sct is a CLI tool for developers using the Visma Continuous Deployment Model in conjunction with the Google Cloud Platform (GCP). It provides multiple command to set up and maintain a kubernetes cluster on a machine for local development'
13
+ program :summary, 'CLI helper tool for local SCT development'
14
+ program :description, 'SCT is a CLI tool for developers using the Visma Continuous Deployment Model in conjunction with the Google Cloud Platform (GCP). It provides multiple command to set up and maintain a kubernetes cluster on a machine for local development'
14
15
 
16
+ def self.take_off(cmds)
17
+ self.new.run
15
18
  cmds.each { |cmd| registerCommand(cmd) }
16
19
  end
17
20
 
21
+ def run
22
+
23
+ end
24
+
18
25
  def self.registerCommand(cmd)
19
26
  # validate Command Class
20
27
  if cmd.class != Class ||
@@ -51,5 +58,4 @@ module Sct
51
58
  end
52
59
 
53
60
  end
54
-
55
61
  end
data/sct.gemspec CHANGED
@@ -28,10 +28,11 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = ["sct"]
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_dependency "class_interface"
31
+ spec.add_dependency "class_interface", "~> 0.1.1"
32
32
  spec.add_dependency "colored", "~> 1.2"
33
33
  spec.add_dependency "hosts", "~> 0.1.1"
34
34
  spec.add_dependency "commander", "~> 4.4.7"
35
+ spec.add_dependency "highline", ">= 1.7.2"
35
36
 
36
37
  spec.add_development_dependency "bundler", "~> 2.0"
37
38
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
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-01-16 00:00:00.000000000 Z
11
+ date: 2020-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: class_interface
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: colored
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.4.7
69
+ - !ruby/object:Gem::Dependency
70
+ name: highline
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 1.7.2
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 1.7.2
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement