Class: CreateGate

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



4
5
6
# File 'lib/gates/create_gate.rb', line 4

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#create_infraObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gates/create_gate.rb', line 8

def create_infra
  say "✍️  Setting up your gate..."

  namespace_id = ConfigHelper.get_namespace_id
  sucess, res = Infra.create_project(namespace_id, 'gate', 'graph')

  if sucess
    directory "../templates/gate", 'gate'
    ConfigHelper.save_config('project', 'gate', res)
    
    say "👍 Gate created successfully!"      
  else
    say "⚠️  Error creating gate. Reason: #{res['error']}"
  end
end