lib/dryrun.rb in dryrun-1.0.0 vs lib/dryrun.rb in dryrun-1.1.0
- old
+ new
@@ -2,10 +2,12 @@
require 'tmpdir'
require 'fileutils'
require 'dryrun/github'
require 'dryrun/version'
require 'dryrun/android_project'
+require 'dryrun/install_application_command'
+require 'dryrun/test_application_command'
require 'dryrun/device'
require 'highline/import'
require 'openssl'
require 'open3'
require 'optparse'
@@ -23,10 +25,11 @@
@flavour = ''
@tag = nil
@branch = 'master'
@devices = []
@cleanup = false
+ @command = InstallApplicationCommand.new
# Parse Options
create_options_parser(arguments)
end
@@ -72,10 +75,14 @@
opts.on('-v', '--version', 'Displays the version') do
puts Dryrun::VERSION
exit
end
+ opts.on('-a', '--android-test', 'Execute android tests') do
+ @command = TestApplicationCommand.new
+ end
+
opts.parse!
end
end
def outdated_verification
@@ -116,11 +123,11 @@
puts 'No devices attached, but I\'ll run anyway' if @devices.empty?
if @devices.size >= 2
puts 'Pick your device (1,2,3...):'
- @devices.each_with_index.map { |key, index| puts "#{index.to_s.green} - #{key.name} \n" }
+ @devices.each_with_index.map {|key, index| puts "#{index.to_s.green} - #{key.name} \n"}
input = gets.chomp
@device = if input.match(/^\d+$/) && input.to_i <= (@devices.length - 1) && input.to_i >= 0
@devices[input.to_i]
@@ -196,10 +203,10 @@
puts "Using custom app folder: #{@app_path.green}" if @app_path
puts "Using custom module: #{@custom_module.green}" if @custom_module
# clean and install the apk
- android_project.install
+ android_project.execute_command(@command)
puts "\n> If you want to remove the app you just installed, execute:\n#{android_project.uninstall_command.yellow}\n\n"
end
end
end