lib/deliver/app_screenshot.rb in deliver-1.9.0 vs lib/deliver/app_screenshot.rb in deliver-1.10.0
- old
+ new
@@ -42,11 +42,11 @@
self.language = language
screen_size ||= self.class.calculate_screen_size(path)
self.screen_size = screen_size
- Helper.log.error "Looks like the screenshot given (#{path}) does not match the requirements of #{screen_size}" unless self.is_valid?
+ UI.error("Looks like the screenshot given (#{path}) does not match the requirements of #{screen_size}") unless self.is_valid?
end
# The iTC API requires a different notation for the device
def device_type
matching = {
@@ -137,11 +137,11 @@
end
def self.calculate_screen_size(path)
size = FastImage.size(path)
- raise "Could not find or parse file at path '#{path}'" if size.nil? or size.count == 0
+ UI.user_error!("Could not find or parse file at path '#{path}'") if size.nil? or size.count == 0
# Walk up two directories and test if we need to handle a platform that doesn't support landscape
path_component = Pathname.new(path).each_filename.to_a[-3]
if path_component.eql? "appleTV"
skip_landscape = true
@@ -160,10 +160,10 @@
end
end
end
end
- raise "Unsupported screen size #{size} for path '#{path}'".red
+ UI.user_error!("Unsupported screen size #{size} for path '#{path}'")
end
end
ScreenSize = AppScreenshot::ScreenSize
end