Class: Balancer::Init

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/balancer/init.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cli_optionsObject

Ugly, but when the class_option is only defined in the Thor::Group class it doesnt show up with cli-template new help :( If anyone knows how to fix this let me know. Also options from the cli can be pass through to here



15
16
17
18
19
20
21
22
23
# File 'lib/balancer/init.rb', line 15

def self.cli_options
  [
    [:force, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files."],
    [:git, type: :boolean, default: true, desc: "Git initialize the project"],
    [:subnets, type: :array, default: ["REPLACE_ME"], desc: "Subnets"],
    [:security_groups, type: :array, default: ["REPLACE_ME"], desc: "Security groups"],
    [:vpc_id, default: "REPLACE_ME", desc: "Vpc id"],
  ]
end

.source_rootObject



29
30
31
# File 'lib/balancer/init.rb', line 29

def self.source_root
  File.expand_path("../template", File.dirname(__FILE__))
end

Instance Method Details

#init_projectObject



33
34
35
36
# File 'lib/balancer/init.rb', line 33

def init_project
  puts "Setting up balancer files."
  directory ".", "."
end

#user_messageObject



38
39
40
41
42
43
44
45
46
47
# File 'lib/balancer/init.rb', line 38

def user_message
  puts <<-EOL
#{"="*64}
Congrats 🎉 Balancer starter files succesfully created.

Check out .balancer/profiles/default.yml make make sure the settings like subnets and vpc_id are okay.  Then run `balanace create` to to create an ELB, Target Group and listener. Example:

balancer create my-elb
EOL
end