Class: UtilityCommands

Inherits:
Thor
  • Object
show all
Defined in:
lib/commands/utility_commands.rb

Instance Method Summary collapse

Instance Method Details

#browser(default_browser = nil) ⇒ Object



32
33
34
35
# File 'lib/commands/utility_commands.rb', line 32

def browser(default_browser = nil)
  Utilities.browser = default_browser if default_browser
  browser_options(options[:opts]) if options[:opts] || options[:delete]
end

#browser_options(*opts) ⇒ Object



41
42
43
44
# File 'lib/commands/utility_commands.rb', line 41

def browser_options(*opts)
  Utilities.browser_options = opts unless opts.empty?
  Utilities.delete_browser_options if options[:delete]
end

#builds(build_type) ⇒ Object



73
74
75
76
77
# File 'lib/commands/utility_commands.rb', line 73

def builds(build_type)
  raise 'Please select one of the following build types: android, ios, both' unless %w[android ios both].include?(build_type)

  Utilities.download_builds build_type
end

#path(default_path) ⇒ Object



15
16
17
18
# File 'lib/commands/utility_commands.rb', line 15

def path(default_path)
  type = options.empty? ? 'page' : options.keys.first
  Utilities.send("#{type}_path=", default_path)
end

#platform(platform) ⇒ Object



68
69
70
# File 'lib/commands/utility_commands.rb', line 68

def platform(platform)
  Utilities.platform = platform
end

#raidObject



52
53
54
55
56
57
58
# File 'lib/commands/utility_commands.rb', line 52

def raid
  if options[:parallel]
    Utilities.parallel_run(options[:opts])
  else
    Utilities.run(options[:opts])
  end
end

#url(default_url) ⇒ Object



22
23
24
# File 'lib/commands/utility_commands.rb', line 22

def url(default_url)
  Utilities.url = default_url
end