Class: BsPlus::Cli

Inherits:
Thor show all
Defined in:
lib/bs_plus/cli.rb

Instance Method Summary collapse

Instance Method Details

#get(url) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/bs_plus/cli.rb', line 17

def get url
  url = "http://#{url}" unless url[/http/]

  case options[:browsers]
  when 'popular' then Browser::Popular
  when 'ies'     then Browser::IEs
  else
    Browser.parse options[:browsers]
  end.
    tap {|e| puts "Snapshotting with #{e.size} browsers:"}.
    tap!{|e| Parallel.map(e, in_threads: 5) {|b| b.snapshot url}}
end

#listObject



9
10
11
12
13
# File 'lib/bs_plus/cli.rb', line 9

def list
  puts 'browser browser_version os os_version device'
  puts '--------------------------------------------'
  Browser.all.each {|e| puts e }
end