Class: BrowserMob::CLI::Main

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/browsermob/cli/main.rb

Instance Method Summary collapse

Instance Method Details

#port_clearanceObject



50
51
52
# File 'lib/browsermob/cli/main.rb', line 50

def port_clearance
  system('kill -9 $(lsof -i tcp:7676 -t)')
end

#setupObject



13
14
15
16
# File 'lib/browsermob/cli/main.rb', line 13

def setup
 bm = BrowserMobSetup.new
 bm.download_browsermob_proxy
end

#show_har(url) ⇒ Object



33
34
35
36
# File 'lib/browsermob/cli/main.rb', line 33

def show_har(url)
  bm = BrowserMobSetup.new
  bm.capture_traffic(url)
end

#show_har_click(url) ⇒ Object



25
26
27
28
29
30
# File 'lib/browsermob/cli/main.rb', line 25

def show_har_click(url)
  bm = BrowserMobSetup.new
  if options[:locator]
  bm.capture_traffic_with_click(url, "#{options[:locator]}")
  end
end

#versionObject



19
20
21
# File 'lib/browsermob/cli/main.rb', line 19

def version
  say BrowserMob::CLI::VERSION
end

#view_har_in_browserObject



39
40
41
42
# File 'lib/browsermob/cli/main.rb', line 39

def view_har_in_browser
  bm = BrowserMobSetup.new
  bm.show_har_data_browser
end

#view_har_in_YAMLObject



45
46
47
# File 'lib/browsermob/cli/main.rb', line 45

def view_har_in_YAML
  system("open /tmp/traffic.yml")
end