Class: Browserctl::Commands::Watch

Inherits:
Object
  • Object
show all
Defined in:
lib/browserctl/commands/watch.rb

Class Method Summary collapse

Class Method Details

.run(client, args) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/browserctl/commands/watch.rb', line 8

def self.run(client, args)
  name     = args.shift
  selector = args.shift
  timeout  = (FlagExtractor.extract_opt(args, "--timeout") || 30).to_f
  abort "usage: browserctl watch <page> <selector> [--timeout N]" unless name && selector
  puts client.watch(name, selector, timeout: timeout).to_json
end