app/services/landable/screenshot_service.rb in landable-1.13.1 vs app/services/landable/screenshot_service.rb in landable-1.13.2
- old
+ new
@@ -3,12 +3,12 @@
module Landable
class ScreenshotService
class Error < StandardError; end
class << self
- def capture url
- if not Landable.configuration.publicist_url
+ def capture(url)
+ if !Landable.configuration.publicist_url
Rails.logger.warn "Couldn't generate screenshot for #{url}; no Landable.configuration.publicist_url configured"
else
screenshots_uri = URI(Landable.configuration.publicist_url)
screenshots_uri.path = '/api/services/screenshots'
@@ -20,13 +20,12 @@
file.write response.body
file.rewind
file
else
- raise Error, "Received #{response.code} back from #{screenshots_uri.to_s}"
+ fail Error, "Received #{response.code} back from #{screenshots_uri}"
end
end
end
end
-
end
end