Top Level Namespace

Defined Under Namespace

Modules: Mobile, Mobmanager, OS, Platform

Instance Method Summary collapse

Instance Method Details

#is_partial_string_in_array?(part_of_string, in_array) ⇒ Boolean

Returns:

  • (Boolean)


60
61
62
63
64
65
# File 'lib/mobmanager/mobile/platform/android/device.rb', line 60

def is_partial_string_in_array?(part_of_string, in_array)
  in_array.each do |element|
    return true if part_of_string.include? element
    false
  end
end

#list_of_devices(text) ⇒ Object

TODO - move to a helper module maybe adb?



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/mobmanager/mobile/platform/android/device.rb', line 45

def list_of_devices(text)
  devices = []
  lines = text.split("\n")

  lines.each do |ele|
    if ele.include?("\t")
      devices << ele.split("\t")
    else
      devices << ele
    end
  end

  devices.flatten!
end