Class: RubyNative::CLI::Preview

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_native/cli/preview.rb

Constant Summary collapse

TUNNEL_URL_PATTERN =
%r{https://[a-z0-9-]+\.trycloudflare\.com}
CONFIG_PATH =
"/native/config.json"
TUNNEL_READY_TIMEOUT =
60
TUNNEL_POLL_INTERVAL =
1
PUBLIC_NAMESERVERS =
["1.1.1.1", "8.8.8.8"].freeze

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Preview

Returns a new instance of Preview.



15
16
17
# File 'lib/ruby_native/cli/preview.rb', line 15

def initialize(argv)
  @port = parse_port(argv)
end

Instance Method Details

#runObject



19
20
21
22
23
# File 'lib/ruby_native/cli/preview.rb', line 19

def run
  check_cloudflared!
  check_local_server!
  start_tunnel
end