Sha256: d541e9d761effcdb75e5728e8558e3b1c77aa3171614f649a941d76c8073be80

Contents?: true

Size: 850 Bytes

Versions: 2

Compression:

Stored size: 850 Bytes

Contents

require 'di'
require 'ADB'

require 'stf/client'
require 'stf/log/log'
require 'stf/interactor/stop_debug_session_interactor'
require 'stf/model/device_list'

module Stf
  class StopAllDebugSessionsInteractor
    include Log
    include ADB

    # byFilter:
    # exceptFilter:
    def execute(options = {})
      DI[:demonizer].kill unless options[:nokill]

      stf_devices = DeviceList.new(DI[:stf].get_user_devices)

      stf_devices = stf_devices.byFilter options[:byFilter] if options[:byFilter]
      stf_devices = stf_devices.exceptFilter options[:exceptFilter] if options[:exceptFilter]

      connected_devices = devices()
      remote_devices = stf_devices.asConnectUrlList

      pending_disconnect = connected_devices & remote_devices

      pending_disconnect.each {|d| DI[:stop_debug_session_interactor].execute d}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stf-client-0.3.0.rc10 lib/stf/interactor/stop_all_debug_sessions_interactor.rb
stf-client-0.3.0.rc9 lib/stf/interactor/stop_all_debug_sessions_interactor.rb