Class: Fastlane::Maestro::Runner
- Inherits:
-
Object
- Object
- Fastlane::Maestro::Runner
- Defined in:
- lib/fastlane/plugin/maestro/helper/runner.rb
Class Method Summary collapse
Class Method Details
.command?(name) ⇒ Boolean
54 55 56 57 |
# File 'lib/fastlane/plugin/maestro/helper/runner.rb', line 54 def self.command?(name) `which #{name}` $?.success? end |
.download_samples ⇒ Object
47 48 49 50 51 52 |
# File 'lib/fastlane/plugin/maestro/helper/runner.rb', line 47 def self.download_samples maestro_path = ENV["HOME"] + "/.maestro/bin/maestro" Dir.chdir(ENV["PWD"]) do system("#{maestro_path} download-samples", out: $stdout, err: :out, exception: true) end end |
.install ⇒ Object
43 44 45 |
# File 'lib/fastlane/plugin/maestro/helper/runner.rb', line 43 def self.install system("curl -Ls 'https://get.maestro.mobile.dev' | bash", out: $stdout, err: :out, exception: true) end |
.run(options) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fastlane/plugin/maestro/helper/runner.rb', line 8 def self.run() # TODO: add possibility to specify maestro path maestro_path = ENV["HOME"] + "/.maestro/bin/maestro" command = [maestro_path] unless [:device].empty? || [:device].nil? command.push("--device", [:device]) end command.push("test") unless [:report_type].empty? || [:report_type].nil? command.push("--format", [:report_type]) end unless [:output].empty? || [:output].nil? command.push("--output", [:output]) # Make sure that the output folder is available FileUtils.mkdir_p(File.dirname([:output])) end unless [:env_vars].nil? || [:env_vars].empty? [:env_vars].each do |key, value| command.push("-e", "#{key}=#{value}") end end command.push("#{[:tests]}") command_string = command.join(" ") UI.("Running command: #{command_string}") Dir.chdir(ENV["PWD"]) do # TODO: set exception based on parameter `failRun` system(command_string, out: $stdout, err: :out, exception: true) end end |