lib/simctl/device.rb in simctl-1.5.4 vs lib/simctl/device.rb in simctl-1.5.5
- old
+ new
@@ -95,10 +95,20 @@
def path
@path ||= DevicePath.new(udid)
end
+ # Reloads the device information
+ #
+ # @return [void]
+ def reload!
+ device = SimCtl.device(udid: udid)
+ device.instance_variables.each do |ivar|
+ instance_variable_set(ivar, device.instance_variable_get(ivar))
+ end
+ end
+
# Renames the device
#
# @return [void]
def rename!(name)
SimCtl.rename_device(self, name)
@@ -146,9 +156,10 @@
Timeout::timeout(timeout) do
loop do
break if yield SimCtl.device(udid: udid)
end
end
+ reload!
end
def ==(other)
return false if other.nil?
return false unless other.kind_of? Device