Class: Expose
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Expose
- Includes:
- Thor::Actions
- Defined in:
- lib/gates/expose.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
8 9 10 |
# File 'lib/gates/expose.rb', line 8 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#create_client ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gates/expose.rb', line 12 def create_client puts "☝️ Connecting #{name}..." namespace_id, gate_id = ConfigHelper.get_namespace_and_project success, res = Infra.generate_client(name, namespace_id) if success create_file ".byld/gen/#{name.underscore}.rb", res.first['content'] puts "🔗 #{name} connected successfully!" else puts "⚠️ Error connecting block. Reason: #{res['error']}" end end |
#create_edge ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/gates/expose.rb', line 25 def create_edge puts "☝️ Exposing #{name}..." namespace_id, gate_id = ConfigHelper.get_namespace_and_project success, res = Infra.generate_edges(name, namespace_id) if success res.each do |edge| create_file "./edges/#{edge['name']}", edge['content'] puts "🌐 #{name} exposed successfully!" end else puts "⚠️ Error exposing block. Reason: #{res['error']}" end end |