Class: CreateGate
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- CreateGate
- Includes:
- Thor::Actions
- Defined in:
- lib/gates/create_gate.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
4 5 6 |
# File 'lib/gates/create_gate.rb', line 4 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#create_directory ⇒ Object
8 9 10 11 12 |
# File 'lib/gates/create_gate.rb', line 8 def create_directory say "✍️ Setting up your gate..." directory "../templates/gate", 'gate' end |
#create_infra ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gates/create_gate.rb', line 14 def create_infra namespace_config = Config.load(".byld/config.yml") sucess, res = Infra.create_project(namespace_config['namespace']['id'], 'gate', 'graph') if sucess say "👍 Gate created successfully!" gate_config = Config.load("gate/.byld/config.yml") gate_config.merge!(project: res) else say "⚠️ Error creating gate. Reason: #{res}" end end |