Class: UtilityCommands

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

Overview

:reek:FeatureEnvy { enabled: false } :reek:UtilityFunction { enabled: false }

Instance Method Summary collapse

Instance Method Details

#browser(default_browser = nil) ⇒ Object



34
35
36
37
38
# File 'lib/commands/utility_commands.rb', line 34

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

#browser_options(*opts) ⇒ Object



44
45
46
47
# File 'lib/commands/utility_commands.rb', line 44

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

#build(build_type) ⇒ Object



78
79
80
81
82
# File 'lib/commands/utility_commands.rb', line 78

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

  build_type == 'android' ? Utilities.download_android_build : Utilities.download_ios_build
end

#buildsObject



86
87
88
89
# File 'lib/commands/utility_commands.rb', line 86

def builds
  Utilities.download_android_build
  Utilities.download_ios_build
end

#path(default_path) ⇒ Object



17
18
19
20
# File 'lib/commands/utility_commands.rb', line 17

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

#platform(platform) ⇒ Object



72
73
74
# File 'lib/commands/utility_commands.rb', line 72

def platform(platform)
  Utilities.platform = platform
end

#raidObject



55
56
57
58
59
60
61
62
# File 'lib/commands/utility_commands.rb', line 55

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

#url(default_url) ⇒ Object



24
25
26
# File 'lib/commands/utility_commands.rb', line 24

def url(default_url)
  Utilities.url = default_url
end