Class: Explorer::CLI::Proxy
- Inherits:
-
Thor
- Object
- Thor
- Explorer::CLI::Proxy
- Defined in:
- lib/explorer/cli/proxy.rb
Instance Method Summary collapse
Instance Method Details
#add(domain, host, port) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/explorer/cli/proxy.rb', line 25 def add(domain, host, port) Celluloid.logger = nil # Silence celluloid ipc = IPCClient.new ipc.hostmap_add(domain, host, port) puts "Added #{domain} to proxy" rescue Errno::ENOENT puts Rainbow('Explore is not running').color(:red).bright end |
#list ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/explorer/cli/proxy.rb', line 8 def list Celluloid.logger = nil # Silence celluloid ipc = IPCClient.new data = ipc.hostmap_list.map do |k, v| { domain: "[yellow]#{k}[/]", host: "[yellow]#{v['host']}[/]", port: "[yellow]#{v['port']}[/]", } end Formatador.display_compact_table(data, [:domain, :host, :port]) rescue Errno::ENOENT puts Rainbow('Explore is not running').color(:red).bright end |
#remove(domain) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/explorer/cli/proxy.rb', line 36 def remove(domain) Celluloid.logger = nil # Silence celluloid ipc = IPCClient.new ipc.hostmap_remove(domain) puts "Removed #{domain} from proxy" rescue Errno::ENOENT puts Rainbow('Explore is not running').color(:red).bright end |