Module: Seven::ASB::Operations
- Defined in:
- lib/automate-standard-baseline/operations.rb
Defined Under Namespace
Classes: Device
Constant Summary collapse
- @@default_device =
nil- @@default_time_out =
5 minutes
300- @@v_port =
nil
Instance Method Summary collapse
- #default_device ⇒ Object
- #install_and_start_oc_client(oc_apk_path) ⇒ Object
- #install_and_start_oc_client_by_url(url, saved_path = nil) ⇒ Object
- #install_or_dump_oc_client(path, reinstall = true, port) ⇒ Object
- #reset_data ⇒ Object
- #start_oc_client ⇒ Object
- #stop_oc_client(package_name) ⇒ Object
- #uninstall_oc_client(package_name) ⇒ Object
Instance Method Details
#default_device ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/automate-standard-baseline/operations.rb', line 22 def default_device unless @@default_device puts "create a default device" @@default_device = Device.new(self, ENV['ADB_DEVICE_ARG'],ENV['ADB_DEVICE_INDEX']) end @@default_device end |
#install_and_start_oc_client(oc_apk_path) ⇒ Object
59 60 61 |
# File 'lib/automate-standard-baseline/operations.rb', line 59 def install_and_start_oc_client(oc_apk_path) default_device.reinstall_oc_client(oc_apk_path) end |
#install_and_start_oc_client_by_url(url, saved_path = nil) ⇒ Object
55 56 57 |
# File 'lib/automate-standard-baseline/operations.rb', line 55 def install_and_start_oc_client_by_url(url, saved_path = nil) default_device.reinstall_oc_client_by_url(url, saved_path) end |
#install_or_dump_oc_client(path, reinstall = true, port) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/automate-standard-baseline/operations.rb', line 31 def install_or_dump_oc_client(path, reinstall = true,port) @@v_port=port if reinstall uri = URI.parse(path) if uri.scheme == 'http' or uri.scheme == 'https' install_and_start_oc_client_by_url(path) else install_and_start_oc_client(path) end else #log "Only dump the OC info but not re-install OC client." #oc_info = dump_oc_info(path, "logs/device-#{ENV['ADB_DEVICE_ARG']}-oc-info.yml") #log "OC Info: #{oc_info}" end end |
#reset_data ⇒ Object
49 50 51 52 53 |
# File 'lib/automate-standard-baseline/operations.rb', line 49 def reset_data() # install the oc client apk default_device.device_reset_data() end |
#start_oc_client ⇒ Object
67 68 69 |
# File 'lib/automate-standard-baseline/operations.rb', line 67 def start_oc_client() default_device.start_oc_client() end |
#stop_oc_client(package_name) ⇒ Object
71 72 73 |
# File 'lib/automate-standard-baseline/operations.rb', line 71 def stop_oc_client(package_name) default_device.stop_oc_client(package_name) end |
#uninstall_oc_client(package_name) ⇒ Object
63 64 65 |
# File 'lib/automate-standard-baseline/operations.rb', line 63 def uninstall_oc_client(package_name) default_device.uninstall_oc_client(package_name) end |